Use GNU parted for segmentation
Although you can use fdisk to quickly cut your split slot, fdisk cannot support a split slot larger than 2 TB! In this case, parted is required. Don't think you don't need 2 TB! In 2009, a single hard disk now has a capacity of up to 2 TB! If you have a built-in disk array device with the host system, using a single disk device of several TB is not impossible! So you have to learn this important tool! Parted!
Parted can be split directly in a command column. It is a very useful command! His syntax is a bit like this:
[Root @ WWW ~] # Parted [device] [Command [parameter] Option and parameter: command function: new Division: mkpart [primary| Logical | extended] [ext3 |Vfat] start and end split table: Print Delete split:Rm[Partition]
List table data of the current local machine using parted
[Root @ WWW ~] # Parted/dev/ HDC printmodel: ic35l040aver07 - 0 (IDE) <= Hard Disk interface and model Disk /Dev/HDC: 41 . 2 GB <= Disk File Name and capacity sector size (logical /Physical): 512b/512b <= Partition Table: msdos <= Split table form number start end size type file system flags 1 32 . 3kb 107 MB 107 MB primary ext3 boot 2 107 MB 10 . 6 GB 10 . 5 GB primary ext3 3 10 . 6 GB 15 . 8 GB 5240 MB primary ext3 4 15 . 8 GB 41 . 2 GB 25 . 3 GB extended 5 15 . 8 GB 16 . 9 GB 1045 MB logical Linux- Swap 6 16 . 9 GB18 . 9 GB 2056 MB logical ext3 7 18 . 9 GB 19 . 2 GB 263 MB logical Linux- Swap [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ]
The above is the simplest introduction to parted commands. You can use "Man parted" or "parted/dev/HDC help mkpart" to query more detailed data. The interesting thing is that the output of the split table. We split the preceding split into six parts to illustrate:
- Number: this is the number of the split slot! For example, "1" indicates/dev/hdc1;
- Start: How many MB is the starting position of the disk? Fun! He uses capacity as the unit!
- End: How many MB is the ending column located on this disk?
- Size: the size of the split slot is obtained from the analysis of the two;
- Type: the type of the split slot, including primary, extended, and logical;
- File System: similar to the fdisk System ID.
Next, we will try to create a new split slot! Because we only have the available logical split slots, we will choose the logical Split Type later!
Create a logical split slot with a capacity of about 512 MB
[Root @ WWW ~] # Parted/dev/HDC mkpart logical ext319. 2 GB19. 7 GB # refer to the Command introduction in the previous table because of our/Dev/hdc7 in19. 2 GB location ends, # So of course we need19. 2. continue to the next split at the location of GB. do you understand this? [Root @ WWW~] # Parted/dev/HDC print... omitted above .....718. 9 GB19. 2 GB 263 MB logical Linux-Swap819. 2 GB19. 7 GB 502 MB logical <= is just created!
Delete the created disk partition slot on the 8th.
[Root @ WWW ~] # Parted/dev/HDCRm 8# Delete it! It's amazing! Therefore, pay special attention to the issue of this command! # Because the... command takes effect immediately ~ If you make a mistake, you will cry ~
Linux disks larger than 2 TB use GPT partitioning
As we all know, I cannot use common fdisk commands when the disk partition in Linux is larger than 2 TB. Is there no way to use large-capacity disks in Linux? Answer: No.
In Linux, we can convert a large-capacity disk to the GPT format. Because the GPT format disk is equivalent to the 4*16 bytes of the four partition tables originally reserved in the MBR disk, only the first 16 bytes are reserved. Others are similar to extended partitions, the real Partition Table is 512 bytes later, so there is no limit on four primary partitions for the GPT disk table.
To operate the GPT disk partition table, we need to use the powerful parted command.
# Parted/dev/ Sdbgnu parted 1.8 . 1 Using /Dev/ Sdbwelcome to GNU parted ! Type \ ' Help \ 'to view a list of commands. (Parted) mklabel GPT # format the MBR disk as GPT (parted) mkpart primary 0 100 # Partition a primary partition (parted) mkpart primary with a starting position of 0 and a size of MB 100 200 # Partition a primary partition (parted) mkpart primary with a starting position of m and a size of m 0 - 1 # Partition all space into one partition print # print the current partition quit # Some commands (parted) mklable msdos may be used # If you want to reverse. after converting a GPT disk into an MBR disk, you must use mkfs. ext3 to format # partprobe # mkfs. ext3 -F/dev/sdb1
From http://vbird.dic.ksu.edu.tw/linux_basic/0230filesystem_6.php