Re: LVM2 logical volumes on Loop-AES

Jari Ruusu <[email protected]>
Newsgroups gmane.linux.cryptography
Message-ID <[email protected]>
Fog_Watch wrote:
> mr-nosey ~ # ls -la /dev/mapper/vg-root
> brw------- 1 root root 254, 0 Aug 19 06:04 /dev/mapper/vg-root
> The line in build-initrd.sh read (high levels of guessing going on
> here):
> mknod dev/root b 254 0

That mknod command looks ok.

> I don't know about this.  That lvm2create_initrd script says, "#
> Device-Mapper dynamically allocates all device numbers. "

Then you can remove that "mknod dev/root b 254 0" command from the script,
and change the mount() system call to use a device node created by lvm
command. That is first parameter of mount() system call of build-initrd.sh
(2007-08-17 22:12 version) line 570. As in "/dev/root" ->
"/dev/mapper/vg-root"

> The error returned by the patched script, after entering the password
> for losetup, was:
> "Failed to create LVM2 system dir for metadata backups, config files
> and internal cache.
> 
> Set environment variable LVM_SYSTEM_DIR to alternative location or
> empty string."
> 
> This appears to be consistent with a line in
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/~checkout~/LVM2/scripts/lvm2create_initrd/lvm2create_initrd?content-type=text/plain&cvsroot=lvm2&only_with_tag=HEAD
> "echo "$PRE Remounting / read/write"
> mount -t ext2 -o remount,rw /dev/ram0 /"

Your bootloader may be configured pass "ro" kernel parameter, which tells
kernel to mount initrd file system read-only. lvm seems to want it writable,
so change that "ro" kernel parameter to "rw". If there is no "ro" parameter,
then add "rw" parameter.

I did mention earlier that there is very little space in the initrd. If lvm
wants to write a lot of data there, you may need to increase size of the
initrd. You can do that by changing build-initrd.sh (2007-08-17 22:12
version) line 671 from

y=`expr ${y} + 2`

to

y=`expr ${y} + 100`

That part of the script computes how big the uncompressed file system image
should be. That + 2 line increases size by 2 KB, + 100 line increases size
by 100 KB.

-- 
Jari Ruusu  1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9  DB 1D EB E3 24 0E A9 DD

-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.