micro-patch for setup-storage

Brian Kroth bpkroth at gmail.com
Mon Aug 27 21:01:40 CEST 2012


Just now catching up on things ...

Thomas Neumann <blacky_tn at fluffbunny.de> 2012-08-22 19:18:
> Thomas Neumann <blacky+fai at fluffbunny.de> wrote:
>> I'm currently experimenting with this attached patch, which simply logs
>> and ignores any 'self_cleared_[a-z.]' dependencies. This makes the
>> resolver finish successfully, but afterwards there's this little gem:
>>
>>  wipefs -a vg_system/fscache
>>  Command had non-zero exit code
>
> And after fixing this bug I stumbled upon another bug. Let me cite from my
> attached patch:
>
> # removed '&FAI::push_command( "wipefs -a /dev/$vg/$lv", ...'
> # due to a dependency bug
> #  either you FIRST wipe the fs and THEN disable the volume group
> #  or you simply disable the group.
> #  FIRST disabling the group and THEN wiping the logical volume
> #  simply won't work! (Especially if you REQUIRE the vg to be
> #  disabled before you attempt the volume.)
>
> @Brian: I successfully tested this patch with your disk config. However I
>        had to remove 'preserve_reinstall:vg-local.hd' since setup-storage
>        does not recognize this option.

Since when?  It's still in the man page.  That is/was a very useful 
feature.

...

Actually, in my testing of your patch it seemed to do just fine with it 
so long as I didn't boot with "initial" in the FAI_FLAGS, which is as 
expected.

> In general:
>
> Okay. Thomas L. already complained (rightfully) that 4.0.0 received way to
> little testing before the release but this is getting ridiculous. I think
> it is safe to say that either setup-storage received no testing at all
> regarding LVM volumes or it was tested only with empty disks. (No previous
> lvm configuration or a totally empty partition table.) I'm convinced it is
> simply not possible that this version has been tested successfully against
> a dirty lvm-disk. (A simple re-install would have shown these bugs.)

Agreed, though I'm finding that with wheezy in general so far (eg: sudo 
doesn't work with ldap, ext4 + nfs hash problems, etc.).

> Apart from that - I need to rant and vent off some steam:
>
> I like to code in perl. I think I'm quite good at it. But these bugs
> were extremely hard to debug. This is code is _awful_. For instance
> 'order_commands': In 44 lines of code there are accesses to 20 variables
> and 1 function outside of the current packages scope. A lot of these are
> repetetive calls to the same variables. One of these variables is
> simply called $FAI::n_c_i - as non-descriptive as it gets. Additionally
> this variable changes with each access to &FAI::push_command.
>
> 'What do you argue about?'
>
> The point is you cannot simply isolate small parts of the programm and
> test them. You simply can't because all of these 'modules' are deeply
> intermingled with each other. The code is split up into different modules
> but that is simply an illusion. It's one heap. There are no modules.
>
> So?
>
> If there's a desire to improve this situation then I'll happily lend a
> hand. Let's talk about it. Let's discuss design principles. Let's design
> a proper test environment. I could even try to branch setup-storage and
> rewrite it to my heart's content.
>
> I helped Brian fix his problem, because it's also my problem. 

And I thank you very much for that good sir.

> I think I
> won't do it if it's something I don't use. (e.g. MD) I like fai. I like
> the community. I like to give back. It's just so fscking hard to
> understand what is going on and what is supposed to going on.
> It's no fun at all.
>
> bye
> thomas, feeling better now

And now for some more test coverage ...

With your patches, an initial install of the attached MD_RAID1 + LVM 
disk_config works, but a subsequent preserve_reinstall (without initial 
flag) fails with a non-zero return code from "Executing: mdadm --stop 
--scan".  Full output is attached.

Actually, debug is pastebined here:
http://pastebin.com/Aje1tXF9

Might have something to do with the RAID not having finished rebuilding 
yet.

Thanks again,
Brian
-------------- next part --------------
# MD_RAID1
# 2009-06-01
# bpkroth
#
# This file is a disk_config file uses the setup-storage syntax to create an
# LVM'd machine disk layout that preserves partitions.  It is expected to be at
# least 30G.
#
# 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 align-at:1M
primary		-			224M		-	-
primary		-			30G-		-	-

disk_config disk2 disklabel:msdos bootable:1 fstabkey:uuid align-at:1M
primary		-			224M		-	-
primary		-			30G-		-	-

# Setup MD to RAID1 2 partitions - 1 for /boot, and 1 for LVM
disk_config raid fstabkey:device
# preserve_reinstall:1
raid1		/boot			disk1.1,disk2.1	ext3	defaults,rw,errors=panic createopts="-L boot" tuneopts="-c 90 -i 90d"
raid1		-			disk1.2,disk2.2	-	-

# 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 md1
disk_config	lvm fstabkey:device preserve_reinstall:vg-local.hd
vg-swap		swap			4G-8G		swap	sw createopts="-L swap"
vg-root		/			8G-12G		ext4	defaults,rw,errors=panic,relatime createopts="-L root" tuneopts="-c 90 -i 90d"
vg-var		/var			8G-12G		ext4	defaults,rw,errors=panic,relatime createopts="-L var" tuneopts="-c 90 -i 90d"
vg-local.hd	/local.hd		512M-75%	ext4	defaults,rw,errors=panic,nosuid,nodev,acl,user_xattr,relatime createopts="-L local.hd -m 1" tuneopts="-c 90 -i 90d"

-------------- next part --------------
Starting setup-storage 1.4
Using config file: /tmp/MD_RAID1
W: mdadm: using ARRAYs defined in existing mdadm.conf.
Executing: parted -s /dev/sda unit TiB print
Executing: parted -s /dev/sda unit B print free
Executing: parted -s /dev/sda unit chs print free
Executing: parted -s /dev/sdb unit TiB print
Executing: parted -s /dev/sdb unit B print free
Executing: parted -s /dev/sdb unit chs print free
    Finding all volume groups
    Finding volume group "vg"
    Finding all volume groups
    Finding volume group "vg"
    Finding all volume groups
    Finding volume group "vg"
    Finding all volume groups
    Finding volume group "vg"
Executing: mdadm --examine --scan --verbose -c partitions
Preserved partition /dev/sdb2 does not end at a cylinder boundary, parted may fail to restore the partition!
Preserved partition /dev/sda2 does not end at a cylinder boundary, parted may fail to restore the partition!
/dev/sdb2 will be preserved
/dev/sda2 will be preserved
vg/local.hd will be preserved
WARNING: command true requires self_cleared_local.hd (ignored)
WARNING: command true requires self_cleared_root (ignored)
WARNING: command true requires self_cleared_swap (ignored)
WARNING: command true requires self_cleared_var (ignored)
Executing: mdadm --stop --scan
Command had non-zero exit code
Prototype mismatch: sub Parse::RecDescent::namespace000001::dclone ($) vs none at /usr/share/perl5/Parse/RecDescent.pm line 1984 during global destruction.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20120827/03e46087/attachment.bin>


More information about the linux-fai mailing list