Without the -X parameter setup-storage runs in test-only mode and does not execute commands other than writing disk labels to a blank disk.
The exit code of setup-storage is 0 if all operations were performed successfully and non-zero if an error occurs.
file ::= <lines> EOF
lines ::= EOL
/* empty lines or whitespace only */
| <comment> EOL
| <config> EOL
comment ::= #.*
config ::= disk_config lvm( <lvmoption>)*
| disk_config raid( <raidoption>)*
| disk_config cryptsetup( <cryptsetupoption>)*
| disk_config tmpfs
| disk_config end
| disk_config disk[[:digit:]]+( <option>)*
| disk_config [^[:space:]]+( <option>)*
/* fully qualified device-path or short form, like hda, whereby full
* path is assumed to be /dev/hda; may contain shell globbing such
* as /dev/disk/by-id/scsi-* */
| <volume>
lvmoption ::= /* empty */
| preserve_always:[^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*
/* preserve volumes -- always */
| preserve_reinstall:[^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*
/* preserve volumes -- unless the system is installed for the
first time */
| preserve_lazy:[^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*
/* preserve volumes -- unless these don't exist yet */
| always_format:[^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*
/* run mkfs on the volumes, even if marked as preserve */
| resize:[^/,\s\-]+-[^/,\s\-]+(,[^/,\s\-]+-[^/,\s\-]+)*
/* attempt to resize partitions */
| fstabkey:(device|label|uuid)
/* when creating the fstab, the key used for defining the device
may be the device (/dev/xxx), a label given using -L, or the uuid
*/
raidoption ::= /* empty */
| preserve_always:[[:digit:]]+(,[[:digit:]]+)*
/* preserve volumes -- always */
| preserve_reinstall:[[:digit:]]+(,[[:digit:]]+)*
/* preserve volumes -- unless the system is installed for the
first time */
| preserve_lazy:[[:digit:]]+(,[[:digit:]]+)*
/* preserve volumes -- unless these don't exist yet */
| always_format:[[:digit:]]+(,[[:digit:]]+)*
/* run mkfs on the volumes, even if marked as preserve */
| fstabkey:(device|label|uuid)
/* when creating the fstab the key used for defining the device
may be the device (/dev/xxx), a label given using -L, or the uuid
*/
cryptsetupoption ::= /* empty */
| randinit
/* initialise all encrypted partitions with random data */
option ::= /* empty */
| preserve_always:[[:digit:]]+(,[[:digit:]]+)*
/* preserve partitions -- always */
| preserve_reinstall:[[:digit:]]+(,[[:digit:]]+)*
/* preserve partitions -- unless the system is installed for the
first time */
| preserve_lazy:[[:digit:]]+(,[[:digit:]]+)*
/* preserve partitions -- unless these don't exist yet */
| always_format:[[:digit:]]+(,[[:digit:]]+)*
/* run mkfs on the partitions, even if marked as preserve */
| resize:[[:digit:]]+(,[[:digit:]]+)*
/* attempt to resize partitions */
| disklabel:(msdos|gpt|gpt-bios)
/* write a disklabel - default is msdos */
| bootable:[[:digit:]]+
/* mark a partition bootable, default is / */
| virtual
/* do not assume the disk to be a physical device, use with xen */
| fstabkey:(device|label|uuid)
/* when creating the fstab the key used for defining the device
may be the device (/dev/xxx), a label given using -L, or the uuid
*/
| sameas:(disk[[:digit:]]+|[^[:space:]]+)
/* Indicate that this disk will use the same scheme
as the given device. The referenced device must be
defined before the device using this option. Use only
with identical hardware.
*/
volume ::= <type> <mountpoint> <size> <filesystem> <mount_options> <fs_options>
| vg <name> <size> <fs_options>
/* lvm vg */
| tmpfs <mountpoint> <tmpfs_size> <mount_options>
/* tmpfs volume */
type ::= primary
/* for physical disks only */
| logical
/* for physical disks only */
| raid[0156]
/* raid level */
| luks
/* encrypted partition using LUKS */
| tmp
/* encrypted partition for /tmp usage, will be
recreated with a random key at each boot and
reformatted as ext2 */
| swap
/* encrypted partition for swap space usage, will
be recreated with a random key at each boot and
reformatted as swap space */
| [^/[:space:]]+-[^/[:space:]]+
/* lvm logical volume: vg name and lv name*/
mountpoint ::= (-|swap|/[^:[:space:]]*)
/* do not mount, mount as swap, or mount at fully qualified path */
name ::= [^/[:space:]]+
/* lvm volume group name */
sizespec ::= RAM:[[:digit:]]+%|[[:digit:]]+[kKMGTP%iB]*
/* size in kilo (KiB), mega (default, MiB), giga (GiB), tera (TiB),
* petabytes (PiB) or percentage of disk size or RAM size;
* in future releases KB, MB, GB, ... will be treated as 1000 instead
* of 1024 (KiB, MiB, GiB, ...) multipliers */
size ::= <sizespec>(-(<sizespec>)?)?(:resize)?
/* size, possibly given as a range; physical partitions or lvm logical
* volumes only */
| -<sizespec>(:resize)?
/* size given as upper limit; physical partitions or lvm logical
* volumes only */
| [^,:[:space:]]+(:(spare|missing))*(,[^,:[:space:]]+(:(spare|missing))*)*
/* devices and options for a raid or lvm vg */
tmpfs_size ::= <sizespec>
/* tmpfs size */
mount_options ::= [^[:space:]]+
filesystem ::= -
| swap
| [^[:space:]]
/* mkfs.xxx must exist */
fs_options ::= (createopts=".*"|tuneopts=".*"|(pv|vg|lv|md)createopts=".*")*
/* options to append to mkfs.xxx and to the filesystem-specific
* tuning tool, pvcreate, vgcreate, lvcreate or mdadm */
disk_config hda preserve_always:6,7 disklabel:msdos bootable:3 primary /boot 20-100 ext3 rw primary swap 1000 swap sw primary / 12000 ext3 rw createopts="-b 2048" logical /tmp 1000 ext3 rw,nosuid logical /usr 5000 ext3 rw logical /var 10%- ext3 rw logical /nobackup 0- xfs rw
disk_config raid raid1 / sda1,sdd1 ext2 rw,errors=remount-ro raid0 - disk2.2,sdc1,sde1:spare:missing ext2 default
disk_config sda bootable:1 primary /boot 500 ext3 rw primary - 4096- - - disk_config lvm vg my_pv sda2 my_pv-_swap swap 2048 swap sw my_pv-_root / 2048 ext3 rw
disk_config /dev/sdb primary / 21750 ext3 defaults,errors=remount-ro primary /boot 250 ext3 defaults logical - 4000 - - logical - 2000 - - logical - 10- - - disk_config cryptsetup swap swap /dev/sdb5 swap defaults tmp /tmp /dev/sdb6 ext2 defaults luks /local00 /dev/sdb7 ext3 defaults,errors=remount-ro createopts="-m0"
disk_config tmpfs tmpfs /tmp RAM:20% defaults tmpfs /scratch 3GiB defaults
disk_config /dev/sda fstabkey:uuid bootable:2 primary / 20GiB ext3 defaults primary /boot 250 ext2 defaults primary swap 4GiB swap defaults logical - 256 ext3_journal - logical - 256 ext4_journal - logical - 256 xfs_journal - disk_config /dev/sdb fstabkey:uuid primary /mnt/ext3 33% ext3:journal=/dev/sda5 defaults primary /mnt/ext4 33% ext4:journal=/dev/sda6 defaults primary /mnt/xfs 33% xfs:journal=/dev/sda7 defaults
Further documentation, including coding related information, is maintained in a wiki page at http://wiki.fai-project.org/index.php/Setup-storage.