setup-storage problem with lvm and fstabkey:uuid vs fstabkey:device

Brian Kroth bpkroth at gmail.com
Thu Sep 2 21:24:02 CEST 2010


How to begin ...

I have a collection of Debian squeeze and Debian lenny machines that I
install via FAI and pxelinux.  The lenny machines are running 2.6.32
from lenny-backports and the squeeze machines 2.6.32 from squeeze.  

They both use something like the attached disk_config to setup a /boot
partition and the rest as LVM with a handful of LVM partitions including
the root partition /.

With lenny, the device links for the LVM partitions (setup by udev?)
are something like /dev/mapper/vg-root as read from the /dev/vg/root
symlink.  With fstabkey:device FAI's setup-storage will use that in the
fstab, grub, etc.

With squeeze /dev/vg/root is a symlink pointing to /dev/dm-[0-9] as is
/dev/mapper/vg-root, so setup-storage uses that in setting up fstab,
grub, etc.  The problem with this is that /dev/dm-[0-9] changes between
install and initial boot.

This got me to thinking, what is the point of this line (from
Fstab.pm:207) in the first place?  Why not just leave /dev/$vg/$lv as
the fstab and grub keys?

        # resolve the symlink to the real device
        # and write it as the first entry
        &FAI::execute_ro_command("readlink -f /dev/$device/$l", \@fstab_key, 0);

Now, I would use fstabkey:uuid (even though a number of sources say not
to given that LVM snapshots may have the same UUID), but booting LVM via
UUID with lenny doesn't seem to work, even though it does for squeeze.

So, I'm currently left with a situation where neither solution
(fstabkey:uuid or fstabkey:device) works for both squeeze and lenny.

Any thoughts?

Thanks,
Brian
-------------- next part --------------
# VMDEFAULT
# 2009-06-01
# bpkroth
#
# This file is a disk_config file uses the setup-storage syntax to create an
# LVM'd vm server disk layout that preserves partitions.  It is expected to
# be at least 12G.
#
# We could set tuneopts="-c 0 -i 0" to disable periodic fsck's but that doesn't
# seem like a great idea to me.
#
# We also used to set "-O dir_index,filetype,resize_inode" in the createopts,
# but since those are contained in /etc/mke2fs.conf's defaults, we don't bother
# anymore.

# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>

# Setup the first disk to use an msdos partition table and two partitions, one
# for /boot and the rest for LVM.
disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid
primary		/boot			256M		ext3	defaults,rw createopts="-L boot" tuneopts="-c 90 -i 90d"
primary		-			10G-		-	-

# Setup LVM to contain all the system partitions.
# Make sure that all partitions can be resized, /local.hd is preserved unless
# it doesn't exist and gets to claim almost all of whatever's left.  It leaves
# a little bit in case we need to resize later.
 
vg vg disk1.2
disk_config	lvm fstabkey:device preserve_reinstall:vg-local.hd
vg-swap		swap			512M-1G		swap	sw createopts="-L swap"
vg-root		/			5G-8G		ext3	defaults,rw,errors=remount-ro createopts="-L root" tuneopts="-c 90 -i 90d"
vg-var		/var			3G-5G		ext3	defaults,rw createopts="-L var" tuneopts="-c 90 -i 90d"
vg-local.hd	/local.hd		512M-90%	ext3	defaults,rw,nosuid,nodev createopts="-L local.hd -m 1" tuneopts="-c 90 -i 90d"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20100902/7fc3934a/attachment.bin 


More information about the linux-fai mailing list