Restore volume groups after remove in RO file sytem

28 views
Skip to first unread message

ion.4...@mail.md

unread,
Aug 26, 2017, 4:36:41 AM8/26/17
to qubes-users
I wanted to transfer all my data from encrypted HDD(Debian 9) to Qubes OS

1. I attach HDD and run these commands:

udisksctl unlock -b /dev/xvdi5

modprobe dm-mod

vgscan

vgchange -ay debian-vg


2. After I copied a couple of file i run this:

lvchange -an debian-vg

vgremove debian-vg

Now after reboot and run from this disk i have this error:

Begin: Runing /scripts/local-block ...
Volume group "debian-vg" not found
Skipping volume group debian-vg
Unable to find LVM volume debian-vg/root

In (AppVM) /etc/lvm is only one file (lvm.conf)

Maybe somewhere in the logs left data about LVM volume or volume group?
Maybe is possible to mount and restore data?

Unman

unread,
Aug 28, 2017, 4:02:44 PM8/28/17
to ion.4...@mail.md, qubes-users
I'd hope that you have a full backup of the data.
In general I recommend using vgexport instead of vgremove because that
is a destructive operation, (as you've discovered.)

If possible I would take a full disk clone before doing anything else.
Then you could try to recover the metadata -
without knowing a good deal more about how your disk was organised it's
difficult to be precise. But if you had sda1 as the LVM partition, you
could try poking at the first part of that partition to see if you can
get the data from your volumegroup(VG)
'dd if=/dev/sda1 of=debian-vg bs=512 count=255 skip=1'
Then open the debian-vg file and look for the configuration data -
delete the extraneous material but make sure that you keep the right
format.(You'll need to use a decent editor that copes with binary data,
like vi)

Then see if you can restore from the recovered file:
'vgcfgrestore debian-vg'

unman

Unman

unread,
Aug 28, 2017, 4:13:23 PM8/28/17
to ion.4...@mail.md, qubes-users
If you did a standard Qubes install and encrypted the disk, you will, of
course, have to decrypt the partition before trying this, and make sure
that you dd from the decrypted partition.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages