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.
#Backup lvm and recover partition.
28 messages · Page 1 of 1 (latest)
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.
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
yes but what if i cannot amount the partition i want to copy?
mount you mean?
shouldn't something like (dd if=/dev/vgsource/lv0 of=/dev/vgtarget/lv0 bs=1024K conv=noerror,sync status=progress)
work
yes
why can't you mount it?
it has bad superblocks
so i would like to backup the volume to then try to recover stuff with testdisk and photorec.
well dd will work for sure but that's a weird byte size you're using
just be careful with it
i think sometimes i didn't specify it at all. sometimes i do just 1M. I don't know is it important?
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
i got a nvme so i don't really care.
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
should i use like 4096 which i like the block size of ext4 i guess.