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

Brian Kroth bpkroth at gmail.com
Thu Sep 2 22:13:25 CEST 2010


Brian Kroth <bpkroth at gmail.com> 2010-09-02 14:24:
> 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);

BTW, this seems to work:
--- /install/fai/nfsroot/amd64/lenny/live/filesystem.dir/usr/share/fai/setup-storage/Fstab.pm   2010-04-05 07:39:33.000000000 -0500
+++ /install/fai/nfsroot/amd64/squeeze/live/filesystem.dir/usr/share/fai/setup-storage/Fstab.pm 2010-09-02 14:24:25.000000000 -0500
@@ -204,7 +204,11 @@
         
         # 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);
+# Sets up broken links to /dev/dm-[0-9]
+# 2010-09-02
+# bpkroth
+#        &FAI::execute_ro_command("readlink -f /dev/$device/$l", \@fstab_key, 0);
+       $fstab_key[0] = "/dev/$device/$l";
         
         # remove the newline
         chomp ($fstab_key[0]);

Brian

<snip/>
-------------- 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/0933ff99/attachment.bin 


More information about the linux-fai mailing list