LINUX Disk Structure---fdisk partitioning command

Source: Internet
Author: User

I. INTRODUCTION of FDISK

Fdisk-partition table manipulator for Linux, translated into Chinese means the Disk partition table Operation tool, actually is the partition tool.

Fdsik can partition the disk into several zones, but also can specify partitions for each partition of the file system, such as Linux, FAT32, Linux, Linux swap, FAT16 and in fact, Unix-like operating system of the file system, etc., of course, when we use Fdisk partition disk operations , is not an end point, we also need to format the partition of the required file system, such a partition to use; This is similar to Fdisk in DOS.

second, the rational planning of hard Disk Partitioning

Before we can manipulate partitions, we need to understand the theory of hard disk partitioning, such as the calculation of hard disk capacity and partition size, and how to plan partitions for a hard disk.

Third, fdisk-l view hard disk and partition information

We know that the total number of primary partitions (including extended partitions) cannot be more than four, nor can the extended partitions be enclosed between the primary partitions; According to this principle, partitioning the hard disk is much easier, and it can reduce unnecessary trouble for the future.

Disk structure diagram:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/38/F5/wKiom1O0_viQyIh-AAIdUsRHsz0339.jpg "title=" Qq20140703144310.png "alt=" Wkiom1o0_viqyih-aaidusrhsz0339.jpg "/>

Disk Concept Map:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/38/F5/wKioL1O0_yPhvkMkAACvy0UIsAc816.jpg "title=" capture. JPG "alt=" Wkiol1o0_yphvkmkaacvy0uisac816.jpg "/>

Disk Structure and concepts:


. per sector, 512 bytes

Each track is divided into 63 sectors.

The number of logical heads (disk faces) is set to 255


——— "size of a cylindrical surface


= 255x63x512 byte = 8MB


——— "Capacity of the hard disk or partition


= Cylinder size x number of cylinders

1, through the fdisk-l to see the number of hard disk drives and partition status:


[Email protected] ~]# fdisk-l


disk/dev/sdb:85.8 GB, 85899345920 bytes

255 heads, Sectors/track, 10443 cylinders

Units = Cylinders of 16065 * 8225280 bytes


Disk/dev/sdb doesn ' t contain a valid partition table


2, about fdisk-l some numerical description:


Disk/dev/sdb: 85.8 GB, 85899345920 bytes

255 heads, Sectors/track, 10443 cylinders

Units = Cylinders of 16065 * 8225280 bytes


This hard drive is 80G, has 255 magnetic surface, 63 sectors, 10,443 magnetic columns, each cylinder (magnetic column) capacity is 8225280 bytes=8225.280 K (about) =8.225280m (about);


3. Description of Fdisk:


[Email protected] ~]# fdisk/dev/sdb

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF Disklabel

Building a new DOS disklabel. Changes'll remain in memory only,

Until decide to write them. After that, of course, the previous

Content won ' t be recoverable.



The number of cylinders for this disk was set to 10443.

There is nothing wrong with the, but this is larger than 1024,

And could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from the other OSs

(e.g., DOS fdisk, OS/2 fdisk)

Warning:invalid flag 0x0000 of partition Table 4 would be a corrected by W (rite)


Command (M for help): m

Command Action # Commands operation

A toggle a bootable flag # toggle a bootable flag

b Edit BSD Disklabel # b editing BSD disk

C Toggle the DOS Compatibility flag # C Toggle DOS Compatibility flag

D Delete a partition # D deletes a partition

L list known partition types # l list known partition types

M Print this menu # m

n Add a new partition # N adds a fresh partition

o Create a new empty DOS partition Table # o creates a fresh null DOS partition table

P Print the partition table # p printing partition table

Q quit without saving changes # Q quit without saving changes

s create a new empty Sun Disklabel

t change a partition ' s system ID # t Changing the partition's systems ID

U Change display/entry units # u changing Display/entry units

V Verify the Partition Table # v Verify partitioned Tables

W Write table to disk and exit # W writes to diskette and exits

X Extra functionality (experts only) # X extra features (experts only)


Command (M for help): l


0 Empty 1e Hidden W95 FAT1-old Minix BF Solaris

1 FAT12 NEC DOS bayi minix/old Lin C1 drdos/sec (fat-

2 Xenix root Plan 9 swap/so c4 drdos/sec (fat-

3 Xenix usr 3c partitionmagic Linux c6 drdos/sec (fat-

4 FAT16 <32m Venix 80286, os/2 hidden c:c7 syrinx

5 Extended PPC PReP Boot, Linux Extended da non-fs data

6 FAT16 SFS, NTFS volume set db cp/m/CTOS/.

7 Hpfs/ntfs 4d qnx4.x NTFS Volume set de Dell Utility

8 AIX 4e qnx4.x 2nd part Linux plaintext DF bootit

9 AIX Bootable 4f qnx4.x 3rd part 8e Linux LVM E1 DOS Access

A os/2 Boot manag ontrack DM amoeba E3 DOS r/o

b W95 FAT32 Wuyi ontrack DM6 Aux 94 Amoeba BBT e4 SpeedStor

C W95 FAT32 (LBA) cp/m 9f bsd/os EB BeOS FS

E W95 FAT16 (LBA) Ontrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT

F W95 Ext ' d (LBA) OnTrackDM6 a5 FreeBSD ef EFI (fat-12/16/

Ten OPUS ez-drive a6 OpenBSD f0 linux/pa-risc b

Hidden FAT12 Bow A7 NeXTSTEP F1 SpeedStor

Compaq Diagnost 5c Priam edisk A8 Darwin UFS f4 SpeedStor

Hidden FAT16 <3 speedstor A9 NetBSD F2 DOS Secondary

Hidden FAT16, GNU HURD or Sys ab Darwin boot fb VMware VMFS

Hidden hpfs/ntf Novell Netware b7 BSDI FS FC VMware Vmkcore

AST smartsleep Novell Netware b8 BSDI swap fd Linux RAID Auto

1b Hidden W95 FAT3 disksecure Mult bb Boot Wizard hid Fe lanstep

1c Hidden W95 FAT3 pc/ix be Solaris boot ff BBT



This article is from the "Dragon" blog, make sure to keep this source http://1208073155.blog.51cto.com/9039381/1434018

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.