D
DevynCJohnson
Guest
When using Parted, Gparted, fdisk, and other similar software, many people have noticed the "flags". What are these and what do they mean?
Flags indicate that a certain property, characteristic, or feature is active or is present. Flags can either be on or off. If the flag is not seen, then it is off or inactive/non-existent. Certain flags are only supported on particular filesystems and partitioning tables. The GUID Partitioning Table (GPT) and MS-DOS partitioning table support the most flags. The flags (on GPT) are actually 128-bit GUIDs on the GUID partitioning table. Each flag has its own GUID.
Parted can be used to format a storage device with a particular partitioning table (also called a "disk-label"). Doing so will erase all partitions and data on the selected storage device. The command is "parted mklabel DISKLABEL". The command requires Root privileges. The user will need to create new partitions for the storage device. Supported partitioning tables (supported by parted) include the listed below.
NOTE: Other partitioning tables exist, but parted does not support all of them.
To configure a flag on a partition, the parted command is "parted set PARTITION# FLAG ON/OFF". Use this command with Root privileges. For example, to set partition 3 as the boot partition, the command would be "parted set 3 boot on". The flag name is case-sensitive.
Below are descriptions and explanations for many flags as well as a list of the partitioning tables that support it (in brackets). This may not be a complete list of flags.
Further Reading
Flags indicate that a certain property, characteristic, or feature is active or is present. Flags can either be on or off. If the flag is not seen, then it is off or inactive/non-existent. Certain flags are only supported on particular filesystems and partitioning tables. The GUID Partitioning Table (GPT) and MS-DOS partitioning table support the most flags. The flags (on GPT) are actually 128-bit GUIDs on the GUID partitioning table. Each flag has its own GUID.
Parted can be used to format a storage device with a particular partitioning table (also called a "disk-label"). Doing so will erase all partitions and data on the selected storage device. The command is "parted mklabel DISKLABEL". The command requires Root privileges. The user will need to create new partitions for the storage device. Supported partitioning tables (supported by parted) include the listed below.
- bsd
- loop (raw disk access)
- gpt
- mac (Apple Partition Map (APM))
- msdos (commonly called MBR)
- pc98
- sun
NOTE: Other partitioning tables exist, but parted does not support all of them.
To configure a flag on a partition, the parted command is "parted set PARTITION# FLAG ON/OFF". Use this command with Root privileges. For example, to set partition 3 as the boot partition, the command would be "parted set 3 boot on". The flag name is case-sensitive.
Below are descriptions and explanations for many flags as well as a list of the partitioning tables that support it (in brackets). This may not be a complete list of flags.
- atvrecv - [GPT] This is a flag for Apple TV Recovery Partitions.
- bios_grub - [GPT] The partition with this flag is used as the GRUB BIOS partition. The partition usually uses about a megabytes of space and is not needed by EFI-booting systems.
- boot - [Mac, MS-DOS, GPT, PC98] This flag indicates that the partition is bootable. On MS-DOS partitioning tables, only one partition may have this flag. However, other partitioning tables allow multiple partitions to have this flag.
- DIAG - [MS-DOS] The partition is used for recovery and diagnostics.
- esp - [MS-DOS, GPT] This flag indicates an UEFI System Partition. GPT uses this flag as an alias for "boot". The UEFI firmware stores files on this partition.
- hidden - [MS-DOS, PC98] Partitions with this flag are hidden from Microsoft operating systems.
- hp-service - [GPT] This the flag for HP Service Partitions. This partition uses the FAT filesystem.
- irst - [MS-DOS, GPT] Intel Rapid Start Technology partitions use this flag.
- lba - [MS-DOS] This flag is used by DOS, Windows 9x, and Windows ME and tells the system to use Linear Mode (Logical Block Addressing).
- legacy_boot - [GPT] Some software (mostly legacy) recognize this flag as indicating that the GPT partition may be bootable.
- LVM - [MS-DOS] This flag indicates to Linux that the partition is a physical volume.
- msftdata - [GPT] This flag is applied to Microsoft Basic Data Partitions (BDP), such as NTFS and FAT filesystems including drive C:. This flag can only be removed if the flags "boot" or "msftres" is applied.
- msftres - [GPT] Windows uses this flag to indicate a Microsoft Reserved Partition (MSR). This is only used on GPT partitioning tables and not MS-DOS (MBR) partitioning tables. Since GPT and the UEFI specification do not allow hidden partitions (exceptions apply), Microsoft Reserved Partitions are needed to replace hidden sectors sometimes used by Windows. Windows (on GPT) needs this partition and it must be before the primary and bootable partitions, but after the EFI System Partition (ESP) and OEM service partitions.
- PALO - [MS-DOS] The marked partition can use the Palo bootloader (used by Linux/PA-RISC).
- PREP - [MS-DOS, GPT] On PowerPC PReP and IBM RS6K/CHRP hardware, this flag indicates that the marked partition supports PReP booting. The PreP partition is not the same as the /boot/ directory or mountpoint.
- raid - [MS-DOS] Linux recognizes this flag as a software RAID partition.
- root - [MAC] This flag is used to inform Linux which partition is the root.
- swap - [MAC] This is used to indicate that a swap partition is for a Linux system.
Further Reading
- GUID Partition Table (GPT) - https://en.wikipedia.org/wiki/GUID_Partition_Table
- Filesystem Reading Guide - http://www.linux.org/threads/filesystem-article-index.6028/
- Partition Tables - http://www.linux.org/threads/partition-tables.4895/