lvm snapshots in ubuntu feisty
Ubuntu 7.04 has some pretty good support for LVM, the Linux Logical Volume Manager. You can set lvm on software raid from the installer - it's not quite obvious, but I guess given the variety of ways people might want to configure raid the configuration needs to reflect that complexity.
I thought I would be clever and take a snapshot of my root filesystem so I could recover if something went wrong. Bad move: the machine becomes unbootable.
It turns out that the dm_snapshot module that handles snapshots is not loaded by default, and without it you can't access the logical volume on which the snapshot is based. So there's no root filesystem block device, therefore no root filesystem and you're dumped into initramfs. (It makes some sense that you can't write without the copy-on-write code being loaded.)
lvm lvs shows this lv having the attributes -wi-do,
where d means mapped (d)evice present without tables
, a
phrase that doesn't seem to be explained anywhere else on the web before today.
So the fix seems to be: from the initramfs shell, run lvm and lvremove the snapshot so you can boot again, and come into regular single user mode. Then add dm_snapshot to /etc/initramfs-tools/modules, and then update-initramfs -u and reboot, and then it should be ok.
Those not used to initramfs might be surprised that putting it into /etc/modules is not enough, that file isn't read (I think) until after the root filesystem is mounted.
(update) However, sadly this is not enough: bug 113713 means that snapshots on lvm on md don't work on the machine I tried it on.
posted Thu 17 May 2007 in /software | link
Archives 2008: Apr Feb 2007: Jul May Feb Jan 2006: Dec Nov Oct Sep Aug Jul Jun Jan 2005: Sep Aug Jul Jun May Apr Mar Feb Jan 2004: Dec Nov Oct Sep Aug Jul Jun May Apr Mar Feb Jan 2003: Dec Nov Oct Sep Aug Jul Jun May
Copyright (C) 1999-2007 Martin Pool.