Software RAID + LVM2

Michael Tautschnig mt at debian.org
Thu Jan 20 00:45:25 CET 2011


Hi Fredrik,

I'm slowly catching up... I have also read your most recent mails, but I'll
first try to respond to this one:

[...]
> We have made some progress, we are now able to preserve vg0-home of
> a pre installed system with the following disk_config
> 
> disk_config sda bootable:1 preserve_lazy:1,2
> primary  -              512     -        -
> primary  -              0-      -        -
> 
> disk_config sdb bootable:1 preserve_lazy:1,2
> primary  -              512     -        -
> primary  -              0-      -        -
> 
> disk_config raid preserve_lazy:0,1 always_format:0
> raid1        /boot   sda1,sdb1  ext3    rw,errors=remount-ro
> raid1        -       sda2,sdb2  -       default
> 
> disk_config lvm preserve_lazy:vg0-home
> vg              vg0                   md1
> vg0-root                /                       4096        ext3       rw
> vg0-swap                swap                    4096        swap       rw
> vg0-var                 /var                    10240       ext3       rw
> vg0-tmp                 /tmp                    2048        ext3       rw
> vg0-usr                 /usr                    10240       ext3       rw
> vg0-src                 /usr/src                10240       ext3       rw
> vg0-local               /usr/local              10240       ext3       rw
> vg0-home           /home                   102400      ext3       rw
> 

Just a note: it shouldn't be necessary to add the preserve_lazy:1,2 and
preserve_lazy:0,1 lines - setup-storage should definitely be able to figure this
out itself, just from the preserve_lazy:vg0-home. In fact I'd even be interested
in a try that shows that this effectively works.

> when using these modifications
> 
> --- /srv/fai/lennyroot64/live/filesystem.dir/usr/sbin/setup-storage
> 2010-12-23 23:21:37.000000000 +0100
> +++
> /srv/fai/squeezeroot64/live/filesystem.dir/usr/sbin/setup-storage
> 2011-01-05 14:47:11.000000000 +0100
> @@ -135,8 +135,12 @@
> # read the sizes and partition tables of all disks listed in $FAI::disks
> &FAI::get_current_disks;
> 
> +# if they are on top of RAID we have to start mdadm first
> +system "/sbin/mdadm-startall";
> # see whether there are any existing LVMs
> &FAI::get_current_lvm;
> +# and stop mdadm
> +system "/etc/init.d/mdadm-raid stop";
> 

Hmm, I wonder whether the kernel module md-mod is loaded before setup-storage
starts. Could you please try to figure that out? I had hoped that if it is
loaded, the array would be detected without such explicit starting of mdadm.

> # see whether there are any existing RAID devices
> &FAI::get_current_raid;
> @@ -177,7 +181,11 @@
> $FAI::debug and print Dumper \%FAI::configs;
> 
> # generate the command script
> -&FAI::build_disk_commands;
> +# build_disk_commands won't leave our partitions alone
> +#&FAI::build_disk_commands;
> +&FAI::push_command( "true", "" , "pt_complete_/dev/sda");
> +&FAI::push_command( "true", "" , "pt_complete_/dev/sdb");
> +
> &FAI::build_raid_commands;
> &FAI::build_lvm_commands;
> &FAI::build_cryptsetup_commands;
> 

In what sense is it not leaving your partitions alone, or, rather, what does it
break? Could you please give it another try with only the above mdadm-changes?

> 
> This seem to work as for preserving vg0-home and its contents and
> everything gets installed, but makes the system unbootable, it
> cannot find vg0 although the installation does.
> 
> Loading, please wait...
>   Volume group "vg0" not found
>   Skipping volume group vg0
> Unable to find LVM volume vg0/root
> 
> Perhaps the disk config is not saved correctly after our changes.
> 

[...]

What is it that gives these messages, is it grub? I think it would help me a lot
if you could send along the full fai.log; you might want to send that in private
mail, though.

Thanks a lot,
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20110119/a9ae6197/attachment.bin>


More information about the linux-fai mailing list