Randomise partition UUID

I am running Ubuntu 22.04 installed with the installer.

After installation I added a mirror to the pool. Before adding the mirror I copied the partition table over the the mirror I was adding:

sfdisk -d /dev/sdd | sfdisk --force /dev/sde

I forgot to randomise the UUID before adding the mirror to the pool and noticed this:

root@orac:~# systemctl list-units --failed
  UNIT                                                       LOAD   ACTIVE SUB    DESCRIPTION                              
● mnt-10149266795976124053.mount                             loaded failed failed /mnt/10149266795976124053
● mnt-6817744360124939079.mount                              loaded failed failed /mnt/6817744360124939079
● mnt-b8ce2ad6\x2d0374\x2d423f\x2d93d3\x2d15cc339f1bdf.mount loaded failed failed /mnt/b8ce2ad6-0374-423f-93d3-15cc339f1bdf

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.
3 loaded units listed.
root@orac:/home/mike# blkid | grep bpool
/dev/sdd3: LABEL="bpool" UUID="10149266795976124053" UUID_SUB="7554971749162667878" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="ffc44ed2-67ac-b14d-8674-5653f5457c8f"
/dev/sde3: LABEL="bpool" UUID="10149266795976124053" UUID_SUB="1881332597513951535" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="09185217-6483-d64d-a146-25b9b2ef7fcc"

I assumed the mount unit failed because the UUID’s were identical so I tried to randomise the UUID by doing this:

root@orac:/home/mike# sgdisk -G /dev/sde3
Creating new GPT entries in memory.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.

For good measure I ran update-grub but got this:

grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt121).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt122).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt123).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt124).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt125).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt126).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt127).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt128).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt121).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt122).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt123).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt124).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt125).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt126).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt127).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt128).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt121).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt122).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt123).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt124).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt125).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt126).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt127).
grub-probe: warning: Discarding improperly nested partition (hostdisk//dev/sde,gpt3,gpt128).

A scrub of the pool produces no errors:

root@orac:/home/mike# zpool status -L bpool
  pool: bpool
 state: ONLINE
  scan: scrub repaired 0B in 00:00:03 with 0 errors on Tue Dec 26 20:02:37 2023
config:

	NAME        STATE     READ WRITE CKSUM
	bpool       ONLINE       0     0     0
	  mirror-0  ONLINE       0     0     0
	    sdd3    ONLINE       0     0     0
	    sde3    ONLINE       0     0     0

errors: No known data errors


I note here it says:

I understand the anxiousness, but partitions are not stateful constructs. There is no difference between “resizing” a partition and deleting it, then recreating it with the same start and an end further away. So first use fdisk (or gdisk) to print the entire partition layout, and save that layout. Then destroy the partition, and recreate it with the same start, but an end further away. You’ll be fine.

So I am thinking it will be safe to do

sfdisk -d /dev/sdd | sfdisk --force /dev/sde

to at least get me back to where I started. I don’t want to make things worse that I already have. Any advice would be much appreciated.

I ran

partprobe

no change.

f disk found no errors:

root@orac:/home/mike# fdisk /dev/sde

Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.


Command (m for help): v

No errors detected.
Header version: 1.0
Using 3 out of 128 partitions.
A total of 1050590 free sectors is available in 1 segment.

Command (m for help): 

I solved this by detaching /dev/sde from the pool, partitioning it correctly then re-attaching it.

1 Like