fdisk

From XennisWiki
Jump to: navigation, search

For computer file systems, fdisk is a command-line utility that provides disk partitioning functions. (Wikipedia)

Basic usage

Further information for fdisk: Install Arch (Section Partitioning your Disk)

List partition tables

fdisk -l

Open help menu

When fdisk is started press [m] to open the help menu.

Partition the disk

Start fdisk, e.g. for disk with label sda

fdisk /dev/<label>

Use [q] to quit without saving or [w] to write changes to disk and exit.

Create a (primary) partition

Create a partition (primary of type 83 which is ext3, ext4, etc.)

  1. [n] : Creates a new partition
  2. (optional and for MBR only) [p] : Choose primary partition
  3. [Enter] : Accept default starting sector
  4. type +10G: Specify size of 10 GB

Mark a partition as boot (MBR only)

When using MBR as partition table, press [a] to mark a partition as boot partition.

Create a swap partition

Create a swap partition

  1. Same steps like #Create a partition
  2. [t] : Select partition type
  3. [2] : Specify to set the type of partition 2
  4. 82: Select swap as type

Hint: After fdisk is exited, run the following to create the swap

mkswap /dev/<label>
swapon /dev/<label>

Print the partion table

Press [p]

See also

External links