I bought a new larger SSD to replace my old one. The old one has 3 partitions, 2 for booting and a third (last) one with LVM2 on LUKS. I did the following to migrate:

  • dd the contents of the old drive to the new one (bs=4M)
  • Run partprobe on the new drive (it complained that "Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space")
  • I used gdisk -> extra functionality -> "relocate backup data structures to the end of the disk"
  • At this point, if I opened the partition with cryptsetup, LVM worked fine
  • I then resized the third partition with GParted (when I tried to use the whole disk it threw an error that I can't resize it past the size of the disk, so I had to make it 2 MiB smaller than what GParted showed)
  • I then opened the now larger partition with cryptsetup and for some reason LVM doesn't detect the LVM physical volume anymore.

Running lvmdiskscan -v:

/dev/mapper/crypt_ssd [930,76 GiB] LVM physical volume

Running pvdisplay /dev/mapper/crypt_ssd

Failed to find physical volume "/dev/mapper/crypt_ssd".

Where did I screw up? lvscan doesn't do anything.

  • It's weird that lvmdiskscan and pvdisplay disagree. Have you tried vgscan and pvscan? Have you removed the old drive? Because you used dd you copied the partition and filesystem IDs; it would not suprise me if that can lead to issues. – Emmanuel Rosa May 25 at 8:58

Your Answer

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

Browse other questions tagged or ask your own question.