Diagnostics from setup-storage

2010-12-08 Diskussionsfäden Toomas Tamm
Hello!

I tried installation of a multi-disk host with the latest experimental
(version 45). With correct disk configuration file, everything works as
expected. My thanks to Michael and everyone else for great work!

However, before I got to the error-free state, I went through several
incorrect ones and noticed that the diagnostics provided by
setup-storage were not too helpful, and in one case, outright wrong.

First, the final (correct) disk configuration file:

--- snip -
disk_config hda bootable:1
logical  /   1GiB   ext3  rw,relatime,errors=remount-ro   createopts="-c -j"
logical  /var   10GiB   ext3  rw,relatime createopts="-m 5 
-j"
logical  /tmp1GiB   ext3  rw  createopts="-m 0 
-j"
logical  /usr   10GiB   ext3  rw,relatime createopts="-j"
primary  swap2GiB   swap  sw
primary  /home  10GiB   ext3  rw,relatime,nosuid,nodevcreateopts="-m 1 
-j"
primary  /wrk   10GiB-  ext3  rw,relatime,nosuid,nodevcreateopts="-m 1 
-j"

disk_config sda preserve_always:all
primary /storage   100% ext3  rw,relatime,nosuid,nodev,noexec

disk_config sdb preserve_always:all
primary /st_backup 100% ext3  rw,relatime,nosuid,nodev,noexec
--- snip -

Next, the two errors I made initally and the provided diagnostics:

First, I had an unnecessary space between "rw," and "relatime" in the
sda and sdb layouts, like this:
primary /storage   100% ext3  rw, relatime,nosuid,nodev,noexec

The only diagnostic provided by setup-storage was "Syntax error". I
would have expected at least a line number, and possibly the column,
where the parser hit the error. Without that, the error was not trivial
to locate.

Second, in my inital version I had duplicate configuration for disk sda
(ie the /st_backup disk was also called "sda"):
disk_config sda preserve_always:all
primary /st_backup 100% ext3  rw,relatime,nosuid,nodev,noexec

The diagnostic from setup-storage was:
Use of uninitialized value $1 in subtraction (-) at 
/usr/share/fai/setup-storage//Parser.pm line 130, <$config_file> line 1.
Duplicate configuration for disk sdb

I see two issues here:
1) the first error is a perl message, not a setup-storage message
2) it complains about sdb being duplicate, while in reality it is sda.
With more complicated multi-disk systems this can be quite confusing.

Best wishes,

Toomas Tamm



Re: what's the correct way to declare LVM on entire disk ?

2010-12-08 Diskussionsfäden Mathieu Alorent
Hi Michael,

Le lundi 06 décembre 2010 à 13:34 +0100, Mathieu Alorent a écrit :
> > Your second attempt *without* the disk_config disk2 line would be "correct" 
> > -
> > but it seems that setup-storage is not. Could you just give that another try
> > as explained above to see the behaviour is consistent at least? I'll 
> > meanwhile
> > try to figure out what's going wrong. Oh, yes, and as always: debug logs are
> > most welcome :-)
> 
> With "sdb", I get "same" error:
> 
> Starting setup-storage 1.3+exp
> Using config file: /var/lib/fai/config/disk_config/PPC_BACK
> 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
> Parted could not read a disk label (new disk?)
> Could not determine size and contents of /dev/sdb, skipping
> Finding all volume groups
> Executing: mdadm --examine --scan --verbose -c partitions
> /dev/sdb is not a valid block device
> 
> Please find debug logs attached. 

Please let me know if you need more info... :)

Regards
Mât



setup-storage fails when preserving LVM volume

2010-12-08 Diskussionsfäden Nicolas Courtel

Hello,

When installing in Squeeze a host which was in Lenny, I want to preserve 
user data, using a setup-storage config that has worked with an older 
version of FAI (well, I'm not so sure, let's say it might have work some 
day...); the result is the same with 3.4.4, 3.4.5, and 4.0experimental45 :


disk_config disk1
primary/boot 512ext3rw
primary-   32000---

disk_config lvm fstabkey:uuid preserve_lazy:vg0-local
vg vg0 disk1.2
vg0-swapswap2GiBswapsw
vg0-root/   1GiBext3rw
vg0-var /var4GiBext3rw
vg0-usr /usr8GiBext3rw
vg0-opt /opt2GiBext3rw
vg0-local   /local 20GiBext3rw

