In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to understand redhat 6.5. parted disk partitioning tool, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
1, operating system version
[root@mygirl ~] # more / etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@mygirl ~] #
2. View the newly added disk
[root@mygirl ~] # fdisk-l | grep-I-- color "/ dev/sd"
Disk / dev/sda: 21.5 GB, 21474836480 bytes
/ dev/sda1 * 1 2168 17408000 83 Linux
/ dev/sda2 2168 2611 3562496 82 Linux swap / Solaris
Disk / dev/sdb: 21.5 GB, 21474836480 bytes
/ dev/sdb1 1 2610 20964793 + 83 Linux
Disk / dev/sdc: 2147 MB, 2147483648 bytes
3, view the parted command
[root@mygirl] # parted-- help
Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]
Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND (s) are given, run in
Interactive mode.
OPTIONs:
-h,-- help displays this help message
-l,-- list lists partition layout on all block devices
-m,-- machine displays machine parseable output
-s-- script never prompts for user intervention
-v,-- version displays the version
-a,-- align= [none | cyl | min | opt] alignment for new partitions
COMMANDs:
Align-check TYPE N check partition N for TYPE (min | opt)
Alignment
Check NUMBER do a simple check on the file system
Cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
Help [COMMAND] print general help, or help on
COMMAND
Mklabel,mktable LABEL-TYPE create a new disklabel (partition
Table)
Mkfs NUMBER FS-TYPE make a FS-TYPE file system on
Partition NUMBER
Mkpart PART-TYPE [FS-TYPE] START END make a partition
Mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
Move NUMBER START END move partition NUMBER
Name NUMBER NAME name partition NUMBER as NAME
Print [devices | free | list,all | NUMBER] display the partition table
Available devices, free space, all found partitions, or a particular
Partition
Quit exit program
Rescue START END rescue a lost partition near START
And END
Resize NUMBER START END resize partition NUMBER and its file
System
Rm NUMBER delete partition NUMBER
Select DEVICE choose the device to edit
Set NUMBER FLAG STATE change the FLAG on partition NUMBER
Toggle [NUMBER [FLAG]] toggle the state of FLAG on partition
NUMBER
Unit UNIT set the default unit to UNIT
Version display the version number and
Copyright information of GNU Parted
[root@mygirl ~] #
4, displaying all disk partition information
[root@mygirl ~] # parted-l
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 17.8GB 17.8GB primary ext4 boot
2 17.8GB 21.5GB 3648MB primary linux-swap (v1)
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdb: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 21.5GB 21.5GB primary ext4
Error: / dev/sdc: unrecognised disk label
5. It can be seen that parted locates the first disk / dev/sda by default.
[root@mygirl ~] # parted
GNU Parted 2.1
Using / dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 17.8GB 17.8GB primary ext4 boot
2 17.8GB 21.5GB 3648MB primary linux-swap (v1)
(parted) quit
[root@mygirl ~] #
6. According to the third command above, you can see the usage of the parted command and the structural classification of the above command.
View the parted command
[root@mygirl] # parted-- help
Usage: parted [OPTION]... [DEVICE [COMMAND [PARAMETERS]...]...]
Apply COMMANDs with PARAMETERS to DEVICE. If no COMMAND (s) are given, run in
Interactive mode.
7 parted / dev/sdc can locate the specified disk, and then help will display the corresponding specific command
[root@mygirl ~] # parted / dev/sdc
GNU Parted 2.1
Using / dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help
Align-check TYPE N check partition N for TYPE (min | opt) alignment
Check NUMBER do a simple check on the file system
Cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
Help [COMMAND] print general help, or help on COMMAND
Mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
Mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition NUMBER
Mkpart PART-TYPE [FS-TYPE] START END make a partition
Mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
Move NUMBER START END move partition NUMBER
Name NUMBER NAME name partition NUMBER as NAME
Print [devices | free | list,all | NUMBER] display the partition table, available devices, free space, all found partitions, or a particular partition
Quit exit program
Rescue START END rescue a lost partition near START and END
Resize NUMBER START END resize partition NUMBER and its file system
Rm NUMBER delete partition NUMBER
Select DEVICE choose the device to edit
Set NUMBER FLAG STATE change the FLAG on partition NUMBER
Toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
Unit UNIT set the default unit to UNIT
Version display the version number and copyright information of GNU Parted
(parted)
8. Check the usage of mkpart to create partitions
(parted) help mkpart
Mkpart PART-TYPE [FS-TYPE] START END make a partition
PART-TYPE is one of: primary, logical, extended
FS-TYPE is one of: ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp, linux-swap (v1), linux-swap (v0), ntfs, reiserfs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs
Amufs5, amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5, affs4, affs3, affs2, affs1, affs0, linux-swap, linux-swap (new), linux-swap (old)
START and END are disk locations, such as 4GB or 10%. Negative values count from the end of the disk. For example,-1s specifies exactly the last sector.
'mkpart' makes a partition without creating a new file system on the partition. FS-TYPE may be specified to set an appropriate partition ID.
(parted)
9, create a disk partition, but the error is as follows
(parted) mkpart primary
Error: / dev/sdc: unrecognised disk label
10. According to the above analysis, there may be other configurations. Check the mklabel command.
(parted) help mklabel
Mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
LABEL-TYPE is one of: aix, amiga, bsd, dvh, gpt, mac, msdos, pc98, sun, loop
11, use mklabel to create disk labels
(parted) mklabel msdos
12, it is impossible to know the starting and ending cylinder numbers in advance
(parted) mkpart primary
File system type? [ext2]? Ext4
Start? 1
End?
End?
End?
End? ^ C
(parted)
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
13, use comparative analysis to get the meaning of the beginning and end of the disk partition
(parted) mkpart primary ext4 1 100
14. Check all the partition information of the disk. It can be seen that the beginning and end are in M units.
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 99.6MB 98.6MB primary
15. Delete a disk partition using rm
(parted) rm 1
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
16. If you continue to create multiple disk partitions based on the above logic, you can see that the primary partition primary cannot create more than 4. If you create a fifth, you will get an error.
(parted) mkpart primary 1 300
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
(parted) mkpart primary 301 400
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
(parted) mkpart primary 401 450
(parted) mkpart primary 451 453
(parted) mkpart primary 454 455
Error: Can't create any more partitions.
(parted)
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 453MB 2097kB primary
17, do not create logical or extended partitions based on the fourth primary partition primary
(parted) help mkpart
Mkpart PART-TYPE [FS-TYPE] START END make a partition
PART-TYPE is one of: primary, logical, extended
FS-TYPE is one of: ext4, ext3, ext2, fat32, fat16, hfsx, hfs+, hfs, jfs, swsusp, linux-swap (v1), linux-swap (v0), ntfs, reiserfs, hp-ufs, sun-ufs, xfs, apfs2, apfs1, asfs
Amufs5, amufs4, amufs3, amufs2, amufs1, amufs0, amufs, affs7, affs6, affs5, affs4, affs3, affs2, affs1, affs0, linux-swap, linux-swap (new), linux-swap (old)
START and END are disk locations, such as 4GB or 10%. Negative values count from the end of the disk. For example,-1s specifies exactly the last sector.
'mkpart' makes a partition without creating a new file system on the partition. FS-TYPE may be specified to set an appropriate partition ID.
(parted)
(parted) mkpart logical 455 480
Error: Can't create any more partitions.
(parted) mkpart extended 455 480
Error: Can't create any more partitions.
18, you can create an extended partition extended immediately based on the third primary partition
(parted) rm 4
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
(parted) mkpart extended 451500
(parted)
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 500MB 49.3MB extended lba
19. A logical partition created based on an extended partition cannot create a size, otherwise an error will be reported as follows, which will affect performance. Of course, you can ignore this prompt.
(parted) mkpart logical 452 480
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 500MB 49.3MB extended lba
5 452MB 480MB 28.3MB logical
(parted) mkpart logical 481 483
(parted) mkpart logical 484 486
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 500MB 49.3MB extended lba
5 452MB 480MB 28.3MB logical
6 481MB 483MB 2097kB logical
7 484MB 486MB 2000kB logical
(parted)
(parted) mkpart logical 487490
(parted) mkpart logical 491 493
(parted) mkpart logical 494495
(parted) mkpart logical 496497
(parted) mkpart logical 498 499
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 500MB 49.3MB extended lba
5 452MB 480MB 28.3MB logical
6 481MB 483MB 2097kB logical
7 484MB 486MB 2000kB logical
8 487MB 490MB 3146kB logical
9 491MB 493MB 2097kB logical
10 494MB 495MB 1049kB logical
11 496MB 497MB 1049kB logical
12 498MB 499MB 1049kB logical
20, it can be seen that the extended partition is the parent partition, while the logical partition is the child partition, that is, the latter can only be based on or dependent on the former, and the spatial range of the latter logical partition can only be located in the spatial range of the extended partition to which it belongs.
(parted) mkpart logical 500 501
Warning: You requested a partition from 500MB to 501MB.
The closest location we can manage is 500MB to 500MB.
Is this still acceptable to you?
Yes/No? Ys
Parted: invalid token: ys
Yes/No? Yes
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Ignore
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 500MB 49.3MB extended lba
5 452MB 480MB 28.3MB logical
6 481MB 483MB 2097kB logical
7 484MB 486MB 2000kB logical
8 487MB 490MB 3146kB logical
9 491MB 493MB 2097kB logical
10 494MB 495MB 1049kB logical
11 496MB 497MB 1049kB logical
12 498MB 499MB 1049kB logical
13 500MB 500MB 512B logical
(parted)
21, it seems that multiple extended partitions extended cannot be created.
(parted) mkpart extended 501,600
Parted: invalid token: extended
Partition type? [logical]?
22, it can be seen that exiting parted will automatically save the results of the last parted operation.
(parted) quit
Information: You may need to update / etc/fstab.
[root@mygirl ~] # parted / dev/sdc
GNU Parted 2.1
Using / dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 500MB 49.3MB extended lba
5 452MB 480MB 28.3MB logical
6 481MB 483MB 2097kB logical
7 484MB 486MB 2000kB logical
8 487MB 490MB 3146kB logical
9 491MB 493MB 2097kB logical
10 494MB 495MB 1049kB logical
11 496MB 497MB 1049kB logical
12 498MB 499MB 1049kB logical
13 500MB 500MB 512B logical
(parted)
23, it can be seen that as long as the extended partition is deleted, all the subordinate logical partitions will be deleted.
(parted) rm 4
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
24, it can be seen that only one extended partition can be created, not multiple extended partitions
(parted) mkpart extended 451500
(parted) mkpart extended 501,600
Parted: invalid token: extended
Partition type? [logical]? Logical
File system type? [ext2]? Ext3
Start? 451
End? 600
Warning: You requested a partition from 451MB to 600MB.
The closest location we can manage is 451MB to 500MB.
Is this still acceptable to you?
Yes/No?
25, as we can see below, the primary partition is the first to the fourth, and the logical partition is after the fifth.
(parted) rm 4
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
(parted) mkpart extended 451 2147
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 2147MB 1697MB extended lba
(parted) help mkfs
Mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition NUMBER
NUMBER is the partition number used by Linux. On MS-DOS disk labels, the primary partitions number from 1 to 4, logical partitions from 5 onwards.
FS-TYPE is one of: ext2, fat32, fat16, swsusp, linux-swap (v1), linux-swap (v0), linux-swap, linux-swap (new), linux-swap (old)
(parted)
26MKFS does not seem to be able to specify the disk partition number to divide the file system, and there are very few file systems that can be specified, at most to ext2. My analysis may be that the version of parted is too old.
(parted) mkfs 1 ext2
WARNING: you are attempting to use parted to operate on (mkfs) a file system.
Parted's file system manipulation code is not as robust as what you'll find in
Dedicated, file-system-specific packages like e2fsprogs. We recommend
You use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
Will be removed in an upcoming release.
Warning: The existing file system will be destroyed and all data on the partition will be lost. Do you want to continue?
Parted: invalid token: 1
Yes/No? Yes
Partition number? 1
File system type? [ext2]? Ext2
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary ext2
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 2147MB 1697MB extended lba
(parted)
27 _
(parted) help check
Check NUMBER do a simple check on the file system
NUMBER is the partition number used by Linux. On MS-DOS disk labels, the primary partitions number from 1 to 4, logical partitions from 5 onwards.
(parted)
(parted) check 1
WARNING: you are attempting to use parted to operate on (check) a file system.
Parted's file system manipulation code is not as robust as what you'll find in
Dedicated, file-system-specific packages like e2fsprogs. We recommend
You use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
Will be removed in an upcoming release.
Information: The ext2 file system passed a basic check. For a more comprehensive check, use the e2fsck program.
(parted)
28, mount the directory based on the file system of disk partition 1
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary ext2
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 2147MB 1697MB extended lba
(parted)
[root@mygirl ~] # fdisk-l | grep "/ dev/sdc"
Disk / dev/sdc: 2147 MB, 2147483648 bytes
/ dev/sdc1 1 37 291840 83 Linux
/ dev/sdc2 37 49 96256 83 Linux
/ dev/sdc3 49 55 48128 83 Linux
/ dev/sdc4 55 262 1656832 f W95 Ext'd (LBA)
[root@mygirl ~] #
[root@mygirl] # mkdir-p / test_dir
[root@mygirl ~] # mount / dev/sdc1 / test_dir
[root@mygirl] # df-h
Filesystem Size Used Avail Use% Mounted on
/ dev/sda1 17G 16G 89m 100% /
Tmpfs 1004M 112K 1004m 1% / dev/shm
/ dev/sdc1 268m 13K 253m 1% / test_dir
29. Based on the partition type of msdos, renaming the specified disk partition using name will report the following error
[root@mygirl ~] # parted / dev/sdc
GNU Parted 2.1
Using / dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 300MB 299MB primary ext2
2 301MB 400MB 98.6MB primary
3 401MB 450MB 49.3MB primary
4 451MB 2147MB 1697MB extended lba
(parted)
(parted) help name
Name NUMBER NAME name partition NUMBER as NAME
NUMBER is the partition number used by Linux. On MS-DOS disk labels, the primary partitions number from 1 to 4, logical partitions from 5 onwards.
NAME is any word you want
(parted) name 2 part2
Error: msdos disk labels do not support partition names.
Error: msdos disk labels do not support partition names.
(parted)
30, after you have configured the partition table with mklabel, and then execute mklabel again, the previous partition table and disk partition information will all be lost, so be careful
Clear the previous MSDOS partition table, and then recreate the GPT partition table
(parted) help mklabel
Mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
LABEL-TYPE is one of: aix, amiga, bsd, dvh, gpt, mac, msdos, pc98, sun, loop
(parted)
(parted) mklabel gpt
Warning: The existing disk label on / dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted)
31. Based on the GPT disk partition table, you can use the NAME command, but it seems that I misunderstood it before. The name corresponds to the primary partition PRIMARY, not the corresponding information of NUMBER.
(parted) mkpart primary 1 100
(parted) mkpart primary 101 200
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 99.6MB 98.6MB ext2 primary
2 101MB 200MB 99.6MB primary
(parted) name 2 part2
(parted)
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 99.6MB 98.6MB ext2 primary
2 101MB 200MB 99.6MB part2
32 MKFS still can't use ext3, only ext2
(parted) help mkfs
Mkfs NUMBER FS-TYPE make a FS-TYPE file system on partition NUMBER
NUMBER is the partition number used by Linux. On MS-DOS disk labels, the primary partitions number from 1 to 4, logical partitions from 5 onwards.
FS-TYPE is one of: ext2, fat32, fat16, swsusp, linux-swap (v1), linux-swap (v0), linux-swap, linux-swap (new), linux-swap (old)
(parted)
(parted) mkfs 2 ext2
WARNING: you are attempting to use parted to operate on (mkfs) a file system.
Parted's file system manipulation code is not as robust as what you'll find in
Dedicated, file-system-specific packages like e2fsprogs. We recommend
You use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
Will be removed in an upcoming release.
Warning: The existing file system will be destroyed and all data on the partition will be lost. Do you want to continue?
Parted: invalid token: 2
Yes/No? Y
Partition number? 2
File system type? [ext2]? Ext3
No Implementation: Support for creating ext3 file systems is not implemented yet.
(parted) p
Model: ATA VBOX HARDDISK (scsi)
Disk / dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 99.6MB 98.6MB ext2 primary
2 101MB 200MB 99.6MB part2
The above is how to understand the redhat 6.5 parted disk partitioning tool. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.