Introduction to fdisk

Source: Internet
Author: User
Tags ide hard drive

######################################## ###################

# An IDE hard drive can only create four partitions. If you want to create more than four partitions, you need to take out one primary partition #
# Expand the partition, and then perform other partitioning operations in the extended partition. #
######################################## ###################

[[Email protected] ~] # Fdisk/dev/SDB# Partition Disk/dev/SDB
Device contains neither a valid DOS partition table, Nor Sun, SGI or OSF disklabel
Building a new dos disklabel with disk identifier 0x68a3c8c6.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: Invalid flag 0x0000 of Partition Table 4 will be corrected by W (RITE)

Warning: DOS-compatible mode is deprecated. It's stronugly recommended
Switch off the mode (command 'C') and change display units
Sectors (command 'U ').

Command (M for help): p# Print partition tables

Disk/dev/SDB: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x68a3c8c6

Device boot start end blocks ID system

Command (M for help): H# Help
H: Unknown command
Command action
A toggle a bootable flag
B edit BSD disklabel
C toggle the DOS compatibility flag
D delete a partition# Deleting a partition
L List known partition types
M print this menu
N Add a new partition
O create a new empty DOS partition table
P print the Partition Table# Print partition tables
Q quit without saving changes
S create a new empty sun disklabel
T change a partition's System ID
U change display/entry units
V verify the Partition Table
W write table to disk and exit# Saving partitions
X extra functionality (experts only)

Command (M for help): n# Add a partition
Command action
E extended # extended partition
P primary partition (1-4)# Primary Partition
P
Partition Number (1-4): 1# First Primary partition, Id 1
First cylinder (1-1305, default 1 ):
Using default value 1
Last cylinder, + cylinders or + size {K, M, g} (1-1305, default 1305): + 2G

Command (M for help): n
Command action
E extended
P primary partition (1-4)
P
Partition Number (1-4): 2# Second Primary partition, number 2
First cylinder (263-1305, default 263 ):
Using default value 263
Last cylinder, + cylinders or + size {K, M, g} (263-1305, default 1305): + 2G

Command (M for help): n
Command action
E extended
P primary partition (1-4)
P
Partition Number (1-4): 3# Third Primary partition, Number 3
First cylinder (525-1305, default 525 ):
Using default value 525
Last cylinder, + cylinders or + size {K, M, g} (525-1305, default 1305 ):+ 2G

Command (M for help): n# Extended partition, number 4
Command action
E extended
P primary partition (1-4)
E# Select extended partition here
Selected partition 4
First cylinder (787-1305, default 787 ):
Using default value 787
Last cylinder, + cylinders or + size {K, M, g} (787-1305, default 1305 ):
Using default value 1305

Command (M for help): p# Print partition tables

Disk/dev/SDB: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x68a3c8c6

Device boot start end blocks ID system
/Dev/sdb1 1 262 2104483 + 83 Linux
/Dev/sdb2 263 524 2104515 83 Linux
/Dev/sdb3 525 786 2104515 83 Linux
/Dev/sdb4 787 1305 4168867 + 5 extended

Command (M for help): n# Create the first logical partition for the extended partition
First cylinder (787-1305, default 787 ):
Using default value 787
Last cylinder, + cylinders or + size {K, M, g} (787-1305, default 1305): + 2G

Command (M for help): n# Create a second logical partition for the extended partition
First cylinder (1049-1305, default 1049 ):
Using default value 1049
Last cylinder, + cylinders or + size {K, M, g} (1049-1305, default 1305 ):
Using default value 1305

Command (M for help): p# Print the partition table with five available partitions (Extended partitions are used to create logical partitions)

Disk/dev/SDB: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 Cylinders
Units = cylinders of 16065*512 = 8225280 bytes
Sector size (logical/physical): 512 bytes/512 bytes
I/O size (minimum/optimal): 512 bytes/512 bytes
Disk identifier: 0x68a3c8c6

Device boot start end blocks ID system
/Dev/sdb1 1 262 2104483 + 83 Linux
/Dev/sdb2 263 524 2104515 83 Linux
/Dev/sdb3 525 786 2104515 83 Linux
/Dev/sdb4 787 1305 4168867 + 5 extended
/Dev/sdb5 787 1048 2104483 + 83 Linux
/Dev/sdb6 1049 1305 2064321 83 Linux

Command (M for help): W# Saving partition tables
The partition table has been altered!

Calling IOCTL () to re-read partition table.
Syncing disks.
# Format the partition below and manually mount it to write the configuration file to/etc/fstab.
[[Email protected] ~] # Mkfs. ext4/dev/sdb1

To manually mount a partition, visit:

Http://zqxiang.blog.51cto.com/2806551/1572652

This article is from the "Network Technology" blog, please be sure to keep this source http://zqxiang.blog.51cto.com/2806551/1572653

Introduction to fdisk

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.