Package: fai-client
Version: 3.4.4
Severity: important

Hi,

We have been fighting with setup-storage lately to achieve a simple task: 
format part of a local disk while preserving the other part which contains a 
LVM group of its own (see attached disk_config below).
The problem is that, no matter what we set, we cannot get the volume group to 
stay intact while having the rest of the disk partionned.

Here is the disk_config we are using :

##################################### 
disk_config disk1 bootable:1 fstabkey:uuid preserve_lazy:3
primary /boot 512M ext4 rw,errors=remount-ro
primary - 52G - -
primary - 1G- - -

vg vg disk1.2 pvcreateopts="-ff -y"
disk_config lvm fstabkey:uuid
vg-swap swap 2048 swap sw
vg-root / 30G ext4 rw,errors=remount-ro
vg-var /var 1G- ext4 rw

vg extra disk1.3 pvcreateopts="-ff -y"
disk_config lvm fstabkey:uuid preserve_lazy:extra-local
extra-local /local 1G-100% ext4 rw
#####################################

When the disk is clean, everything gets done the way it should (ie. both 'vg' 
and 'extra' volume group are created).

Starting setup-storage 1.3
Using config file: /var/lib/fai/config/disk_config/inet-4
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
 Finding all volume groups
 No volume groups found
Executing: mdadm --examine --scan --verbose -c partitions
Executing: parted -s /dev/sda mklabel msdos
Executing: parted -s /dev/sda mklabel msdos
Executing: parted -s /dev/sda mkpart primary "ext3" 32256B 534643199B
Executing: parted -s /dev/sda mkpart primary "" 534643200B 56367843839B
Executing: parted -s /dev/sda mkpart primary "" 56367843840B 80031974399B
Executing: parted -s /dev/sda set 1 boot on
Executing: mkfs.ext4 /dev/sda1
Executing: parted -s /dev/sda set 3 lvm on
Executing: pvcreate -ff -y /dev/sda3
Executing: vgcreate extra /dev/sda3
Executing: vgchange -a y extra
Executing: lvcreate -n local -L 22342.1947998047 extra
Executing: mkfs.ext4 /dev/extra/local
Executing: parted -s /dev/sda set 2 lvm on
Executing: pvcreate -ff -y /dev/sda2
Executing: vgcreate vg /dev/sda2
Executing: vgchange -a y vg
Executing: lvcreate -n var -L 19946.2225585937 vg
Executing: mkfs.ext4 /dev/vg/var
Executing: lvcreate -n swap -L 2048 vg
Executing: mkswap /dev/vg/swap
Executing: lvcreate -n root -L 30720 vg
Executing: mkfs.ext4 /dev/vg/root
Executing: fai-vol_id -u /dev/extra/local
Executing: fai-vol_id -l /dev/extra/local
/dev/extra/local UUID=6bbde7a3-2943-44c7-9b1c-28df7ce96124
Executing: fai-vol_id -u /dev/sda1
Executing: fai-vol_id -l /dev/sda1
/dev/sda1 UUID=43922c62-6b68-4b65-ac01-f5dd54b9b13d
Executing: fai-vol_id -u /dev/vg/var
Executing: fai-vol_id -l /dev/vg/var
/dev/vg/var UUID=d4089c48-d3d9-451a-9555-f33a8fc9ea94
Executing: fai-vol_id -u /dev/vg/swap
Executing: fai-vol_id -l /dev/vg/swap
/dev/vg/swap UUID=b8fe18c0-4ecb-4b13-ac50-2986410fb23c
Executing: fai-vol_id -u /dev/vg/root
Executing: fai-vol_id -l /dev/vg/root
/dev/vg/root UUID=ac610a39-fab8-4bcf-850e-55a322884274

When 'extra' exists, things go differently: the disk cannot get its partition 
table written correctly because fai activates the 'extra' volume group before 
calling parted. parted fails because direct access to the /dev/sda device is 
locked.

Starting setup-storage 1.3
Using config file: /var/lib/fai/config/disk_config/inet-4
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
 Finding all volume groups
 Finding volume group "extra"
 Creating directory "/etc/lvm/archive"
 Archiving volume group "extra" metadata (seqno 2).
 Creating directory "/etc/lvm/backup"
 Creating volume group backup "/etc/lvm/backup/extra" (seqno 2).
 Finding volume group "vg"
 Archiving volume group "vg" metadata (seqno 4).
 Creating volume group backup "/etc/lvm/backup/vg" (seqno 4).
 Finding all volume groups
 Finding volume group "extra"
 Finding volume group "vg"
 Finding all volume groups
 Finding volume group "extra"
 Finding volume group "vg"
 Finding all volume groups
 Finding volume group "extra"
 Finding volume group "vg"
 Finding all volume groups
 Finding volume group "extra"
 Finding volume group "vg"
 Finding all volume groups
 Finding volume group "extra"
 Finding volume group "vg"
 Finding all volume groups
 Finding volume group "extra"
 Finding volume group "vg"
Executing: mdadm --examine --scan --verbose -c partitions
/dev/sda3 will be preserved
extra/local will be preserved
Executing: vgchange -a n
Executing: lvremove -f vg/var
Executing: lvremove -f vg/swap
Executing: lvremove -f vg/root
Executing: vgremove vg
Executing: pvremove /dev/sda2
Executing: vgchange -a y extra
Executing: parted -s /dev/sda mklabel msdos
Command had non-zero exit code

Executing the parted -s command outputs the following lines :
Error: Partition(s ) 3 on /dev/sda has been written, but we have been unable to 
inform the kernel of the change, probably because it/they are in use.
Can you please confirm this as a bug and not some kind of RTFM madness on my 
side ?

Thank you

Robert

-- System Information:
Debian Release: squeeze/sid
 APT prefers testing
 APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages fai-client depends on:
ii file 5.04-5 Determines file type using "magic"
ii iproute 20100519-3 networking and traffic control too
ii libapt-pkg-perl 0.1.24+b1 Perl interface to libapt-pkg
pn liblinux-lvm-perl <none> (no description available)
pn libparse-recdescent-perl <none> (no description available)
ii perl 5.10.1-16 Larry Wall's Practical Extraction 

Versions of packages fai-client recommends:
ii cfengine2 2.2.10-2 Tool for configuring and maintaini
ii debconf-utils 1.5.36 debconf utilities

Versions of packages fai-client suggests:
pn cryptsetup <none> (no description available)
ii dmsetup 2:1.02.48-4 The Linux Kernel Device Mapper use
pn ntfsprogs <none> (no description available)

Reply via email to