Hoppa till innehåll

Månad: september 2016

Recover files from old system LUKS drive

So a few weeks ago – at my very first lecture for this semester – my precious laptop (Sony Vaio Pro 13) gave in. I was rather upset, I must admit. However I actually got myself another one – with twice as much RAM and disk space (pretending it’s the same, altough I love new tech).
Now, the Vaio Pro 13 uses M.2 SSD disks, so backing up the old drive, which I of course kept, needed a M.2 to SATA adapter. Also I already got a SATA to USB. And although I have rather sophisticated backup routine for my machines, there are still things that there, on the old system, that I want – like PPAs, config files and what not (I really need to start backing them up as well). Of course one could to a complete restoration of the system, but I do very much like to combine a backup restore with the feeling of a freshly installed system, hence I recover only what I want.
20160924_131529
I plugged everything in. I’m using LUKS on all machines for better security so the passphrase promt showed up much to my appreciation, but. Error. Of course my heart rate rised. Trying a few times more; trying the disk utilty; on other computers; again in the new one. No change. Pop up the terminal to run the commands manual (I knew that it was /dev/sdb5 from error and disk utility):

$ sudo cryptsetup luksOpen /dev/sdb5 encrypt_oldhome
$ mkdir oldhome
$ sudo mount /dev/mapper/encrypt_oldhome oldhome/
mount: unknown filesystem type ’LVM2_member’

And I though: ”What is this?”. I have the lvm2 package installed. Searching and found that it is due to the LVM groups of the old and new system having the very same name, which created the issue.[1]
So, of course one has to change that, but how? Well, using vgrename.[2]
Once again, in terminal, you run:

$ sudo vgdisplay

Here you locate the old LVM – and do be very sure about this so that you accidentally don’t rename the volume of currently running system. I made sure of this by looking at the size of the drives; my old one was 128GB and new is 256GB. Once located, you copy the ”VG UUID” and run this command:

$ sudo vgrename YOUR-VG-UUID ubuntu-vg-old

(”ubuntu-vg-old” is the new name, which the suffix ”old” is added from prevous ”ubuntu-vg”, which is Ubuntu’s default)
Now you are once again able to mount the old system by re-running the mount command, now without error:

$ sudo mount /dev/mapper/encrypt_oldhome oldhome/

So, in conclusion, the issue was that the new and old system’s volume group (LVM) had the same name. Solution was to change the name of the old drive’s LVM.
 
1: https://askubuntu.com/a/766141
2: http://www.cyberciti.biz/faq/warning-duplicate-vg-name-server01-error/

Kommentarer är stängda

I huvudet, om huvudet.

Vi vacklar sällan när det kommer till tanken om tanken. Vi erkänner varandras minnen; vad vi talar om; vad vi hör. (Vi är sällan källkritiska.) Vi bygger vår vardag på motoriskt inlärda ritualer såsom att gå upp ur sängen och göra sig i ordning för en dag bland publik. Vi interagerar, vi funderar. Vi lär; vi lär ut. Men sällan när det väl kommer till vad som kulturellt har blivit så socialt accepterat att vi inte längre tänker på det, så förgås tanken och reduceras till något enskilt naturligt. Såsom ”biologiska skillnader”. Hur betydande dessa är – mellan kvinnor och män; mellan de med olika pigment – för vårt samhälle. De är, likt den sociala konventionen att torka sig efter toalettbesöket, eller att se på varandra vid interaktion, precis lika socialt konstruerade.
Vi föds alla lika och på samma sätt; vi dör alla lika och på samma sätt. När hjärnan, och dess tanke är död, så är människan död. Tillsammans med sexism och rasism, och andra fördomar.
Tänk på det.

Kommentarer är stängda