GParted, Partition, and Filesystem Flags

Status
Not open for further replies.
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.

gparted-flags.jpg


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

 

Attachments

  • slide.jpg
    slide.jpg
    24.8 KB · Views: 39,811


So, what will happen if I add flags "bios_grub" and/or "legacy_boot" to the FAT32 partition? Will it appear in MBR GRUB and will it be able to boot?

(thumbnail, click for larger size)
Picture_created_22-09-2024_06-16-38.png
 
So, what will happen if I add flags "bios_grub" and/or "legacy_boot" to the FAT32 partition? Will it appear in MBR GRUB and will it be able to boot?

(thumbnail, click for larger size)
View attachment 22161
I have just been trying to install Debian 12 on my 2010 laptop which does not support UEFI. I want to use GPT instead of MBR. I used the Caramel graphical installer included in the live Debian image and chose manual partition.
The installer says non-UEFI booting Debian on GPT drive requires a partition to be created at the beginning of the drive. It needs to be (1) 8MiB in size; (2) unformatted (without a particular file system); (3) with flag "bios_grub" enabled.
There is also an option of where to install the boot loader (I believe it is just GRUB). There are three options. (1) MBR (I do not know why it is still called this when using GPT); (2) On the boot partition; (3) do not install boot loader.
I followed suit, created and mounted the swap partion and root partition. I also picked to install the boot loader on MBR. However, I intentionally did not enable "boot" flag on the root partition just to see what would happen.
Debian booted successfully after installation. I checked the partition flags with 3 methods and they gave similar results.
1. fdisk.
sudo fdisk -l
It says partition 1 (8MB) has type "BIOS boot". Partition 3 (the root partition) does not have the "boot" flag.
2. parted
sudo parted
print all
It says partition 1 (8MB) has the flag "bios_grub". The root partition does not have the "boot" flag.
3. GParted (may need installation)
It says partition 1 has the file system of "grub2 core.img". It also has the "bios_grub" flag. The root partition again does not have the "boot" flag.
Conclusion: BIOS booting (legavy) a GPT drive is possible. The "bios_grub" is for this particular usage. In this case, the root (/) partition does not need the "boot" flag.
The rabbit hole goes deeper and deeper. I will experiement a bit more and see what happens.
Hope this helps.
 
I have just been trying to install Debian 12 on my 2010 laptop which does not support UEFI. I want to use GPT instead of MBR. I used the Caramel graphical installer included in the live Debian image and chose manual partition.
The installer says non-UEFI booting Debian on GPT drive requires a partition to be created at the beginning of the drive. It needs to be (1) 8MiB in size; (2) unformatted (without a particular file system); (3) with flag "bios_grub" enabled.
There is also an option of where to install the boot loader (I believe it is just GRUB). There are three options. (1) MBR (I do not know why it is still called this when using GPT); (2) On the boot partition; (3) do not install boot loader.
I followed suit, created and mounted the swap partion and root partition. I also picked to install the boot loader on MBR. However, I intentionally did not enable "boot" flag on the root partition just to see what would happen.
Debian booted successfully after installation. I checked the partition flags with 3 methods and they gave similar results.
1. fdisk.
sudo fdisk -l
It says partition 1 (8MB) has type "BIOS boot". Partition 3 (the root partition) does not have the "boot" flag.
2. parted
sudo parted
print all
It says partition 1 (8MB) has the flag "bios_grub". The root partition does not have the "boot" flag.
3. GParted (may need installation)
It says partition 1 has the file system of "grub2 core.img". It also has the "bios_grub" flag. The root partition again does not have the "boot" flag.
Conclusion: BIOS booting (legavy) a GPT drive is possible. The "bios_grub" is for this particular usage. In this case, the root (/) partition does not need the "boot" flag.
The rabbit hole goes deeper and deeper. I will experiement a bit more and see what happens.
Hope this helps.
Interesting. I no longer need multitype of booting bc I kicked the other OS in the a55, but still it's a good to know information. If I understood everything correctly, you can boot a UEFI installed OS from an MBR grub, if you add a flag "bios_grub" to the UEFI partition and then add that entry to grub.
 
@KGIII Can you lock this topic, it's a 10 year old topic and the OP isn't even a member of the site anymore.
 
@KGIII Can you lock this topic, it's a 10 year old topic and the OP isn't even a member of the site anymore.

Yeah, it's pretty old. I'm not sure that any of this stuff has changed but it's worth starting a new thread rather than digging up an old thread where the OP hasn't posted in a long time.
 
The thread can stay locked, but the Member is still a Member, FYI


and the OP isn't even a member of the site anymore.

If you go to the Members section and type in the full words

DevynCJohnson

you may find him, he has not posted for about 3 1/2 years.

Devyn is a son of our staff writer, Jarret.

Cheers

Wizard
 
Status
Not open for further replies.

Members online


Top