I have a snapshot of the root filesystem that I want to boot with – bring the machine into a state it was a few days ago, run some tests and then go back to where I am right now.
I tried editing fstab and just setting the snapshot to boot as root, but it seems that nothing happened – the snapshot was mounted, but the state of the filesystem didn't change, I'm still at the current state.
Edit:
There are no other partitions except root. The snapshot is RHEL 6.2, the current state is RHEL 6.3 (so there is a new kernel). I edited intrd by following this blog article and it seems now that the lvms don't get activated at boot. Dracut writes that all of them are inactive by inherit and freezes.
Best Answer
I found a nice and easy solution (uthers solution somehow didn't work for me, I'm not sure why). Rename the lv_root to something like lv_root_old and then rename the snapshot to lv_root.
Then add
rd_LVM_LV=VolGroup/lv_root_old
into the kernel line ingrub.conf
, so it gets activated (apparently, the snapshot doesn't work if the origin is inactive at boot, since it only contains changes relative to the origin). This is how my grub entry looks like now:Warning - if you upgraded your kernel between taking the snapshot and now, don't forget to boot the kernel that was used when the snapshot was taken.