duplicated UUID after disk clone - how to change

KubaMiszcz

New Member
Dec 30, 2023
5
1
3
i've cloned disk and it duplicates all, with UUIDS, now sometimes pve uses data from another disk
how to change UUID=SaZQel-Jedo-N8Rq-50Ek-PMbt-AJAX-bLT0JA?

Bash:
root@proxmox:~# lsblk -f
NAME                         FSTYPE      FSVER    LABEL              UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1
├─sda2                       vfat        FAT32                       6DF4-C980                              1019.7M     0% /boot/efi
├─sda3                       LVM2_member LVM2 001                    SaZQel-Jedo-N8Rq-50Ek-PMbt-AJAX-bLT0JA
│ ├─pve-swap                 swap        1                           933cdfaf-b353-45c1-bf28-d1da3ee9af7f                  [SWAP]
│ ├─pve-root                 ext4        1.0                         5e2be4f7-bf54-45dc-bcd0-0ef7133f51f5     52.9G    15% /
│ ├─pve-data_tmeta
│ │ └─pve-data-tpool
│ │   ├─pve-data
│ │   ├─pve-vm--106--disk--0 ext4        1.0                         f8de3faf-b23f-4835-9adc-14fc57e9908d
│ │   ├─pve-vm--108--disk--0 ext4        1.0                         d1d4b960-92a0-4095-9fff-163a7349bb29
│ │   └─pve-vm--100--disk--0 ext4        1.0                         39d88cd2-347c-4954-9ec8-393f40b26786
│ └─pve-data_tdata
│   └─pve-data-tpool
│     ├─pve-data
│     ├─pve-vm--106--disk--0 ext4        1.0                         f8de3faf-b23f-4835-9adc-14fc57e9908d
│     ├─pve-vm--108--disk--0 ext4        1.0                         d1d4b960-92a0-4095-9fff-163a7349bb29
│     └─pve-vm--100--disk--0 ext4        1.0                         39d88cd2-347c-4954-9ec8-393f40b26786
└─sda4                       ntfs                 NAS-SSD            01DA43F249B22810                          1.2T    27% /mnt/NAS-2TB-SSD
sdb
├─sdb1
├─sdb2                       vfat        FAT32                       3098-E4D0
├─sdb3                       LVM2_member LVM2 001                    SaZQel-Jedo-N8Rq-50Ek-PMbt-AJAX-bLT0JA
└─sdb4                       ntfs                 Backup-NAS-2TB-SSD 01DA4631AD94C180



Code:
root@proxmox:~# pvchange -u /dev/sda3
  WARNING: Not using device /dev/sdb3 for PV SaZQel-Jedo-N8Rq-50Ek-PMbt-AJAX-bLT0JA.
  WARNING: PV SaZQel-Jedo-N8Rq-50Ek-PMbt-AJAX-bLT0JA prefers device /dev/sda3 because device is used by LV.
  Cannot update volume group pve with duplicate PV devices.
  Physical volume /dev/sda3 not changed
  0 physical volumes changed / 1 physical volume not changed

when i unplug second drive:
Code:
root@proxmox:~# pvchange -u /dev/sda3
  Volume group containing /dev/sda3 has active logical volumes
  Physical volume /dev/sda3 not changed
  0 physical volumes changed / 1 physical volume not changed

when i try to deactivate pve
Code:
root@proxmox:~# vgchange -a n pve
  Logical volume pve/swap in use.
  Can't deactivate volume group "pve" with 5 open logical volume(s)

how can i change it? make UUID unique? i may unplug second one and make i t in gparted but i suppose this partition doesnt exist physically
maybe i delete it and create by proxmox 'export' or sth? or how to acheive backup all proxmox stuff with this my partition also?

disk clone also duplicates UUID, and copy all disk, but on this last partitions I use rsync to sync changes only

what is a way to do this?
 
You should be able to regenerate the GUIDs of a disk via sgdisk -G
 
nope :|
it does nothing, when i try sgdisk -G /dev/sda3 it do soemthing and now my parititions is gone:
probably converted or sth

Code:
root@proxmox:~# lsblk -f
NAME                         FSTYPE      FSVER    LABEL              UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1
├─sda2                       vfat        FAT32                       6DF4-C980                              1019.7M     0% /boot/efi
├─sda3
└─sda4                       ntfs                 NAS-SSD            01DA43F249B22810                          1.2T    27% /mnt/NAS-2TB-SSD

Code:
root@proxmox:~# blkid |grep sda
/dev/sda4: LABEL="NAS-SSD" BLOCK_SIZE="512" UUID="01DA43F249B22810" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b368a181-2aa3-4779-a148-b60992bcfda2"
/dev/sda2: UUID="6DF4-C980" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="f03b83a3-8cc4-4cdc-8eb0-fe1b515f30af"
/dev/sda3: PTUUID="4f9dcbc6-ca29-4f79-bf60-f041a54db309" PTTYPE="gpt" PARTLABEL="Basic data partition" PARTUUID="d4cde249-44b2-4a92-ac3a-915b11700589"
/dev/sda1: PARTLABEL="Basic data partition" PARTUUID="80880379-44df-4d2b-923a-a8e64a37b676"
 
Last edited:
I'm afraid the issue is that you need to run the command on the disk (/dev/sda), rather than the partition (/dev/sda3). Since this writes a new partition table you will have to clone the disk again. Also, apparently the way to change the UUID of the LVM member (not the partition itself which is what sgdisk does) is pvchange --uuid /dev/sda3
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!