Making sure to partition the right disk(s)

Henning Glawe henning.glawe at mpsd.mpg.de
Fri Jan 19 10:34:25 CET 2024


Moin,

On Fri, Jan 19, 2024 at 09:34:49AM +0100, Henning Glawe wrote:
> On Fri, Jan 19, 2024 at 09:03:57AM +0100, Diego Zuccato wrote:
> > It's not too unusual that sometimes disks get recognized in a different
> > order across reboots.
> > How can I make sure I'm repartitioning the right disk and not another
> > one containing data? I can't find any way to bind some info about HDD to
> > "disk1" instead of "disk2".
> > 
> > If it's not currently supported, it shouldn't be too hard to add to
> > 20-hwdetect.sh (I can do it and share the result, if someone is
> > interested). But if it's already supported, better to use the official
> > method. :)
> 
> you can put the /dev/disk/by-id/$disk_id directly into your disk_config.
> 
> where $disk_id could be the WWN, serial number or other identifiers
> generated by kernel+udev on your hardware.

Example:

---- $FAI/disk_config/mpsd-srv-ibm-001 ----
# set boot flag on /boot/efi
disk_config /dev/disk/by-id/wwn-0x600605b002b15b50203efd9326bb4cf7 disklabel:gpt fstabkey:uuid bootable:2

# boot-related
#   first GPT partition: bios_grub, flag set in $FAI/scripts/BOOT_GRUB/10-setup
primary -          16M -    -
primary /boot/efi 128M vfat rw          createopts="-F32"
primary /boot     512M xfs  rw,noatime
# system partitions
primary swap       16G swap sw
primary /         100G xfs  rw,noatime
primary /var       0-  xfs  rw,noatime
-------------------------------------------

-- 
Mit freundlichen Grüßen
Henning Glawe

Dr. Henning Glawe
Max-Planck-Institut für Struktur und Dynamik der Materie
Geb. 99 (CFEL), Luruper Chaussee 149, 22761 Hamburg, Germany
http://www.mpsd.mpg.de/, Email: henning.glawe at mpsd.mpg.de
Building/Room: 99/O2.100, Phone: +49-40-8998-88392


More information about the linux-fai mailing list