Ubuntu natty setup-storage questions

Andreas Sindermann sinder at thp.Uni-Koeln.DE
Tue Aug 23 10:47:58 CEST 2011


Again me with three issues I asked some time ago already...

a) setup-storage leads to a different partition table than 
setup_harddisks, although the disk_config file only changed in syntax.

b) I'm currently using two classes NO_SCRATCH (for a standard partition 
layout that all of the FAI clients are using) and SCRATCH (to preserve a 
possibly existing /scratch partition that I created by hand earlier on 
some of the FAI clients, but not on all of them).

   b 1) How could theses classes NO_SCRATCH and SCRATCH be merged in one
        single class? Is it possible at all?

   b 2) There seems to be a problem with setup-storage not being able to
        preserve the /scratch partition in class SCRATCH, see below.


Here the long story:

Some of my FAI clients have a local /scratch partition on 
/dev/sda3, some other FAI clients don't have such a partition.

Up to now I created these partitions by hand. After a reinstallation via 
FAI (setup_harddisks) with Ubuntu 8.04 I had to restore the partition
table by hand.

Ubuntu 8.04 setup_harddisk disk_config file:

# <type> <mountpoint> <size in mb> [mount options]     [;extra options]
disk_config disk1
primary  /             10000      rw,errors=remount-ro ; -j ext3
logical  swap           2000      rw

The disk_config setup results in this partition table:

root at l28:~# fdisk /dev/sda
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0001e7ff

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1275    10241406   83  Linux
/dev/sda2            1276        1530     2048287+   5  Extended
/dev/sda5            1276        1530     2048256   82  Linux swap / Solaris


After creating/restoring /scratch by hand: (depending on the capacity of 
the harddisk its size varies, but it always starts at cylinder 1531!)

root at l28:~# fdisk /dev/sda
Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0001e7ff

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1275    10241406   83  Linux
/dev/sda2            1276        1530     2048287+   5  Extended
/dev/sda3            1531       30401   231906307+  83  Linux
/dev/sda5            1276        1530     2048256   82  Linux swap / Solaris



Currently, we are migrating to Ubuntu natty 11.04. The new setup-storage 
script leads to a slightly different layout, although the new disk_config 
file looks pretty much the same as before:

root at faisrv:/srv/fai/config/disk_config# cat NO_SCRATCH
# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid
primary  /        10000    ext3  rw,noatime,errors=remount-ro
logical  swap      2000    swap  rw

root at l41:~# fdisk /dev/sda
Disk /dev/sda: 250.1 GB, 250058268160 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00050434

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1274    10233373+  83  Linux
/dev/sda2            1275        1528     2040255    f  W95 Ext'd (LBA)
/dev/sda5            1275        1528     2040223+  82  Linux swap / Solaris


For whatever reasons with Ubuntu 11.04 (setup-storage) /dev/sda1 ends at
cylinder 1274 instead of 1275, additionally /dev/sda2 ends at cylinder 
1528 instead of 1530 as with Ubuntu 8.04 (setup_harddisks).

Is there a way that setup-storage would lead to the same layout like 
before with setup_harddisks?


For the fai clients with a /scratch partition I created a similar 
disk_config file:

# <type> <mountpoint> <size>   <fs type> <mount options> <misc options>
disk_config disk1 disklabel:msdos bootable:1 fstabkey:uuid 
preserve_always:3
primary  /        10000    ext3  rw,noatime,errors=remount-ro
logical  swap      2000    swap  rw
primary  /scratch  0-      ext3  rw


I'd like to merge these two classes if possible.

Is there a way to preserve a partition of  unknown size and unknown 
starting point, but only if it does exist already? I'm doing initial 
installs (fai-chboot -IvBk nouveau.modeset=0 fai_client), but still would 
like to preserve /scratch. I think 'preserve_lazy' is doing more than just 
preserving the partition.


And, secondly, the disk_config file leads to an error:

root at faisrv:/home/fai/l28/last# more format.log
Starting setup-storage 1.3
Using config file: /var/lib/fai/config/disk_config/SCRATCH
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
     Creating directory "/var/lock/lvm"
     Finding all volume groups
   No volume groups found
Executing: mdadm --examine --scan --verbose -c partitions
/dev/sda3 will be preserved
Executing: vgchange -a n
Executing: parted -s /dev/sda mklabel msdos
Executing: parted -s /dev/sda mkpart primary "ext3" 32256B 10479006719B
Executing: parted -s /dev/sda mkpart extended "" 250056737280B 252145958399B
Command had non-zero exit code


Due to the non-zero exit code FAI installation is interrupted at the 
beginning of the installation process.


To summarize: My target would be to have a single disk_config file that 
every time creates the layout

    Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1275    10241406   83  Linux
/dev/sda2            1276        1530     2048287+   5  Extended
/dev/sda5            1276        1530     2048256   82  Linux swap / Solaris

and that preserves a partition

/dev/sda3            1531       30401   231906307+  83  Linux

if it existed already before.


Sorry for the long elaboration... Thanks for any advice!

Best
Andreas



More information about the linux-fai mailing list