#Backup lvm and recover partition.

28 messages · Page 1 of 1 (latest)

dense arch
#

So i have a virtual maschine with win 10 on a logical volume and i decided to make a backup of it with dd onto another logical volume. (dd if=/dev/mapper/vg-sourcelv of=/dev/mapper/vg-destlv)
I don't know what happened but my root partiton got corrupted in a way that it got stuck at the intiramfs trying to boot. And i got a reapeating dracut error. so what i tried is back it up via dd (dd if=/dev/nvme0n1p3 of=/dev/mapper/vg-destlv) onto a logical volume and formatted my nvme and made a new gpt partition table. Now i am using a backup of my root partiton that is 4 weeks old but i would like to get my old (new) root partition back or atleast some of the files i created. I mean most stuff is saved but i really would like to get a few libvirt xml's for my vm's back and other stuff i might forgot about. Now after learning my shit probably? went wrong probably because of dd i am hesitant to use it again cause i want to now make a backup from 1 logical volume to another. It has to be like dd because i can't make a logical copy like with rsync. Any ideas? Really want to make a backup before trying testdisk or photorec.

#

Also as an addition. Anyone knows how to tell dd to never write over the end of a partition. Why can i literally write to like a partiton and if my source is bigger it litereally writes over the end into the other partitions. really funny. Now i know why it's called Disk Destroyer.

spiral dune
#

use rsync instead, it preserves permissions but copies at a file level instead of a binary level

#

you can maybe find the xml in the vm software you are using, which what are you using?

#

if qemu/kvm, you can check in virt manager for the xml

dense arch
spiral dune
#

mount you mean?

dense arch
#

shouldn't something like (dd if=/dev/vgsource/lv0 of=/dev/vgtarget/lv0 bs=1024K conv=noerror,sync status=progress)
work

dense arch
spiral dune
#

why can't you mount it?

dense arch
#

so i would like to backup the volume to then try to recover stuff with testdisk and photorec.

spiral dune
#

well dd will work for sure but that's a weird byte size you're using

#

just be careful with it

dense arch
spiral dune
#

you don't need to specify it, it just affects the speed of transfer

#

depends on your disc io speed

#

if you don't specify, it'll probably be slower

dense arch
#

i got a nvme so i don't really care.

spiral dune
#

then do a bigger size imo

#

so it's faster

#

other than speed, it doesn't matter

#

if you don't care about speed just don't specify

dense arch
#

should i use like 4096 which i like the block size of ext4 i guess.

spiral dune
#

yeah

#

sure

#

you can determine the best byte size with a script

#

depends on the hardware