multiple disk_config files?

Ingo Wichmann iw at linuxhotel.de
Mon Apr 25 13:09:09 CEST 2016


Hi,

Am 21.04.2016 um 15:28 schrieb John G Heim:

> On 04/21/2016 12:39 AM, Thomas Lange wrote:
>> > For the disk partitioning part, only one file is selected by FAI. 
> 
> Related question: How do people deal with the size of the swap
> partition? 

hooks, hooks, hooks ;-)

I wrote a script that creates the config file for disk_config. See
attachment for an example.

Ingo


-- 
Linuxhotel GmbH, Geschäftsführer Dipl.-Ing. Ingo Wichmann
HRB 20463 Amtsgericht Essen, UStID DE 814 943 641
Antonienallee 1, 45279 Essen, Tel.: 0201 8536-600, http://www.linuxhotel.de
-------------- n?chster Teil --------------
#!/bin/bash

skiptask partition

: ${BOOT_DEVICE:=/dev/sda}
: ${LOGDIR:=/tmp/fai}
: ${target:=/target}

for dev in $(lsblk --noheadings -l -o NAME "$BOOT_DEVICE" | tac); do
  wipefs -a -f "/dev/$dev"
done
sleep 1
parted ${BOOT_DEVICE} 'mklabel msdos yes' # this is sometimes necessary, often useless and produces warnings sometimes.

if ifclass BIGROOT; then
  cat <<-SETUPSTORAGE > $LOGDIR/setup-storage.conf
        disk_config $BOOT_DEVICE fstabkey:uuid
        
        primary /     8GiB-         ext4 errors=remount-ro
        logical swap  1GiB          swap sw
SETUPSTORAGE
else
  cat <<-SETUPSTORAGE > $LOGDIR/setup-storage.conf
        disk_config $BOOT_DEVICE fstabkey:uuid
        
        primary /boot 100MiB-300MiB ext4 rw
        primary -     0%-           -    -
        logical /     8GiB          ext4 errors=remount-ro
        logical swap  1GiB          swap sw
SETUPSTORAGE
fi

setup-storage -f $LOGDIR/setup-storage.conf -X 2>&1 | tee $LOGDIR/format.log


More information about the linux-fai mailing list