I use msdos partition table, so there is no PARTUUID supported (it's only on GPT partition tables)

root@xenial:~# fdisk -l
Disk /dev/sda: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa9ff83af

Device     Boot     Start       End   Sectors  Size Id Type
/dev/sda1  *         2048 314574847 314572800  150G  7 HPFS/NTFS/exFAT
/dev/sda2       314574848 315598847   1024000  500M 83 Linux
/dev/sda3       315598848 399484927  83886080   40G 83 Linux
/dev/sda4       399486974 407875583   8388610    4G  5 Extended
/dev/sda5       399486976 407875583   8388608    4G 82 Linux swap / Solaris

So what is PARTUUID displayed in blkid ?

root@xenial:~# blkid
/dev/sda1: LABEL="windows" UUID="3364EC1A72AE6339" TYPE="ntfs" PARTUUID="a9ff83af-01"
/dev/sda2: LABEL="/boot" UUID="9de57715-5090-4fe1-bb45-68674e5fd32c" TYPE="ext4" PARTUUID="a9ff83af-02"
/dev/sda3: LABEL="/" UUID="553912bf-82f3-450a-b559-89caf1b8a145" TYPE="ext4" PARTUUID="a9ff83af-03"
/dev/sda5: LABEL="SWAP-sda5" UUID="12e4fe69-c8c2-4c93-86b6-7d6a86fdcb2b" TYPE="swap" PARTUUID="a9ff83af-05"

I need to change it to debug a ubuntu kickstart multiboot installation, where can i set this PARTUUID ?


Looks like the PARTUUID on a MBR-partitioned disk is the Windows Disk Signature from the MBR block (8 hex digits) + a dash + a two-digit partition number.

The Windows Disk Signature is stored in locations 0x1B8..0x1BB in the first block of the disk (the MBR block), in little-endian byte order.

This command will display the Windows Disk Signature straight out of the MBR:

# dd if=/dev/sda bs=1 count=4 skip=440 2>/dev/null | od -t x4 -An
  • thx ! my source problem is that ubuntu kickstart install break win7 boot. The only thing that change during install are 0>446, and PARTUUID in blkid. I don't want to backup 440>444 with dd then restore it, this would be a dirty fix. Here is my kickstart file -> ptpb.pw/ZMPl Here my tests -> ptpb.pw/Uc7_.png And here log of win7 cdrom repair tool -> ptpb.pw/fxvz Why is kickstart renewing that PARTUUID but only grub-install doesn't ? – eoli3n Jan 25 '18 at 13:00
  • Your kickstart has zerombr yes. It does exactly what you tell it to do, and zeroes the entire MBR block, destroying the old disk signature. – telcoM Jan 25 '18 at 13:09
  • I talked on IRC with ubuntu kickstart dev, on ubuntu implementation, zerombr does nothing, he pasted me that -> paste.ubuntu.com/26409694 Option is still needed to make unattended kickstart install but that's all. Just found that i can't set disk_identifier (PARTUUID) with sfdisk, so i will test this (waiting for Win7 to redeploy). Changes are that i backup previous disk_id with sfdisk, and then restore it while creating part table : ptpb.pw/Byx3 – eoli3n Jan 25 '18 at 13:30
  • Oh. That's... an interesting choice, but maybe reasonable given that they've merged RedHat Kickstart and Debian partman together. Interestingly, on sfdisk of Debian 9, the disk signature is known as label-id. – telcoM Jan 25 '18 at 13:50
  • can't correct anymore, but i wanted to say "i can set disk..." not "can't" :) i will tell you if it worked asap. – eoli3n Jan 25 '18 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.