problems with ignoring a lvm on secondary disk.
Hi, we try to install a debian system on a bunch of servers with different disk layouts. Some machines only have one disk, some have additional disks, which leads to a strange issue. During install we like fai to ignore all additional disks and lvm's and whatever is on disks besides sda. Our disk setup is: disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid primary / 80%-100%ext4rw,noatime,errors=remount-ro primary swap200-1000swaprw Now the problem is, that when users have setup a lvm on disk sdb fai detects this lvm, at first seems to ignore it, but later tries to create that exact lvm again on the system, although its not configured anywhere. A debugging log is attached. The question is: bug or misconfiguration? Florian Starting setup-storage 1.3 disklist was: sda sdb Using config file: /var/lib/fai/config/disk_config/RLBASE Input was: # # type mountpoint size fs type mount options misc options disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid primary / 80%-100% ext4 rw,noatime,errors=remount-ro primary swap 200-1000 swap rw (CMD) parted -s /dev/sda unit TiB print 1 /tmp/9jfIKSyTW7 2 /tmp/dxphs1V5M1 Executing: parted -s /dev/sda unit TiB print (STDOUT) Model: ATA ST3500641AS (scsi) (STDOUT) Disk /dev/sda: 0.45TiB (STDOUT) Sector size (logical/physical): 512B/512B (STDOUT) Partition Table: msdos (STDOUT) (STDOUT) Number Start End Size Type File system Flags (STDOUT) (CMD) parted -s /dev/sda unit B print free 1 /tmp/k7jeOlJzjN 2 /tmp/UWhBXhXMTi Executing: parted -s /dev/sda unit B print free (STDOUT) Model: ATA ST3500641AS (scsi) (STDOUT) Disk /dev/sda: 500107862016B (STDOUT) Sector size (logical/physical): 512B/512B (STDOUT) Partition Table: msdos (STDOUT) (STDOUT) Number Start EndSize Type File system Flags (STDOUT) 32256B 500107862015B 500107829760BFree Space (STDOUT) (CMD) parted -s /dev/sda unit chs print free 1 /tmp/meDq08B1ob 2 /tmp/L1LGbj7K3G Executing: parted -s /dev/sda unit chs print free (STDOUT) Model: ATA ST3500641AS (scsi) (STDOUT) Disk /dev/sda: 60801,80,62 (STDOUT) Sector size (logical/physical): 512B/512B (STDOUT) BIOS cylinder,head,sector geometry: 60801,255,63. Each cylinder is 8225kB. (STDOUT) Partition Table: msdos (STDOUT) (STDOUT) Number Start End Type File system Flags (STDOUT) 0,1,0 60801,80,62Free Space (STDOUT) Creating directory /tmp/lvm/lock Finding all volume groups Finding volume group vboxspace Creating directory /etc/lvm/archive Archiving volume group vboxspace metadata (seqno 4). Creating directory /etc/lvm/backup Creating volume group backup /etc/lvm/backup/vboxspace (seqno 4). Finding all volume groups Finding volume group vboxspace Finding all volume groups Finding volume group vboxspace Finding all volume groups Finding volume group vboxspace (CMD) mdadm --examine --scan --verbose -c partitions 1 /tmp/6NnNC23EVQ 2 /tmp/E_1z3xjgRh Executing: mdadm --examine --scan --verbose -c partitions Current disk layout $VAR1 = { '/dev/sda' = { 'bios_heads' = '255', 'disklabel' = 'msdos', 'partitions' = {}, 'bios_cylinders' = '60801', 'size' = '500107862016', 'sector_size' = '512', 'begin_byte' = 0, 'end_byte' = '500107862015', 'bios_sectors_per_track' = '63' } }; Current LVM layout $VAR1 = { 'vboxspace' = { 'volumes' = { 'images' = { 'size' = '40960' }, 'bender' = { 'size' = '20480' } }, 'physical_volumes' = [ '/dev/sdb1' ], 'size' = '476938.24' } }; Current RAID layout $VAR1 = {}; Desired disk layout $VAR1 = { 'PHY_/dev/sda' = { 'preserveparts' = 0, 'disklabel' = 'msdos', 'partitions' = { '1' = { 'journal_dev' = undef, 'encrypt' = 0, 'start_byte' = 32256, 'number' = 1,
Direct FAI to install medium..?
Hello everyone, I have a FAI usb stick that installs my machines. It installs the machine, and then copies itself onto a recovery partition. This is used to re-install the machine in case of errors. This all works fine. The problem is: sometimes I update my USB stick, and I want to do a clean re-install of the machine (and in the process: update the recovery partition). But, when I boot from the USB stick, FAI detects my recovery partition BEFORE it detects my USB stick, and thus mounts my recovery partition. Then, FAI happily installs, but does this from the (older version) recovery partition. I can circumvent this by logging in to the machine, use fdisk to destroy the recovery partition, and then install from USB stick. But this is manual work. Is there a way to say to FAI that it should check for USB sticks before checking the harddisk partitions? With kind regards, Jurrie smime.p7s Description: S/MIME cryptografische ondertekening
Re: problems with ignoring a lvm on secondary disk.
Hi Florian, [...] Now the problem is, that when users have setup a lvm on disk sdb fai detects this lvm, at first seems to ignore it, but later tries to create that exact lvm again on the system, although its not configured anywhere. A debugging log is attached. The question is: bug or misconfiguration? [...] Thanks a lot for providing such detailed information. This is definitively a bug; yet I wonder which version of FAI you might be using? Looking at your debug log, this trace cannot be produced by setup-storage from 3.4.8, unless I'm missing something. May I ask you to re-run this installation using 3.4.8? Thanks a lot, Michael pgp56Tc3ASVax.pgp Description: PGP signature
Re: Direct FAI to install medium..?
Hi Jurrie, [...] Is there a way to say to FAI that it should check for USB sticks before checking the harddisk partitions? I'm not sure I understand what sort of detection routine within FAI this could refer to. Isn't it your BIOS/EFI that chooses the boot media? Wouldn't a change in boot order suffice here? Thanks a lot, Michael pgpn4RkX07ufM.pgp Description: PGP signature
Re: Direct FAI to install medium..?
Op 2-9-2011 10:36, Michael Tautschnig schreef: Hi Jurrie, [...] Is there a way to say to FAI that it should check for USB sticks before checking the harddisk partitions? I'm not sure I understand what sort of detection routine within FAI this could refer to. Isn't it your BIOS/EFI that chooses the boot media? Wouldn't a change in boot order suffice here? Sorry, I think I wasn't clear enough :) The machine actually boots from USB the second time. FAI loads from USB stick (I can tell: the stick is blinking, and booting is slower than from HD). At first, the Linux kernel is loaded, and then initrd I think... Then, FAI (or is it the Linux kernel?) needs to find out where its files and scripts are, so it can install and run them. At that point, I want it to find the USB stick and mount it. But instead, it finds the recovery partition and mounts that. With kind regards, Jurrie smime.p7s Description: S/MIME cryptografische ondertekening
Re: Direct FAI to install medium..?
Hi again, [...] The machine actually boots from USB the second time. FAI loads from USB stick (I can tell: the stick is blinking, and booting is slower than from HD). At first, the Linux kernel is loaded, and then initrd I think... Then, FAI (or is it the Linux kernel?) needs to find out where its files and scripts are, so it can install and run them. At that point, I want it to find the USB stick and mount it. But instead, it finds the recovery partition and mounts that. Hmm, FAI doesn't try to be smart in any way - it shouldn't find anything, it will only use whatever was configured. Let's see which files could possibly be concerned: - The boot loader. Hopefully the one from USB. - The kernel and its initrd. Apparently the one from the USB stick is used. - The root file system and the main FAI scripts. The boot loader configuration (kernel options) will fix the root file system to be used. Should be taken from your USB stick as well (just check which FAI version is shown in the FAI logo). - The config space. Configured in your fai.conf. It would be really helpful if you could figure out which bits are taken from your recovery partition, possibly by modifying some of the files on there to print debug output. Hope this helps, Michael pgpTiiCAw6AKe.pgp Description: PGP signature
off-topic: FAI is too smart (Re: Direct FAI to install medium..?)
On Fri, 2 Sep 2011, Michael Tautschnig wrote: Hmm, FAI doesn't try to be smart in any way - it shouldn't find anything, it will only use whatever was configured. When fai-setup-storage detects any old MDADM Softraid Partitions, it tries to assemble/start them even when Sofraid is not configured. That is the reason why we wrote partition.DEFAULT which cleans the harddisks: dd if=/dev/zero of=/dev/sda count=1 bs=512 I would also prefer if fai-setup-storage would not be too smart ;-)
Re: problems with ignoring a lvm on secondary disk.
Hi Michael, Am 02.09.2011 10:33 schrieb Michael Tautschnig: [...] Thanks a lot for providing such detailed information. This is definitively a bug; yet I wonder which version of FAI you might be using? Looking at your debug log, this trace cannot be produced by setup-storage from 3.4.8, unless I'm missing something. May I ask you to re-run this installation using 3.4.8? It is FAI 3.4.7, 24 Dec 2010. Copyright (C) 1999-2009 Thomas Lange provided by debian version 6.0.1 (squeeze). There don't seem to be any newer packages available yet in the debian repos. I'll see if we can update next week -.- Do you think it is possible to only update setup-storage? /Florian
Re: problems with ignoring a lvm on secondary disk.
Hi, [...] Do you think it is possible to only update setup-storage? Yes, in this particular case it should be safe to take the fai-setup-storage package from 3.4.8 and install it in the NFSROOT. Best, Michael pgpqgTKBj5Npz.pgp Description: PGP signature
Re: Disk_config lens for Augeas
Hi, [...] This mail is to inform you that a new lens for FAI disk_config files was added to Augeas. It can currently be found in the git repository of the Augeas project [1]. This lens will turn disk_config files into a tree that can be parsed with xpath using Augeas. [...] Thanks a lot for this nice work! [...] Bug reports, suggestions, patches are all welcome. I'd have two suggestions, yes: - You should probably use http://wiki.fai-project.org/wiki/Setup-storage as a more permanent URL. - Yet I'm afraid the information on the wiki is partly outdated. The most up-to-date information is in the man page of setup-storage. If you find the time to check consistency of the grammars that would be awesome. Thanks a lot, Michael pgpQqEdncMHdL.pgp Description: PGP signature
Re: Disk_config lens for Augeas
On Fri, Sep 2, 2011 at 2:24 PM, Michael Tautschnig m...@debian.org wrote: Hi, [...] This mail is to inform you that a new lens for FAI disk_config files was added to Augeas. It can currently be found in the git repository of the Augeas project [1]. This lens will turn disk_config files into a tree that can be parsed with xpath using Augeas. [...] Thanks a lot for this nice work! [...] Bug reports, suggestions, patches are all welcome. I'd have two suggestions, yes: - You should probably use http://wiki.fai-project.org/wiki/Setup-storageas a more permanent URL. This URL is only put in my email as an example of what the lens can do. It is not actually used anywhere in the code. - Yet I'm afraid the information on the wiki is partly outdated. The most up-to-date information is in the man page of setup-storage. If you find the time to check consistency of the grammars that would be awesome. I have noticed that the schema on the wiki is outdated, and sometimes not functional even. With the lens in the current state, I've been able to successfully parse 477 disk_config files we use in production. I'd be happy to get more tricky cases to test if you wish to send some to me. Raphaël
Re: Disk_config lens for Augeas
Hi again, [...] I have noticed that the schema on the wiki is outdated, and sometimes not functional even. With the lens in the current state, I've been able to successfully parse 477 disk_config files we use in production. I'd be happy to get more tricky cases to test if you wish to send some to me. I think the following three examples should be of such nature: Config 1: disk_config disk1 bootable:1 preserve_always:all always_format:5,6,7,8,9,10,11 primary - 0 - - primary - 0 - - logical / 0 ext3 rw,relatime,errors=remount-ro createopts=-c -j logical swap 0 swap sw logical /var 0 ext3 rw,relatime createopts=-m 5 -j logical /tmp 0 ext3 rw createopts=-m 0 -j logical /usr 0 ext3 rw,relatime createopts=-j logical /home 0 ext3 rw,relatime,nosuid,nodevcreateopts=-m 1 -j logical /wrk 0 ext3 rw,relatime,nosuid,nodevcreateopts=-m 1 -j logical /transfer 0 vfat rw Config 2: disk_config /dev/sda primary - 250M - - primary - 20G - - logical - 8G- - logical - 4G- - logical - 5G- - disk_config /dev/sdb sameas:/dev/sda disk_config raid raid1 /boot sda1,sdb1 ext3 defaults raid1 / sda2,sdb2 ext3 defaults,errors=remount-ro raid1 swap sda5,sdb5 swap defaults raid1 /tmp sda6,sdb6 ext3 defaults createopts=-m 1 raid1 /var sda7,sdb7 ext3 defaults Config 3: disk_config /dev/sdb primary / 21750 ext3 defaults,errors=remount-ro primary /boot 250ext3 defaults logical - 4000 - - logical - 2000 - - logical - 10-- - disk_config cryptsetup randinit swap swap /dev/sdb5 swap defaults tmp /tmp /dev/sdb6 ext2 defaults luks /local00 /dev/sdb7 ext3 defaults,errors=remount-ro createopts=-m 0 Thanks again for your work, Michael pgpVUs3UR1q4z.pgp Description: PGP signature
Re: shorten dmesg.log
Hi, Would you mind taking a look at the logtail patch that's been sitting in experimental for almost forever already? I don't see how this can possibly work on something like the kernel message buffer. Its contents will rotate once it runs full so the offset noted by logtail will no longer be correct. I think the only way of handling that is putting a marker into the buffer that will also rotate. (In case it rotates out, we take everything we can get, which is just what would be done now.) Please note that my patch relies on /var/log/kern.log instead of dmesg, hence no ring buffer here. But I might be missing something else. Best, Michael pgp7LMkupIVMl.pgp Description: PGP signature