Partition

From Gentoo Wiki
(Redirected from Partitioning tools)
Jump to:navigation Jump to:search
Other languages:
Resources

A partition is a means of splitting a block device up to sub-regions. It allows creating a more manageable and adaptive "logical" structure visible to the system. The PARTUUID (partition UUID) can be seen using blkid.

See also
See the Handbook for more information on partitioning for Gentoo.
Note
The software presented in the following sections sometimes supports more partition table types than listed. For example, fdisk also supports Sun, SGI and BSD partition tables.

Master Boot Record (MBR)

Used for a long time to organize data, also called DOS-Partitions. Partition information is stored in the first 512 bytes of the device.

  • Widespread and supported in nearly all operating systems.
  • Very well documented.
  • Maximum of 4 primary partitions per device.
  • Maximum size of the device 2 TiB.
  • Using one primary partition as an extended partition, it is possible to create additional logical partitions to work around the problem of only 4 primary partitions.

Kernel configuration

KERNEL Enable MBR support (CONFIG_MSDOS_PARTITION)
-*- Enable the block layer
    Partition Types  --->
      [*]   PC BIOS (MSDOS partition tables) support

Available software

The following programs can be used to create, alter, and remove MBR partitions:

Program Package GUI Function
cfdisk sys-apps/util-linux No Create, alter, and remove partitions. More intuitive interface than fdisk.
fdisk sys-apps/util-linux No Create, alter, and remove partitions.
gparted sys-block/gparted GTK3 GNOME Partition Editor; create, alter, and remove partitions.
parted sys-block/parted No Create, alter, remove, check, copy partitions and file systems.
partitionmanager sys-block/partitionmanager Qt5 KDE Partition Manager; create, alter, and remove partitions.
sfdisk sys-apps/util-linux No Non-interactive version of fdisk.

Supported operating systems

  • BSD (Mac OS X) - full support.
  • DOS - full support.
  • Linux - full support.
  • Solaris - full support.
  • Windows - full support.

GUID Partition Table (GPT)

In GUID (Global Unique IDentifier) partition system, a small amount of disk space at the beginning of the device is used to store the partition information. Its main advantage is the supported size of storage devices and the creation of a backup of the partition table at the end of the device.

  • Widespread and supported in most modern operating systems.
  • Maximum of 128 primary partitions per device.
  • Maximum size of the device 8 ZiB.
See also
GPT

Kernel configuration

KERNEL Enable GPT support (CONFIG_EFI_PARTITION)
-*- Enable the block layer
    Partition Types  --->
      [*]   EFI GUID Partition support

Available software

The following programs can be used to create, alter, and remove GPT partitions:

Program Package GUI Function
cfdisk sys-apps/util-linux No Create, alter, and remove partitions. More intuitive interface than fdisk.
fdisk sys-apps/util-linux No Create, alter, and remove partitions.
GNOME Disks sys-apps/gnome-disk-utility GTK3 GNOME partition manager.
gparted sys-block/gparted GTK3 GNOME Partition Editor; create, alter, and remove partitions.
gptfdisk sys-apps/gptfdisk No Create, alter, remove, convert MBR to GPT, and recreate partition tables from backup.
parted sys-block/parted No Create, alter, remove, check, copy partitions and file systems.
partitionmanager sys-block/partitionmanager Qt5 KDE Partition Manager; create, alter, and remove partitions.
sfdisk sys-apps/util-linux No Non-interactive version of fdisk.

Supported operating systems

  • BSD (Mac OS X) - full support.
  • Linux - full support.
  • Windows - Installs into the /boot/EFI/Microsoft/ subdirectory of the ESP.

Logical Volume Manager (LVM)

LVM is a complete suite to dynamically manage partitions, storage devices or other underlying systems as volumes.

  • Widespread and supported in most modern operating systems.
  • Maximum size of the device depends on the underlying systems limitations.
  • Maximum size of Logical Volumes is 8 EiB on 64-bit Linux and 16 TiB on 32-bit Linux.
  • Storage devices, RAID system, network storage (e.g. iSCSI) can be used as Physical Volumes (no need of partitioning).
  • Provides basic forms of data redundancy (RAID 1, RAID 5) or stripset (RAID 0) for performance.
Note
To use features like dynamic resizing, the used filesystem should be resizable as well.

Kernel configuration

KERNEL Enabling LVM
Device Drivers  --->
   Multiple devices driver support (RAID and LVM)  --->
       <*> Device mapper support
           <*> Crypt target support
           <*> Snapshot target
           <*> Thin provisioning target
           <*> Mirror target
           <*> Multipath target
               <*> I/O Path Selector based on the number of in-flight I/Os
               <*> I/O Path Selector based on the service time

Available software

The following programs come with sys-fs/lvm2

Program GUI Function
lvcreate No Create, alter, and remove volumes.
pvcreate No Create or remove Physical Volumes of storage devices/systems.
vgcreate No Groups PV as Volume Group.

The following programs can be used to create, alter, and remove LVM partitions:

Program Package GUI Function
partitionmanager sys-block/partitionmanager Qt5 KDE Partition Manager; create, alter, and remove LVM PVs, VGs, LVs.

Supported operating systems

  • BSD - cannot boot itself, needs Linux GRUB with dual boot.
  • Linux - full support.
Note
This is the Linux specific LVM implementation, other OS have their own systems, see Logical volume management.

ZFS

ZFS is a complete suite to dynamically manage storage and filesystem.

  • Support in Linux (via ZFSOnLinux[1]), Solaris, FreeBSD.
  • Needs GRUB bootloader.
  • Maximum size of a single zpool is 256 ZiB
  • Storage devices can be used complete as vdev (no need of partitioning)
  • Zpools are created once and cannot be resized afterwards. Every volume has access to the full capacity of the zpool, this can be reduced via quota.
  • It provides forms of redundancy like RAID 1 (mirroring), and RAID 0 (striping) for performance. Also supports RAID 5, RAID 6, etc.
  • Has its own filesystem with features like compression, copy-on-write, and deduplication.

Available software

The following programs come with sys-fs/zfs:

Program GUI Function
zfs No Create, alter (resize), and remove volumes.
zpool No Manage and organize vdevs in zpools.

Supported operating systems

  • BSD - full support.
  • Linux - built as external module because of the CDDL and GPL license conflict - mostly supported.
  • Solaris - full support.

Other software

Busybox also contains a version of fdisk.

There are some special versions of fdisk for specific system types in the Gentoo ebuild repository, such as: sys-fs/arm-fdisk, sys-fs/mac-fdisk, or sys-fs/atari-fdisk.

See sys-fs category for even more tools.

See also

References