Weblog entry #8 for drgraefy
However, at first glance, it appeared that the only LVM utility in the initramfs is /sbin/vgimport. This one utility was not sufficient for me to get LVM going. I remembered, though, that lvm on a full system is in fact just a single utility linked by various names:
servo:~ 0$ readlink -f $(which vgimport) /sbin/lvm servo:~ 0$It turns out that this is also true on the initramfs: the full lvm binary is available on the initramfs, it's just called 'vgimport'. To get around this, I just linked /sbin/vgimport to /sbin/lvm, and was then able to get full lvm capability with the "lvm < subcommand>" syntax.
Comments on this Entry
[ Send Message | View dkg's Scratchpad | View Weblogs ]
mkdir -p cleandir/root cd cleandir/root gzip -d < /boot/initrd.img-$(uname -r) | fakeroot -s ../frs cpio --extract fakeroot -i ../frs -s ../frs mv sbin/vgchange sbin/lvm for link in $(find $(dpkg -L lvm2 | grep ^/sbin/) -type l | cut -f3 -d/); do fakeroot -i ../frs -s ../frs ln -s lvm sbin/$link done find * | fakeroot -s ../frs cpio --create | gzip > ../initrd.img.withlvm-$(uname -r) ls -l /boot/initrd.img-$(uname -r) ../initrd.img.withlvm-$(uname -r)
Is there any reason why these links should not be included by default, as long as lvm is being included in the initramfs? It'd certainly make things easier during recovery.
[ Parent | Reply to this comment ]
Second, about why think links aren't included by default, I have no idea. It sure would make things easier. Maybe it's worth filing a bug, but I'm not sure which package it would be against. initramfs-tools? yaird?
[ Parent | Reply to this comment ]
[ Send Message | View dkg's Scratchpad | View Weblogs ]
Anyway, comparing against a clean repack of the initramfs, i get:
[0 dkg@squeak root]$ ls -l ../initrd.img.* -rw-r--r-- 1 dkg dkg 7045782 2008-10-24 18:42 ../initrd.img.repacked-2.6.26-1-686 -rw-r--r-- 1 dkg dkg 7046618 2008-10-24 18:43 ../initrd.img.withlvm-2.6.26-1-686 [0 dkg@squeak root]$so it increases in size by 836 bytes.
I think this is definitely a bug, and i'd file it against lvm2, since that package supplies /usr/share/initramfs-tools/hooks/lvm2 (that looks like the most sane place to insert the symlinks into the initrd).
[ Parent | Reply to this comment ]