linux--Disk Partitioning

Source: Internet
Author: User
Tags ide hard drive

Here is a summary of some of the recent learning disk partitions
Blog Park-Bang Bang sauce Good ********

1. File name of each hardware device in Linux
In a Linux system, each device is treated as a file.
Devices | The file name in Linux
IDE Hard Drive | /DEV/HD[A-D]
SCSI/SATA/USB HDD | /DEV/SD[A-P]
Floppy Drive | /DEV/FD[0-1]
Printers | 25-pin:/dev/lp[0-2] usb:/dev/usb/lp[0-15]
Mouse | USB:/DEV/USB/MOUSE[0-15] Ps2:/dev/psaux
Current Cdrom/dvdrom | /dev/cdrom
Current Mouse | /dev/mouse

IDE: Hard drive, main drive and optical drive, using 16-bit data parallel transmission, small size, fast data transmission. One IDE interface can only connect two external devices
SATA: Serial drive, serial transmission of data, each SATA drive exclusive one transmission channel (mainstream interface)


***********************************Disk Partitioning************************************
1. How the disk is connected to the device file name
IDE Interface:
IDE Name |    Master | Slave
IDE1 |    /dev/hda | /dev/hdb
IDE2 |    /DEV/HDC | /dev/hdd
SATA Interface:
Since disk interfaces such as SATA/USB/SCSI are driven using SCSI modules, the disk appliance filenames for these interfaces are in the format/dev/sd[a-p]. The device file name is determined by the order in which the Linux core detects the disk. That is, who was detected first, who is SDA.

2. Composition of the disk
1) Composition: disk drive (sector, magnetic column), robotic arm, disk reading head, spindle motor
2) The first sector of the disk records 2 messages:
Main boot Record area (Master boot recond,mbr): Where to install boot management
Partitioned tables (partition Table): Record the state of the entire hard disk split

3. Disk partition tables (partition table)
In the 64bytes capacity of the partition table, the total is divided into four record areas, each record area records the start and end of the section of the magnetic column number.
Assuming that the hard drive device file is named/dev/hda, there are 400 magnetic columns, the device filenames for the four dividers are as follows:
PS1:/DEV/HDA1 (1-100)
Ps2:/dev/hda2 (101-200)
Ps3:/dev/hda3 (201-300)
PS4:/DEV/HDA4 (301-400)
These four sets of delimited information becomeMainOrextending the divider slot。
The advantages of separation: Data security, high performance
In fact, you can separate a hard disk into more than 10 slots using the extended split method.
The purpose of the extended segmentation is to use the additional sectors to record the segmentation information, and the extension segment itself cannot be formatted, and we can continue to make the split record by extending the block to which the segment is pointing.
|<--------------------Entire disk----------------------->|
|--------------|<-----------Extended Division area------------->|
| mbr|---P1---|    p2|--l1--|--l2--|--l3--|--l4--|--l5--| (MBR contains P1 and P2, and P2 refers to L1-l4, because P3 and p4d are empty, so not marked)
They have the following device file names:
P1:/DEV/HDA1 (main division)
P2:/dev/hda2 (extended split)
L1:/DEV/HDA5 (The following are logical divisions.) Where the number 3,4 is reserved for the main divider, so this is starting from 5)
L2:/dev/hda6
L3:/dev/hda7
L4:/dev/hda8
L5:/dev/hda9
Note: There can be up to 4 primary and extended splits, and only one for the extended segment. Logical segmentation is a split slot cut out by an extended segment. Can be formatted, as the data access to the partition slot for the main segmentation and logical segmentation, the extended segmentation is not formatted. Both SATA and IDE hard disks can be logically split, but the IDE has a maximum of 59 logical splits (5-63) and only 11 SATA (5-15)
Partitioning is a hassle because it is a continuous disk space in the Magnetic column unit.

4. Boot process and main boot record area (MBR)
1) BIOS: Boot active firmware, will know the first device to boot
2) MBR: The primary boot record block in the first sector of the first bootable device, including the boot management program
3) Boot Manager (boot loader): a software that can read the core file to execute
4) Core Archives: Start the function of the operating system

key tasks for Boot Manager (boot loader):
1) Provide a menu: Users can choose different boot items
2) load the core archives: direct point to the bootable program section to start the operating system
3) Transfer Other loader: Transfer the power-on management function to other loader responsible for
The boot manager can also be installed in the boot sector (boot sector) for each divider in addition to the MBR.
If a computer is installed with both Windows and Linux systems, then the MBR is aware of their boot management program at the same time. Partition slot hda1 installed Windows, the divider hda2 installed Linux. When booting, the MBR boot Manager will provide 2 menu, menu 1 (M1) can directly load hda1 core files to boot. Menu 2 (M2) is responsible for handing over the boot management work to the start sector (boot sector) of the first divider.
Since the Windows installation, will actively overwrite the MBR and its own partition slot boot sector, there is no menu opportunity, and Linux installation, you can choose to install the boot manager in the MBR or the individual partition slot boot sector, its loader can manually set the menu, This means you can join the Windows boot option. Therefore, to install multiple boot, it is best to install Windows first, then install Linux.

5.linux installation mode, disk partition selection
# #目录树结构directory Tree
The directory tree schema is a file schema that is dominated by the root and then presents a branch-like directory structure, the most important of which is the root directory (root diretory:/), and all the files are derived from the root directory.

# #文件系统与目录树的关系 (Mount)
Mount: Using a directory as an entry point, the data of the disk partition slot is placed in that directory, that is, the contents of the divider can be read into the directory.


linux--Disk Partitioning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.