Hello,

I have encountered a problem with setup-storage which occurs only when
the disk is blank, i.e. wiped with nwipe/dban or brand new. It then
fails on creating the LVM; running 'pvcreate' returns 'cannot open
/dev/sda5 exclusively'. I have attached the fai.log with all the details.
When I reboot the machine, which now has a partition table in place,
everything works fine. Same for reinstalling machines which were already
installed with earlier versions of FAI.
I can't exactly tell which FAI version we had in use when we last set up
a brand new machine - might be 5.3, might be even earlier, so the error
may already exist for a while.

Thanks,
Andreas
             -------------------------------------------------
                   Fully Automatic Installation  -  FAI

                   5.5   (c) 1999-2017
               Thomas Lange  <la...@informatik.uni-koeln.de>
             -------------------------------------------------

Calling task_confdir
Kernel currently running: Linux 4.9.0-4-amd64 x86_64 GNU/Linux
Kernel parameters: BOOT_IMAGE=vmlinuz-4.9.0-4-amd64 initrd=initrd.img-4.9.0-4-amd64 ip=dhcp root=/srv/fai/nfsroot rootovl FAI_FLAGS=verbose,createvt,sshd FAI_ACTION=install quiet FAI_CONFIG_SRC=nfs://***/srv/fai/config
Reading /tmp/fai/boot.log
FAI_FLAGS: verbose createvt sshd
Setting SERVER=***. Value extracted from FAI_CONFIG_SRC.
Can't connect to monserver on *** port 4711. Monitoring disabled.
FAI_CONFIG_SRC is set to nfs://***/srv/fai/config
Configuration space ***:/srv/fai/config mounted to /var/lib/fai/config
Source hook: setup.DEFAULT.sh
setup.DEFAULT.sh     OK.
Calling task_setup
FAI_FLAGS: verbose createvt sshd
 3 Jan 13:08:06 ntpdate[991]: step time server *** offset -0.064882 sec
Press ctrl-c to interrupt FAI and to get a shell
Starting FAI execution - 20180103_130806
Calling task_defclass
fai-class: Defining classes.
Executing /var/lib/fai/config/class/01-classes.
01-classes           OK.
Executing /var/lib/fai/config/class/10-base-classes.
10-base-classes      OK.
Executing /var/lib/fai/config/class/20-hwdetect.sh.
Loading kernel module mptspi
Loading kernel module dm-mod
Loading kernel module md-mod
Loading kernel module aes
Loading kernel module dm-crypt
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:00:27:5e:c0:3e brd ff:ff:ff:ff:ff:ff
    inet 172.16.9.236/24 brd 172.16.9.255 scope global eth0
    inet6 fe80::a00:27ff:fe5e:c03e/64 scope link 
New disklist: sda
20-hwdetect.sh       OK.
Executing /var/lib/fai/config/class/40-parse-profiles.sh.
40-parse-profiles.sh OK.
Executing /var/lib/fai/config/class/41-warning.sh.
41-warning.sh        OK.
Executing /var/lib/fai/config/class/50-host-classes.
50-host-classes      OK.
Executing /var/lib/fai/config/class/58-hardware.
58-hardware          OK.
Executing /var/lib/fai/config/class/60-misc.
60-misc              OK.
List of all classes:  DEFAULT LINUX AMD64 DHCPC PRECISE PRECISE_HOMI GERMAN FAICLIENT GRUB_PC ... LAST
Calling task_defvar
Executing PRECISE.var
++ FAI_ALLOW_UNSIGNED=1
++ CONSOLEFONT=
++ KEYMAP=us-latin1
++ UTC=yes
++ TIMEZONE=Europe/Berlin
++ ROOTPW=XXXXXXXXXXXXX
++ MODULESLIST='usbkbd ehci-hcd ohci-hcd uhci-hcd usbhid psmouse fuse'
++ SUDO_FORCE_REMOVE=yes
++ MAXPACKAGES=10000
++ UCF_FORCE_CONFFOLD=1
Executing GERMAN.var
++ KEYMAP=de-latin1-nodeadkeys
Defining variables from additional.var
++ disklist='sda '
Loading keymap(s) de-latin1-nodeadkeys ...done.
Calling task_action
FAI_ACTION: install
Performing FAI installation. All data may be overwritten!
Calling task_install
Calling task_partition
Starting setup-storage 2.1
Using config file: /var/lib/fai/config/disk_config/PRECISE
Parted could not read a disk label (new disk?)
Executing: parted -s /dev/sda mklabel msdos
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
    Creating directory "/run/lock/lvm"
    No volume groups found.
Executing: parted -s /dev/sda mklabel msdos
Executing: parted -s /dev/sda mkpart primary "ext3" 1048576B 315621375B
Executing: parted -s /dev/sda set 1 boot on
Executing: parted -s /dev/sda mkpart extended "" 315621376B 42949672959B
Executing: parted -s /dev/sda mkpart logical "" 316669952B 31380733951B
Executing: parted -s /dev/sda mkpart logical "ext3" 31381782528B 42949672959B
Executing: mkfs.ext4 -O ^64bit,^metadata_csum /dev/sda1
Executing: mkfs.ext4 -O ^64bit,^metadata_csum -L Daten /dev/sda6
Executing: parted -s /dev/sda set 5 lvm on
Executing: pvcreate -ff -y  /dev/sda5
(STDERR)   WARNING: Failed to connect to lvmetad. Falling back to device scanning.
(STDERR)   Can't open /dev/sda5 exclusively.  Mounted filesystem?
Command had non-zero exit code

This is your disk_config file:
# generic disk configuration for one small disk
# disk size from 500Mb up to what you can buy today
#
# <type> <mountpoint> <size in mb> <fstype> <mount options>  [extra options]

disk_config disk1 disklabel:msdos bootable:1 preserve_lazy:6 align-at:1M fstabkey:uuid 
primary  /boot	       300	ext4	rw	createopts="-O ^64bit,^metadata_csum"
logical  -	       29500-30000	-	-
logical  /media/daten  1024-	ext4	acl	createopts="-O ^64bit,^metadata_csum -L Daten"

disk_config lvm
vg vg1 disk1.5 
vg1-root  /            20480            ext4    rw,errors=remount-ro	createopts="-O ^64bit,^metadata_csum"
vg1-swap  -             2048           	- 	-
vg1-tmp   -             1024           	-	- 			createopts="-O ^64bit,^metadata_csum"
vg1-varlog  /var/log    1024            ext4    rw			createopts="-O ^64bit,^metadata_csum"


Error in task partition. Code: 710
Traceback: task_error task_partition task task_install task task_action task main
Source hook: savelog.LAST.sh
ERRORS found in log files. See /tmp/fai/error.log.
savelog.LAST.sh      OK.
Save log files via ssh to ...

Antwort per Email an