LVM mirror

2023-03-21 Diskussionsfäden Henning Fehrmann
Hello,

we intend to install the OS on a LVM which is put on top of two mirrored
physical devices without using mdadm. We use FAI v 5.10.3.

The standard disk_config:

```
disk_config disk1 disklabel:gpt-bios fstabkey:uuid
primary - 1- -   -

disk_config disk2 sameas:disk1

disk_config lvm

vg os disk1.1
os-root   /  30G-xfsdefaults
```

yields:

```
DRY-RUN pvcreate -ff -y  /dev/sda1
DRY-RUN vgcreate  os  /dev/sda1
DRY-RUN vgchange -a y os
DRY-RUN lvcreate  --yes -n root -L 59808.8540478516 os
```

I can attach a second disk for pvcreate with

vg os disk1.1 pvcreateopts="/dev/sdb1"

but this is already cheating since disk2.1 should be used instead.

There is no way to attach the second disk to vgcreate since any option appears
before the volume group name. E.g.:

vg os disk1.1 pvcreateopts="/dev/sdb1" vgcreateopts="/dev/sdb1"

leads to:

```
DRY-RUN pvcreate -ff -y /dev/sdb1 /dev/sda1
DRY-RUN vgcreate /dev/sdb1 os  /dev/sda1
```

which won't work.

I can't add lvcreateopts, e.g.:

vg os disk1.1 pvcreateopts="/dev/sdb1" vgcreateopts="/dev/sdb1" 
lvcreateopts="--type raid1 -m 1"

gives:
  ERROR (line 12): Invalid line: Was expecting '\n' but found "vg os
   disk1.1 pvcreateopts="/dev/sdb1"
   vgcreateopts="/dev/sdb1" lvcreateopts="--type raid 1 -m
   1"" instead


I haven't looked into the scripts, but seems that mirroring via LVM is not yet
included or have I missed something?

Should I create a hook to achieve this or should I better opt for a more recent
FAI version?

Thank you,
Henning


probably no grub-install in FAI installation

2010-12-09 Diskussionsfäden Henning Fehrmann
Hello,

we are currently testing a FAI-Squeeze installation and struggled with the 
grub2 installation. We are using the FAI-server v 3.4.5 and install the current 
Squeeze grub-ps package v 1.98+20100804-8.
After the installation the system does not boot from the hard drive. It turned
out that '/usr/sbin/grub-install' never has being called in the postinst script 
of the grub-pc package. 
A quick and dirty work around is a '$ROOTCMD grub-install' in a script or a hook
which is probably not meant to be the preferred way.

We added 'set -x' into the postinst script of the grub-pc package to increase 
the verbosity. 
The 'db_get grub-pc/install_devices' in line 494 does not set the RET variable
which avoids the next 'for' loop. So a grub-install is not being called. 

We are not sure, but probably an interactive debconf configuration is required 
at this point. 

Has anybody seen a similar symptom? Is there a clean way to solve this problem?


Thank you and cheers,
Henning



Here is the postinst output:


+ cached_available_ids=
+ case $1 in
+ . /usr/share/debconf/confmodule
++ '[' '!' '' ']'
++ PERL_DL_NONLAZY=1
++ export PERL_DL_NONLAZY
++ '[' '' ']'
++ exec /usr/share/debconf/frontend /var/lib/dpkg/info/grub-pc.postinst 
configure 1.98+20101209-1
+ cached_available_ids=
+ case $1 in
+ . /usr/share/debconf/confmodule
++ '[' '!' 1 ']'
++ '[' -z '' ']'
++ exec
++ '[' '' ']'
++ exec
++ DEBCONF_REDIR=1
++ export DEBCONF_REDIR
+ devicemap_regenerated=
+ egrep -q 
'^[[:space:]]*post(inst|rm)_hook[[:space:]]*=[[:space:]]*(/sbin/|/usr/sbin/)?update-grub'
 /etc/kernel-img.conf
