NAMEdisked — disk editor
DESCRIPTIONdisked is an interactive program that manages partition tables. It can create and destroy partition tables on block devices. It can create partitions and destroy them. It can format filesystems on partitions and configure mountpoints in fstab(5). disked supports the Master Boot Record and GUID Partition Table partitioning schemes.
(disked)if none is selected. Commands perform their actions when run rather than waiting for the user to write out changes. disked only creates partitions aligned to 1 MiB boundaries whose size is a multiple of 1 MiB. Unused regions are aligned and those smaller than the alignment are not shown.
- Use path instead of /etc/fstab as fstab(5).
- device device-index
- Switch to the device device-index as numbered by the devices command. If no index is specified, show the name of the current device. Alternatively you can write the absolute path to the device such as /dev/ahci0 or just its name ahci0.
- List every available block device and show their indexes, device names (as found in /dev), model names and serial numbers. Devices are counted from 0.
- Exit disked.
- fsck partition-index
- Perform a fsck(8) filesystem check of the partition partition-index on the current device.
- List available commands.
- Display the partition table of the current device. Partitions are counted from 1.
- man [...]
- Display this manual page if no operands are given, otherwise run man(1) with the given command line.
Create a partition on the current device. If the partition table has multiple unused regions (holes), disked asks you which one to use. You need to specify the offset into the hole where the partition is created and then the length of the partition. See QUANTITIES below on the possible partition offset and length values. You will be asked if you want to format a filesystem:
- (gpt only) Format a BIOS boot partition, which is required for booting with GRUB from a root filesystem on a GPT partition. 1 MiB is sufficient for this kind of partition.
- (mbr only) Create an extended partition, which can contain an arbitrary amount logical partitions. You can only have a single extended partition.
- Format an ext2 filesystem.
- Use the existing disk data.
- mktable [mbr | gpt]
- Create a partition table on the current device of the specified type.
mount partition-index [mountpoint
- Mount the partition partition-index of the current device on mountpoint in fstab(5), or if no then remove any existing mountpoints. Conflicting mountpoints are removed.
- Exit disked.
- rmpart partition-index
- Delete the partition partition-index on the current device. The partition data is rendered inaccessible but is not actually erased. The partition can technically be recovered using mkpart. The partition data no longer has the protections of being in a partition and looks like regular unused space and can easily be overwritten. You should not delete a partition unless you want its contents gone. Deleting an extended partition deletes all the partitions it contains.
- Delete the partition table on the current device. The existing partitions are rendered inaccessible but are not actually erased. The partitions can technically be recovered using mktable and mkpart. The disk data no longer has the protections of being partitioned and looks like regular unused space and can easily be overwritten. You should not delete the partition table unless you want all the data on the disk gone.
- Run an interactive shell.
QUANTITIESdisked allows useful expressions when describing disk offsets and lengths. Every question needs an answer between 0 and a maximum. You can answer in percent where 100% is the maximum. You can answer an integer value followed by a suffix such as B, K, M, G, T, or P to signify bytes, KiB, MiB, GiB, TiB, and PiB respectively. The value is in MiB by default if there is no suffix. The answer is rounded to the 1 MiB alignment. If the expression is a negative value, then the answer is the maximum minus the absolute value. For instance:
- Use 42% of the maximum.
- Use 13 MiB.
- Use 37 MiB.
- 9001 GiB
- Use 9001 GiB.
- Leave 100 MiB at the end.
- Use 90% of the maximum.
(ahci0) devices # list devices (ahci0) device 1 # select device 1 (ahci1) mktable gpt # create partition table (ahci1) mkpart # create partition 0% # no free space preceding it 50% # use half the disk ext2 # format an ext2 filesystem /home/user # use as /home/user filesystem (ahci1) ls # inspect partition table (ahci1) mount 1 /home # change partition 1 mountpoint to /home (ahci1) exit # done