Fdisk for linux system disk partitioning

Source: Internet
Author: User
In linux, the fdisk command is usually used to learn disk partitions. of course, for disks smaller than 2 TB, we basically use the fdisk command for partitioning. below we will briefly introduce the basic commands and scenario simulation common commands for fdisk operations on disks. fdisk-fdisk for linux system disk partitioning
The fdisk command is usually used to learn disk partitions. of course, for disks smaller than 2 TB, we basically use the fdisk command for partitioning. below we will briefly introduce the basic commands and scenario simulation commands for fdisk operations. Introduction to fdisk-l viewing all disk information, fdisk/dev/sdb using fdisk command tool operation/dev/sdb disk m display all command information, usage p display partition information q exit w save partition information, only after executing the w command will partition information be written to disk d 1 delete disk the first partition scenario simulation has a 1g disk/dev/sdb partition as a primary partition, the size of an extended partition is MB. a MB logical partition/dev/sdb5 is created on the extended partition. the format file system is mkfs. ext4 is automatically mounted to the directory/backup31 at startup. use the fdisk Command tool to operate the disk/dev/sdb fdisk/dev/sdb2 to create a primary partition Command (m Help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 Using default value 1 Last cylinder, + cylinders or + size {K, M, G} (1-130, default 130): + 400 M Command (m for help): p Disk/dev/sdb: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 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: 0x0004a98a Device Boot Start End Blocks Id System/dev/sdb1 1 52 417658 + 83 Linux3 create an extended partition Command (m for help ): n Command action e extended p primary partition (1-4) e Partition number (1-4): 2 First cylinder (53-130, default 53 ): using default value 53 Last cylinder, + cylinders or + size {K, M, G} (53-130, default 130): + 400 M Command (m Help): p Disk/dev/sdb: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 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: 0x0004a98a Device Boot Start End Blocks Id System/dev/sdb1 1 52 417658 + 83 Linux/dev/sdb2 53 104 417690 5 Extended4 create a logical partition Command (M for help): n Command action l logical (5 or over) p primary partition (1-4) l First cylinder (53-104, default 53 ): using default value 53 Last cylinder, + cylinders or + size {K, M, G} (53-104, default 104): + 100 M Command (m for help ): p Disk/dev/sdb: 1073 MB, 1073741824 bytes 255 heads, 63 sectors/track, 130 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: 0x0004a98a Device Boot Start End Blocks Id System/dev/sdb1 1 52 417658 + 83 Linux/dev/sdb2 53 104 417690 112423 5 Extended/dev/sdb5 53 66 + 83 Linux 5 save Command (m for help): w The partition table has been altered! Calling ioctl () to re-read partition table. Syncing disks.6 partition the disk [root @ hsj2 ~] # Mkfs. ext4/dev/sdb1mke2fs 1.41.12 (17-May-2010) Filesystem label = OS type: LinuxBlock size = 1024 (log = 0) Fragment size = 1024 (log = 0) stride = 0 blocks, Stripe width = 0 blocks104448 inodes, 417656 blocks20882 blocks (5.00%) reserved for the super userFirst data block = 1 Maximum filesystem blocks = 6763315251 block groups8192 blocks per group, 8192 fragments per group2048 inodes per groupSuperblock backups stor Ed on blocks: 8193,245 77, 40961,573 45, 73729,204 801, 221185,401 409 Writing inode tables: doneCreating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 31 mounts or180 days, whichever comes first. use tune2fs-c or-I to override. [root @ hsj2 ~] # Mkfs. ext4/dev/sdb5mke2fs 1.41.12 (17-May-2010) Filesystem label = OS type: LinuxBlock size = 1024 (log = 0) Fragment size = 1024 (log = 0) stride = 0 blocks, Stripe width = 0 blocks28112 inodes, 112420 blocks5621 blocks (5.00%) reserved for the super userFirst data block = 1 Maximum filesystem blocks = 6737100814 block groups8192 blocks per group, 8192 fragments per group2008 inodes per groupSuperblock backups stored on blocks: 8193,245 77, 40961,573 45, 73729 Writing inode tables: doneCreating journal (4096 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 31 mounts or180 days, whichever comes first. use tune2fs-c or-I to override. OK.
 
Related Article

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.