Partition Types

From Linux Raid Wiki
(Difference between revisions)
Jump to: navigation, search
(What Partition Type: update with GPT. TODO: condense this, since it's too long.)
m (What Partition Type)
Line 26: Line 26:
 
(From the mdadm 2.6.8 man-page) When creating partition-based arrays using mdadm and version-1.x superblocks, the partition type should be set to 0xDA (non fs-data). This type selection allows for greater precision since using any other type [RAID auto-detect (0xFD) or a GNU/Linux partition (0x83)], might create problems in the event of array recovery through a live cdrom.
 
(From the mdadm 2.6.8 man-page) When creating partition-based arrays using mdadm and version-1.x superblocks, the partition type should be set to 0xDA (non fs-data). This type selection allows for greater precision since using any other type [RAID auto-detect (0xFD) or a GNU/Linux partition (0x83)], might create problems in the event of array recovery through a live cdrom.
  
Autodetection was useful before booting an initrd to load kernel modules and set up the real root FS was standard practice.  It allowed booting a kernel with root=/dev/md0.  A RAID-root system these days will handle it by including mdadm with a config file, and all needed kernel modules, in the initrd.  All major distros have used initrd booting for years.
+
Autodetection was useful before booting an initrd to load kernel modules and set up the real root FS was standard practice.  It allowed booting a kernel with root=/dev/md0 with no initrd.  A RAID-root system these days will handle it by including mdadm with a config file, and all needed kernel modules, in the initrd.  All major distros have used initrd booting for years.
  
 
On GPT partition tables, the author of gdisk made up some partition type numbers so users wouldn't have to type the full GPT UUID partition type IDs.  They are similar to the MBR-equivalent numbers, but that's only for ease-of-use.  The on-disk format stores a 16-byte UUID.  Use gdisk's 0xFD00 partition type for RAID partitions on GPT.  gdisk doesn't have a 0xDA00 partition type, as the author wasn't aware of the reasons for 0xFD being deprecated on MBR.  If the Linux md code doesn't auto-start GPT 0xFD00 arrays, then there's no reason to avoid it.  (TODO: check the behaviour)
 
On GPT partition tables, the author of gdisk made up some partition type numbers so users wouldn't have to type the full GPT UUID partition type IDs.  They are similar to the MBR-equivalent numbers, but that's only for ease-of-use.  The on-disk format stores a 16-byte UUID.  Use gdisk's 0xFD00 partition type for RAID partitions on GPT.  gdisk doesn't have a 0xDA00 partition type, as the author wasn't aware of the reasons for 0xFD being deprecated on MBR.  If the Linux md code doesn't auto-start GPT 0xFD00 arrays, then there's no reason to avoid it.  (TODO: check the behaviour)
  
 
This [https://bbs.archlinux.org/viewtopic.php?pid=1254839#p1254839 post from the gdisk author] explains the situation, and warns against tools that set up RAID partitions with the same type UUID as Windows uses for NTFS.  You're just asking to have your RAID partitions scribbled over with a fresh NTFS if you do that.  If you want to set the type to something other than 0xFD00, make up an unused UUID.  Do NOT use <code>EBD0A0A2-B9E5-4433-87C0-68B6B72699C7</code> -- "Microsoft Basic Data".
 
This [https://bbs.archlinux.org/viewtopic.php?pid=1254839#p1254839 post from the gdisk author] explains the situation, and warns against tools that set up RAID partitions with the same type UUID as Windows uses for NTFS.  You're just asking to have your RAID partitions scribbled over with a fresh NTFS if you do that.  If you want to set the type to something other than 0xFD00, make up an unused UUID.  Do NOT use <code>EBD0A0A2-B9E5-4433-87C0-68B6B72699C7</code> -- "Microsoft Basic Data".

Revision as of 23:24, 19 February 2015

Arrays are built on top of block devices; typically disks.

This leads to 2 frequent questions:

  • Should I use entire device or a partition?
  • What partition type?

There is no right answer - you can choose.

Entire Devices or Partitions

Your editor prefers to use partitions that are slightly smaller than a device. This allows:

  • the device has a partition table - no 'partition table not found'
  • replacement disks even of the same model are often slightly smaller and making the partition 100Mb smaller than the device allows some tolerance.
  • no performance impact

Neil, the md/mdadm author, uses whole disks.

What Partition Type

If you are using partitions then there 2 choices for MBR partition tables, and only one for GPT:

  • 0xDA for non-fs data
  • 0xFD for raid autodetect arrays
  • 0xFD00 on GPT

(From the mdadm 2.6.8 man-page) When creating partition-based arrays using mdadm and version-1.x superblocks, the partition type should be set to 0xDA (non fs-data). This type selection allows for greater precision since using any other type [RAID auto-detect (0xFD) or a GNU/Linux partition (0x83)], might create problems in the event of array recovery through a live cdrom.

Autodetection was useful before booting an initrd to load kernel modules and set up the real root FS was standard practice. It allowed booting a kernel with root=/dev/md0 with no initrd. A RAID-root system these days will handle it by including mdadm with a config file, and all needed kernel modules, in the initrd. All major distros have used initrd booting for years.

On GPT partition tables, the author of gdisk made up some partition type numbers so users wouldn't have to type the full GPT UUID partition type IDs. They are similar to the MBR-equivalent numbers, but that's only for ease-of-use. The on-disk format stores a 16-byte UUID. Use gdisk's 0xFD00 partition type for RAID partitions on GPT. gdisk doesn't have a 0xDA00 partition type, as the author wasn't aware of the reasons for 0xFD being deprecated on MBR. If the Linux md code doesn't auto-start GPT 0xFD00 arrays, then there's no reason to avoid it. (TODO: check the behaviour)

This post from the gdisk author explains the situation, and warns against tools that set up RAID partitions with the same type UUID as Windows uses for NTFS. You're just asking to have your RAID partitions scribbled over with a fresh NTFS if you do that. If you want to set the type to something other than 0xFD00, make up an unused UUID. Do NOT use EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 -- "Microsoft Basic Data".

Personal tools