fdisk
fdisk功能说明:磁盘分区。
语 法:fdisk [-b <分区大小>][-uv][外围设备代号] 或 fdisk [-l][-b <分区大小>][-uv][外围设备代号...] 或 fdisk [-s <分区编号>]
补充说明:fdisk是用来磁盘分区的程序,它采用传统的问答式界面,而非类似DOS fdisk的cfdisk互动式操作界面,因此在使用上较为不便,但功能却丝毫不打折扣。
参 数:
-b<分区大小> 指定每个分区的大小。
-l 列出指定的外围设备的分区表状况。
-s<分区编号> 将指定的分区大小输出到标准输出上,单位为区块。
-u 搭配"-l"参数列表,会用分区数目取代柱面数目,来表示每个分区的起始地址。
-v 显示版本信息。
fdisk
fdisk [options] [device]
System administration command. fdisk displays information about disk partitions, creates and deletes disk partitions, and changes the active partition. It is possible to assign a different operating system to each of the four possible primary partitions, though only one partition is active at any given time. You can also divide a physical partition into several logical partitions. The minimum recommended size for a Linux system partition is 40 MB. Normally, each device will be /dev/hda, /dev/hdb, /dev/sda, /dev/sdb, /dev/hdc, /dev/hdd, and so on. An interactive, menu-driven mode is also available. Note that this command can be destructive if used improperly.
Options
Set the size of individual disk sectors. May be 512, 1024, or 2048. Most systems now recognize sector sizes, so this is not necessary.
List partition tables and exit.
Report partition sizes in sectors instead of cylinders.
Display the size of partition, unless it is a DOS partition.
Print version number, then exit.
Specify the number of cylinders on the disk.
Specify the number of heads per cylinder.
Specify sectors per track for partitioning.
Commands
Toggle a bootable flag on current partition.
Edit disklabel of a BSD partition.
Toggle DOS compatibility flag.
Delete current partition.
List all partition types.
Main menu.
Create a new partition; prompt for more information.
Create an empty DOS partition table.
Print a list of all partitions and information about each.
Quit; do not save.
Replace the type of the current partition.
Modify the display/entry units, which must be cylinders or sectors.
Verify: check for errors, and display a summary of the number of unallocated sectors.
Save changes and exit.
Switch to expert commands.
Example
To list all partitions currently on the system:
fdisk -l