GNU fdisk, lfdisk, gfdisk
manipulate partition tables on a hard drive
- Provided by: gnu-fdisk (Version: 1.2.5-2)
- Report a bug
manipulate partition tables on a hard drive
fdisk [options] [device]
fdisk is a disk partition manipulation program, which allows you to create, destroy, resize, move and copy partitions on a hard drive using a menu-driven interface. It is useful for organising the disk space on a new drive, reorganising an old drive, creating space for new operating systems, and copying data to new hard disks. For a list of the supported partition types, see the --list-partition-types option below.
It comes in two variants, gfdisk and lfdisk. Lfdisk aims to resemble Linux fdisk 2.12, while gfdisk supports more advanced disk operations, like resizing the filesystem, moving and copying partitions. When starting fdisk, the default is to run gfdisk.
The following options are available only to lfdisk.
Before editing a BSD disklabel, the partition with the disklabel should already exist on the disk and be detected by the OS. If you have created a BSD-type partition, you need to write the changes to the disk. If fdisk fails to notify the OS about the changes in partition table, you need to restart your computer. As fdisk tries to guess the device holding the BSD disklabel, it might fail to edit it at all, even if the OS has detected it. In this case you are adviced to simply open the device with fdisk directly. It is possible that it doesn't work on some operating systems.
Getting the size of a partition with -s might fail, if fdisk fails to guess the disk device, for the same reasons as with the previous bug.
mkfs(8), cfdisk(8), parted(8) The fdisk program is fully documented in the info(1) format GNU fdisk User Manual manual.