+ case grub-pc in
+ mkdir -p /boot/grub
+ test -e /boot/grub/device.map
+ test -e /boot/grub/core.img
+ grub-mkdevicemap --no-floppy
+ devicemap_regenerated=1
+ test -z 1
++ mktemp -t grub.XX
+ tmp_default_grub=/tmp/grub.oj4eLAeOGT
+ trap 'rm -f /tmp/grub.oj4eLAeOGT' EXIT
+ cp -p /usr/share/grub/default/grub /tmp/grub.oj4eLAeOGT
+ merge_debconf_into_conf /tmp/grub.oj4eLAeOGT GRUB_CMDLINE_LINUX 
grub2/linux_cmdline
+ local tmpfile
+ tmpfile=/tmp/grub.oj4eLAeOGT
+ local setting
+ setting=GRUB_CMDLINE_LINUX
+ local template
+ template=grub2/linux_cmdline
+ db_get grub2/linux_cmdline
+ _db_cmd 'GET grub2/linux_cmdline'
+ IFS=' '
+ printf '%s\n' 'GET grub2/linux_cmdline'
+ IFS='
'
+ read -r _db_internal_line
+ RET=
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ local value
++ sed -e 's,[$`\...@],\\,g'
++ echo ''
+ value=
+ grep -q '^GRUB_CMDLINE_LINUX=' /tmp/grub.oj4eLAeOGT
+ sed -i -re 's...@^(GRUB_CMDLINE_LINUX=)@\1@' /tmp/grub.oj4eLAeOGT
+ merge_debconf_into_conf /tmp/grub.oj4eLAeOGT GRUB_CMDLINE_LINUX_DEFAULT 
grub2/linux_cmdline_default
+ local tmpfile
+ tmpfile=/tmp/grub.oj4eLAeOGT
+ local setting
+ setting=GRUB_CMDLINE_LINUX_DEFAULT
+ local template
+ template=grub2/linux_cmdline_default
+ db_get grub2/linux_cmdline_default
+ _db_cmd 'GET grub2/linux_cmdline_default'
+ IFS=' '
+ printf '%s\n' 'GET grub2/linux_cmdline_default'
+ IFS='
'
+ read -r _db_internal_line
+ RET=
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ local value
++ sed -e 's,[$`\...@],\\,g'
++ echo ''
+ value=
+ grep -q '^GRUB_CMDLINE_LINUX_DEFAULT=' /tmp/grub.oj4eLAeOGT
+ sed -i -re 's...@^(GRUB_CMDLINE_LINUX_DEFAULT=)@\1@' 
/tmp/grub.oj4eLAeOGT
+ ucf --three-way --debconf-ok --sum-file=/usr/share/grub/default/grub.md5sum 
/tmp/grub.oj4eLAeOGT /etc/default/grub
++ cut -d : -f 2
++ ucfq --with-colons /etc/default/grub
+ package=grub-pc
+ grep -q '^grub-'
+ echo grub-pc
+ ucfr --force grub-pc /etc/default/grub
+ case grub-pc in
+ fix_mixed_system=
+ test -e /boot/grub/stage2
+ test -e /boot/grub/stage2
+ question=grub-pc/install_devices
++ grep -v '^(fd[0-9]\+)'
++ grub-mkdevicemap -m -
+ device_map='(hd0) /dev/disk/by-id/ata-QEMU_HARDDISK_QM1'
++ cut -f2
++ echo '(hd0)  /dev/disk/by-id/ata-QEMU_HARDDISK_QM1'
+ devices=/dev/disk/by-id/ata-QEMU_HARDDISK_QM1
+ dpkg --compare-versions 1.98+20101209-1 lt 1.98+20100702-1
+ db_get grub-pc/install_devices
+ _db_cmd 'GET grub-pc/install_devices'
+ IFS=' '
+ printf '%s\n' 'GET grub-pc/install_devices'
+ IFS='
'
+ read -r _db_internal_line
+ RET=
+ case ${_db_internal_line%%[   ]*} in
+ return 0
+ valid=1
+ '[' 1 = 0 ']'
+ :
+ ids=
+ descriptions=
++ usable_partitions
++ local last_partition path partition partition_id
++ last_partition=
++ sort -t: -k2
++ for path in / /boot /boot/grub
+++ grub-probe -t device /
++ partition=/dev/sda2
++ '[' -z /dev/sda2 ']'
++ '[' /dev/sda2 = '' ']'
+++ device_to_id /dev/sda2
+++ local id
 available_ids
 local id path
 '[' '' ']'
 '[' -d /dev/disk/by-id ']'
+ cut '-d ' -f1
+ sort -k2 -s -u
+ for path in '/dev/disk/by-id/*'
+ '[' -e /dev/disk/by-id/ata-QEMU_HARDDISK_QM1 ']'
++ readlink -f /dev/disk/by-id/ata-QEMU_HARDDISK_QM1
+ printf '%s %s\n' /dev/disk/by-id/ata-QEMU_HARDDISK_QM1 /dev/sda
+ for path in '/dev/disk/by-id/*'
+ '[' -e /dev/disk/by-id/ata-QEMU_HARDDISK_QM1-part1 ']'
++ readlink 