On an empty disk, this disk config works fine. But when the volumes 
already exist, it does preserve vg0-local as expected, but after having 
correctly built all the volumes setup-storage tries to set a label on 
the disk; it fails miserably, and removes all the disk's partitions . 
There are a couple of other errors in the debug log, too, that might be 
related to the problem:


[...]
Use of uninitialized value $p in concatenation (.) or string at 
/usr/share/fai/setup-storage//Init.pm line 289.

/dev/sda2 will be preserved
vg0/local will be preserved
[...]
(CMD) parted -s /dev/sda mklabel msdos 1> /tmp/A_p3dpsLFC 2> /tmp/ZQLJLH5omp
Executing: parted -s /dev/sda mklabel msdos
Command had non-zero exit code
(STDOUT) Error: Partition(s) 2 on /dev/sda have been written, but we 
have been unable to inform the kernel of the change, probably because 
it/they are in use.  As a result, the old partition(s) will remain in 
use.  You should reboot now before making further changes.


I have tried to replace disk1 by sda, preserve_lazy by 
preserve_reinstall, but the result is always the same.


The full log is there: http://paste.debian.net/101879/

--
Nicolas


Re: creating a chroot or virtualization environment

2010-12-08 Diskussionsfäden mamadou diop
Hi Michael,

I have set in /etc/fai/fai.conf FAI_CONFIG_SRC to
nfs://10.10.1.200$FAI_CONFIGDIR
and created
the directories /var/lib/fai/config/ and there are some evolutions. Here's
the output:


r...@faiserver:/# fai -c FAIBASE DHCPC DEMO -v -u faichroot dirinstall
/test-chroot/

 -

   Fully Automatic Installation  -  FAI





   FAI 3.2.4+svn4837-0ubuntu2, 01 Apr 2008  Copyright (c)
1999-2007

   Thomas Lange  

 -



Using configuration files from /etc/fai

Calling task_confdir

FAI_FLAGS:

mount.nfs: /var/lib/fai/config is busy or already mounted

ln: création d'un lien symbolique `/var/run/fai/current_config': Aucun
fichier ou dossier de ce type

No monitor daemon defined.

Calling task_setup

FAI_FLAGS:

Calling task_defclass

List of all classes:  FAIBASE

Calling task_defvar

Executing FAIBASE.var

++ FAI_ALLOW_UNSIGNED=1

++ CONSOLEFONT=

++ UTC=yes

++ TIMEZONE=Europe/Berlin

++ ROOTPW='$1$kBnWcO.E$djxB128U7dMkrltJHPf6d1'

++ MODULESLIST='usbkbd ehci-hcd ohci-hcd uhci-hcd usbhid psmouse'

++ STOP_ON_ERROR=700

Calling task_action

FAI_ACTION: DHCPC

ERROR: User defined action /var/lib/fai/config/hooks/DHCPC not found.

End of /usr/sbin/fai



2010/12/6 Michael Tautschnig 

> > Hi Thomas,
> >
> > I was trying to create a chroot with fai. Please, help me by looking at
> this
> > output:
> >
> > r...@faiserver:~# fai -c FAIBASE DHCPC DEMO -v -u faichroot dirinstall
> > /test-chroot/
> >  -
> >Fully Automatic Installation  -  FAI
> >
> >FAI 3.2.4+svn4837-0ubuntu2, 01 Apr 2008  Copyright (c)
> > 1999-2007
> >Thomas Lange  
> >  -
> >
> > Using configuration files from /etc/fai
> > Calling task_confdir
> > FAI_FLAGS:
> > Error: Provide the URL to obtain the fai config storage in
> $FAI_CONFIG_SRC
> > Problems accessing the config space.
> >
>
> [...]
>
> Fix this /etc/fai/fai.conf.
>
> Hope this helps,
> Michael
>
>


Re: creating a chroot or virtualization environment

2010-12-08 Diskussionsfäden Thomas Lange
> On Wed, 8 Dec 2010 18:28:33 +, mamadou diop  
> said:

> r...@faiserver:/# fai -c FAIBASE DHCPC DEMO -v -u faichroot dirinstall
> /test-chroot/
You must seperate the classes with a comma. This should work.
fai -c FAIBASE,DHCPC,DEMO -v -u faichroot dirinstall /test-chroot
-- 
regards Thomas