Package: fai-setup-storage Version: 4.3.3 Severity: Normal
Occasionally I run into a bug where the partition task of fai fails while creating the new partitions on the disk. On certain servers it seems to happen as often as 50% of the time I run an FAI install. The setup-storage routine seems to fail on this command: echo ,,,* | sfdisk --force /dev/sda -N1 And this command, when run manually, seems to exit non-zero roughly 50% of the time on that same server. It seems like a race condition based on this related bug report filed against sfdisk: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/942788 Is it possible fai-setup-storage could be modified to use the "--no-reread" option as the Ubuntu bug report suggests? When I incorporate that option into the fai-setup-storage Commands.pm it seems to succeed every time. I've included the log output of fai-setup-storage and the applicable lines from Commands.pm. Thanks! (CMD) mkfs.ext2 /dev/sda1 1> /tmp/0skLE1cjCR 2> /tmp/OllqnpGvpG Executing: mkfs.ext2 /dev/sda1 (STDERR) mke2fs 1.42.9 (4-Feb-2014) (STDOUT) Filesystem label= (STDOUT) OS type: Linux (STDOUT) Block size=4096 (log=2) (STDOUT) Fragment size=4096 (log=2) (STDOUT) Stride=0 blocks, Stripe width=0 blocks (STDOUT) 32768 inodes, 131072 blocks (STDOUT) 6553 blocks (5.00%) reserved for the super user (STDOUT) First data block=0 (STDOUT) Maximum filesystem blocks=134217728 (STDOUT) 4 block groups (STDOUT) 32768 blocks per group, 32768 fragments per group (STDOUT) 8192 inodes per group (STDOUT) Superblock backups stored on blocks: (STDOUT) 32768, 98304 (STDOUT) (STDOUT) Allocating group tables: done (STDOUT) Writing inode tables: done (STDOUT) Writing superblocks and filesystem accounting information: done (STDOUT) (CMD) parted -s /dev/sda set 2 lvm on 1> /tmp/FZ9KhUEZKF 2> /tmp/pg6DsckfiD Executing: parted -s /dev/sda set 2 lvm on (CMD) echo ,,,* | sfdisk --force /dev/sda -N1 1> /tmp/MCZtw4_hFu 2> /tmp/RPQUKmebO9 Executing: echo ,,,* | sfdisk --force /dev/sda -N1 Command had non-zero exit code (STDERR) Checking that no-one is using this disk right now ... (STDERR) OK (STDERR) start: (c,h,s) expected (0,0,2) found (0,0,1) (STDERR) Warning: given size (36405) exceeds max allowable size (36404) (STDERR) Warning: partition 1 does not end at a cylinder boundary (STDERR) BLKRRPART: Device or resource busy (STDERR) The command to re-read the partition table failed. (STDERR) Run partprobe(8), kpartx(8) or reboot your system now, (STDERR) before using mkfs (STDERR) If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) (STDERR) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (STDERR) (See fdisk(8).) (STDOUT) (STDOUT) Disk /dev/sda: 36404 cylinders, 255 heads, 63 sectors/track (STDOUT) Old situation: (STDOUT) Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 (STDOUT) (STDOUT) Device Boot Start End #cyls #blocks Id System (STDOUT) /dev/sda1 0+ 36404- 36405- 292421631+ ee GPT (STDOUT) /dev/sda2 0 - 0 0 0 Empty (STDOUT) /dev/sda3 0 - 0 0 0 Empty (STDOUT) /dev/sda4 0 - 0 0 0 Empty (STDOUT) New situation: (STDOUT) Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 (STDOUT) (STDOUT) Device Boot Start End #cyls #blocks Id System (STDOUT) /dev/sda1 * 0+ 36404- 36405- 292421631+ ee GPT (STDOUT) /dev/sda2 0 - 0 0 0 Empty (STDOUT) /dev/sda3 0 - 0 0 0 Empty (STDOUT) /dev/sda4 0 - 0 0 0 Empty (STDOUT) Successfully wrote the new partition table (STDOUT) (STDOUT) Re-reading the partition table ... /usr/share/fai/setup-storage/Commands.pm: **1301 &FAI::push_command("echo ,,,* | sfdisk --force $boot_disk -N1", 1302 "pt_complete_$disk", "gpt_bios_fake_bootable") 1303 if($FAI::configs{$config}{disklabel} eq "gpt-bios" and $boot_disk); 1304 1305 ($prev_id > -1) or &FAI::internal_error("No partitions created"); 1306 $partition_table_deps{$disk} = "cleared2_$disk,exist_" 1307 . &FAI::make_device_name($disk, $prev_id); 1308 } -Kevin ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email