running out of arp-cache

2009-04-21 Diskussionsfäden Henning Fehrmann
Hello,

On a regular running system we have been faced with the problem that
we went out of the arp-cache. This was solved by adding
net.ipv4.neigh.default.gc_thresh1(2,3)=...
lines in the /etc/sysctl.conf. 

The same thing happen now during the FAI installation.
I am not really sure at which point we should increase the arp cache.

The best, in my opinion, would be to do it right in the beginning.

Do you know the right kernel boot parameter to manipulate the arp cache?

If this is not possible, one should do it in the live-initrd or, latest,
in the nfs-chroot environment. Currently, I am not sure whether one runs into
problems already in the initrd.  
Is there a generic way to add a proper
/etc/sysctl.conf in the initrd or in the NFS-chroot, configured
somewhere in the make-fai-nfsroot.conf? 


Thank you,
Henning


Re: live-initramfs

2009-01-14 Diskussionsfäden Henning Fehrmann
On Thu, Jan 08, 2009 at 07:43:23PM +0100, Thomas Lange wrote:
  On Thu, 8 Jan 2009 19:36:35 +0100, Henning Fehrmann 
  henning.fehrm...@aei.mpg.de said:
 
  I guess, a proper initrd has to come already with the kernel.
 not really, because dpkg-reconfigure linux-image... should be called,
 which creates the initrd.

Ok, I am stepping forward. In fact, the aufs module has been
missing. Sorry, my fault. 
Actually, compiling the aufs modules is not really straight
forward since one needs the right combination of aufs sources and
kernel sources. I took the debian patched 2.6.26 kernel sources and  
the 0+20080719-4 aufs source.

make-fai-nfsroot is finishing without error messages. There have been
some warning about the md issues which are not important for us right
now.


The client boots, reads the initrd and ends up in the a-shell with the
following message:

Gave up waiting for root device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
   - Check root= (did the system wait for the right device?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT! /dev/nfs does not exist. Dropping to a shell!

The nic is up and running:

(initramfs) ifconfig eth1
eth1  Link encap:Ethernet  HWaddr 
  inet addr:10.10.16.79  Bcast:10.255.255.255  Mask:255.0.0.0
  UP BROADCAST RUNNING MULTICAST  MTU:9000  Metric:1
  RX packets:6152 errors:0 dropped:0 overruns:0 frame:0
  TX packets:13 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:1000 
  RX bytes:456240 (445.5 KiB)  TX bytes:1746 (1.7 KiB)
  Memory:ee20-ee22 


(initramfs) ping -c 1  10.10.16.78
PING 10.10.16.78 (10.10.16.78): 56 data bytes
64 bytes from 10.10.16.78: seq=0 ttl=64 time=0.099 ms

--- 10.10.16.78 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 0.099/0.099/0.099 ms
(initramfs) mount -t nfs 10.10.16.78:/srv/fai/nfsroot/live/filesystem.dir /root
mount: mounting 10.10.16.78:/srv/fai/nfsroot/live/filesystem.dir on /root 
failed: Invalid argument


NFS support is compiled into the kernel.

I would guess the problem is the missing /deb/nfs in the intrd.
If I omit the initrd the nfs-export is being mounted in the installation 
environment, but unfortunately, readonly.

Any hints?

Thank you,
Henning Fehrmann


live-initramfs

2009-01-08 Diskussionsfäden Henning Fehrmann

Hello,


I installed the fai-server version 3.2.15.
Running make-fai-nfsroot I get the following message:

Removing `local diversion of /usr/sbin/update-initramfs to 
/usr/sbin/update-initramfs.distrib'
`/srv/fai/nfsroot/live/filesystem.dir/boot/vmlinuz-2.6.27.10-faiinstall' - 
`/srv/tftp/fai/vmlinuz-2.6.27.10-faiinstall'
cp: cannot stat `/srv/fai/nfsroot/live/filesystem.dir/boot/initrd.img-*': No 
such file or directory

ERROR: No initrd installed.




In the /etc/fai/NFSROOT I included

PACKAGES aptitude
:
live-initramfs
linux-image-2.6.27.10-faiinstall
:


I guess, a proper initrd has to come already with the kernel.

Creating the initrd for the kernel, do I need to use the live-initramfs hook?
I am using the kernel-package tools. I would expect to get a initrd using 
make-kpkg --revision ... kernel-image --initrd 
which does not work, also I can create it directly with mkinitramfs.

do_initrd = Yes 
is already in /etc/kernel-img.conf

Either something is missing in the /etc/kernel-img.conf or in  
/etc/initramfs-tools or somewhere else.

Can somebody write a short recipe describing the way how to get the right 
initrd for the fai installation?
Well, at least, I need to make the filesystem on the clients writable.

Thank you
Henning Fehrmann  


Re: problem install client with multiple interfaces

2008-10-01 Diskussionsfäden Henning Fehrmann
On Tue, Sep 30, 2008 at 06:18:48PM +0200, Jeken Jeken wrote:
 Hi,
 I having problem install Lenny on a Dell R200.
 I pxe boot using one of the interfaces on the moderboard.
 It works fine but the kernel detects one of the ports on my quadcard as eth0.
 So the installation hangs waiting for dhcp on the wrong interface.
 One solution is to use two ethernetcables, but..
 
 Is it possible to have the kernel looking for an interface having
 link and then start the dhcpclient on that interface.
 
 
 
 I'm using the latest FAI on a Lenny server.
 
 pxelinux.cfg:
 label fai-lenny
  kernel fai/lenny/vmlinuz
  append initrd=fai/lenny/initrd ip=dhcp  root=/dev/nfs
 nfsroot=/srv/fai/nfsroot-lenny boot=live
 FAI_FLAGS=verbose,sshd,createvt,reboot FAI_ACTION=install

Try 
  
 append initrd=fai/lenny/initrd ip=:ethx:dhcp  root=/dev/nfs
 nfsroot=/srv/fai/nfsroot-lenny boot=live
 FAI_FLAGS=verbose,sshd,createvt,reboot FAI_ACTION=install

Where ethx is your preferred interface. Make sure that the kernel
supports the motherboard NICs. 

Cheers,
Henning Fehrmann


umount /var/lib/fai/config

2008-07-18 Diskussionsfäden Henning Fehrmann
Hi all,

after a succsessgul 'fai softupdate' /var/lib/fai/config is still
mounted.
Currently, we are using the fai-client version 3.1.8.
Has this bug already been fixed in newer versions?

Cheers,
Henning Fehrmann

-- 
Dr. Henning Fehrmann - Max Planck Institute for Gravitational Physics
Callinstrasse 38, 30167 Hannover, Germany
Phone/Fax: +49 511 762-17135 / -17193
http://www.top500.org/system/9234 | http://www.top500.org/connfam/6/list/31


Re: BIOS

2007-08-16 Diskussionsfäden Henning Fehrmann
Hello,
 
 This IMHO could be done without touching a real disk's MBR using a file 
 (untested).

Copying the MBR was basically the first method which worked.
According to the docu of memdisk, if you want to use arbitrary image
sizes, it has to be hd image with mbr and partition table.

 
 IIRC loopback mount has an option to skip to an offset inside the image... 
 man mount

Works fine, thanx.
mount  -o loop,blocksize=512,offset=32256 hd.img /mnt/dos

  
  * WATT-32 (TCP/IP stack for DOS) http://www.bgnett.no/~giva/ 
 
 Is there a binary version I have missed when I last looked?

We just build every thing from scratch. I guess this is the standard
tcp/ip stack used for freedos.

  * card driverhttp://www.georgpotthast.de/sioux/packet.htm
 
 You might also use the UNDI driver that sits on top of the PXE in the card's 
 firmware.
I will take a look.

 Of course that's a more elegant solution than having a fake TFTP request 
 which would
 trigger an action on the server side. Why didn't you go for a simple rsh 
 instead, which
 is already a prerequisite for FAI (writeback of install logs)?
 
Unfortunately, the only rsh version I found was from drdos and not free.
 
 If you don't mind I'd like to have a look at your image.
 I'd suggest to have 
 an interface to the possible tasks as clean as possible so that changes to
 the payload have to be done in only one place (our vendor for example uses
 a zip file that contains the payload, which is unpacked into a ramdisk, and
 it's setup.bat is started - this way the autoexec.bat stays unmodified if
 you replace the payload) - KISS :-)
 (My images are in CVS, faiconfig/files/boot/fai/floppy-images/)

Of course, but I will not attach it to this email, since it is compressed 13MB.
If it is in good shape (without a private sshkey), I will put it on a server 
and make a deb package
out of it. Is somebody of the FAI developer team interested?

Regards
Henning