In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
First, the knowledge of disk
1. Hard disk structure
1), data structure
Sectors: each track on a disk is equally divided into several arc segments, which are the sectors of the disk. The first sector of the hard disk is called the boot sector.
Track: when the disk rotates, if the head remains in one position, each head will draw a circular track on the surface of the disk. These circular tracks are called tracks.
Cylinder: in a disk group consisting of multiple plates, a cylinder consisting of faces of different plates but multiple tracks in the same radius circle.
2), physical structure
Disk: a hard disk has multiple disks, each with two sides.
Magnetic head: one magnetic head on each side.
3), storage capacity
Hard disk storage capacity = number of heads tracks per sector * bytes per sector.
2. Hard disk interface
According to the different data interfaces, the hard disk is roughly divided into ATA (IDE) and SATA, SCSI and SAS. The interface speed is not the actual data transmission speed of the hard disk.
ATA: the parallel port data cable connects the motherboard and the hard disk, the anti-interference is too poor, and the wiring occupies a large space, which is not conducive to the internal heat dissipation of the computer, and has been gradually replaced by SATA.
SATA: strong anti-interference, support hot plug and other functions, high speed, strong error correction ability.
SCSI:SCSI hard disk is widely used in work-grade personal computers and servers. When transmitting data, the CPU occupancy rate is low, the speed is fast, and it supports hot-swappable.
SAS:SAS is a new generation of SCSI technology, which is the same as SATA hard disk, which uses sequential technology to obtain higher transmission speed and can reach 6GB/s.
3 、 MRP
MRP is the master boot record, which is located in the first physical sector of the hard disk. MBR contains the master boot program of the hard disk and the hard disk partition table. The partition table has four partition records, each accounting for 16 bytes.
4. Disk partition representation
Common hard disk partitions can be divided into primary partition, extended partition and logical partition. Extended partitions cannot store content, but logical partitions can be created in extended partitions.
In Linux systems, hard drives and partitions are represented as different files.
Hard disk: IDE interface corresponds to "hdX" file, SCSI interface corresponds to "sdX" file. Among them, "X" is the serial number of the hard disk in the system, it should be noted that the device serial number of Linux is sorted by letters, so "X" represents the letters a, b, c, d and so on.
File system types in Linux
EXT4: the fourth generation extended file system, the partition used to hold data and directories, is the default file system used in Linux systems.
Features: typical journaling file system, easy to recover, better access performance and stability.
SWAP: swap file system, which is used to establish swap partitions for Linux systems. Swap partitions act like virtual memory and can alleviate the problem of insufficient physical memory to some extent.
XFS: a high-performance journaling file system that specializes in handling large files and can support millions of terabytes of storage space. Data recovery is also supported.
2. Manage disks and partitions
1. Detect and confirm the new hard drive
After the new hard drive is mounted and the host is started, the Linux system automatically detects and loads the hard drive without the need to install additional drivers. Execute the "fdisk-l" command to view and determine the device name and location of the new hard drive.
For existing partitions, the following information will be output as a list.
Device: the device file name of the partition.
Boot: whether you are in the boot partition or not, there will be a "*" symbol.
Start: the starting position of the partition on the hard disk.
End: the end position of the partition on the hard disk.
Blocks: the size of the partition, in Blocks. The default block size is bytes.
Id: the ID number corresponding to the partition. 83 represents the EXT4 partition and 8e represents the LVM logical partition.
System: partition type.
2. Plan the partitions in the hard disk
Operations such as creating, deleting, and changing partitions on the hard disk are also done through the fdisk command, as long as the device file on the hard disk is used as a parameter.
Common operation instructions in the interactive partition management interface.
"m" instruction-you can view the help of various operation instructions.
"p" instruction-lists the partitions on the hard disk.
"n" directive-create a new partition.
The "d" directive-deletes the partition.
"t" directive-change the type of partition.
"w" and "Q" directives-exit the fdisk partitioning tool.
Create two primary partitions
View the creation result
Create an extended partition and create a logical partition on the extended partition.
View the results of partition creation
Delete partition sdb1
Change the partition sdb5 type to Swap and the partition sdb6 type to FAT.
The partition setting is complete, exit and save the setting result, and confirm the setting result.
III. Managing the file system
We also have to format the partition after the partition is set up. Format the partition sdb2 as a XFS file system.
After formatting the partition, the partition is mounted. This is demonstrated by mounting the partition sdb2 to the / opt/demo01 directory as an example.
After that, we will unhang the sdb2.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.