Score:3

mount second disk named vgubuntu root

cn flag

I have a new laptop which I set up with full disk encryption (LUKS + LVM) I connected my previous harddrive via a M2 to USB adapter to copy old stuff (previous laptop is dead, hard drive still good). The old hard drive was as well setup with full disk encryption in the same fashion (via Ubuntu installer) It doesn't mount. When I connect it I get a pop up to decrypt the volume, I enter the password but it doesn't mount the encrypted "root" volume.

I suspect the issue being both old and new drive having the same lvm group.

# lvs
  LV     VG       Attr       LSize    Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   vgubuntu -wi-------  929.32g                                                    
  root   vgubuntu -wi-ao---- <930.37g                                                    
  swap_1 vgubuntu -wi-------  976.00m                                                    
  swap_1 vgubuntu -wi-ao----  976.00m 

# vgchange -ay
  device-mapper: create ioctl on vgubuntu-root LVM-426Qd8XM3lZ0CzeBAOS1fTrYSTKof5M2qMTV2b287wXd7V9yuXf0DCzVNvYkhUPQ failed: Device or resource busy
  device-mapper: create ioctl on vgubuntu-swap_1 LVM-426Qd8XM3lZ0CzeBAOS1fTrYSTKof5M2kX5eBqeeJxN8NZOYmfYY4fHnyOm6EqPj failed: Device or resource busy
  0 logical volume(s) in volume group "vgubuntu" now active
  2 logical volume(s) in volume group "vgubuntu" now active

Is this indeed the issue? Any idea how to resolve so I can mount both?

I tried following: https://wiki.networksecuritytoolkit.org/index.php/HowTo_Change_The_LVM_Volume_Group_Name_That_Includes_The_Root_Partition to rename the logical volume but failed to create the initramfs and rolled back

Score:3
cn flag

Indeed the problem seems to have been having two different drives with the same name. It is probably possible to follow a variant of the instructions above to rename the LVM of the root partition but what I ended up doing to solve the problem was much simpler.

I connected the old hard drive to a friend's computer which didn't have such a logical volume (wasn't even running Ubuntu). And after entering the encryption password I could easily rename the LVM.

vgrename -v vgubuntu notvgubuntu 

The hard drive would no longer be bootable as the grub and initramfs would not longer match the LVM but I didn't need that I only wanted to be able to mount the old hard drive and copy data off it.

Once the logical group was changed the hard drive mounted seamless on my new laptop.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.