The FDISK command is detailed

Source: Internet
Author: User

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

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

NAME

Fdisk-partition table manipulator for Linux


Synopsis

fdisk [-UC] [-B sectorsize] [-C cyls] [-H heads] [-s sects]

Device


Fdisk-l [-u] [device ...] lists the partition table status for the specified peripheral device.

[Email protected] ~]# fdisk-l


disk/dev/sda:10.7 GB, 10737418240 bytes

255 heads, Sectors/track, 1305 cylinders

Units = Cylinders of 16065 * 8225280 bytes

Sector size (logical/physical): bytes/512 bytes

I/O size (minimum/optimal): bytes/512 bytes

Disk identifier:0x000a87b0


Device Boot Start End Blocks Id System

/DEV/SDA1 * 1 512000 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 141 614400 Swap/solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3 141 1306 9358336-up Linux

[Email protected] ~]#

Fdisk-s partition ... < partition number > outputs the specified partition size to the standard output, in chunks.


FDISK-V Displays version information.


Fdisk-h



I. Zoning essentials

(1) Any number of primary partitions, but required (1<= primary partition <= is less than or equal to 4. For example, 4 primary partitions, 3 primary partitions, 2 primary partitions, or one primary partition)

(2) Extended partition and primary partition, 3 primary partition + one extended partition 1<= primary partition <= less than equals 4 for example: 3 primary partition + one extended partition or two primary partition + one extended partition 1 primary + one extended partition


(3) If the disk is divided into 4 disk partitions, it will generally be used: P+p+p+p p+p+p+e


Second, [[email protected] opt]# fdisk--HELP view partition Help

[[email protected] opt]# fdisk-l view partition list

1.[[email protected] opt]# FDISK/DEV/SDA


Warning:dos-compatible mode is deprecated. It ' s strongly recommended to

Switch off the mode (command ' C ') and change display units to

Sectors (Command ' u ').


Command (M for help): M

Command Action

A toggle a bootable flag

b Edit BSD Disklabel

C Toggle the DOS compatibility flag

D Delete a partition

L list known partition types view partition

M Print this menu help information

n Add a new partition newly created partition

o Create a new empty DOS partition table

P Print the partition table

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

X Extra functionality (experts only)


Command (M for help):

2. N New Partition

E Extended

P primary partition (1-4)

After 3.W partition is complete W save

4.[[email protected] opt]# Partprobe

5.[[email protected] opt]# MKFS.EXT4/DEV/SDA

4. Write Fs/etc/fstab


This article from "Bobcat" blog, declined reprint!

The FDISK command is detailed

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.