LVM snapshots

I'd used LVM to set up logical volumes as per this guide on my last crunchbang install. I created root, home and swap volumes for my main distro and then later (as per Funishment post) set up similar volumes to dual-boot Arch.

The snapshot bit looked beyond me at the time so I never got round to that. Now I'm confident enough to get GRML installed to USB and use that, with LVM in the command line (as opposed to the system-config-lvm gui) to follow the instructions here.

So, there's not much more to say, beyond following the instructions on the thread. Initially I thought about using LVM to shrink the crunchbang root volume, which I've crazily allocated nearly 20GB after running out of space for the OS last time and having to grow it with LVM. Shat it, though. the thought of messing up the root partition while trying to find a way to back up the root partition was too scary.

So I went ahead and allocated 4G to the snap volume instead of the 1G used in the example (since the snapshot can be 15-20% the size of the actual volume being backed up).

The only snag I hot was that the command  

fsarchiver savefs /mnt/backup/lvmbackup.fsa /dev/linuxVG/snap


failed the first time because although I'd adjusted the size of the snap volume, I hadn't done so with

lvcreate -L2G -n backup

so the volume I was trying to copy to wasn't big enough. It did 77% then gave me the error.

That was soon sorted by growing the volume and extending the filesystem as described in the thread. Tried again and it worked grand. Now I need to look at testing the restore function. I might restore the crunchbang install to archroot and see if it works....

UPDATE: Of course it didn't work! Said something about kernal being missing, device not found, blah blah. I guess there's a device name mapped to the LV it's on, or something. Further research made me sceptical that I've even understood the snapshot/fsarchiver process here, so I'll come back to this and maybe follow a dedicated guide to restoring from LVM snapshots.

Comments

Popular posts from this blog

no sound in Papers Please

pdf to png/jpg/etc

Crunchbang Changes