Setup-storage: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
Line 85: Line 85:


</pre>
</pre>
== Some examples ==

Revision as of 09:16, 7 June 2006

As setup_harddisks is not portable due to its dependency on sfdisk and the lack of support for RAID and LVM, we are planning a new implementation of the tool. Until it is finished you might want to have a look at


Proposal for a new configuration file syntax

In the following, we present a complete EBNF description of a modified configuration file syntax, as well as some examples.


file ::= <lines> EOF 

lines ::= EOL 
          /* empty lines or whitespace only */
          | <comment> EOL 
          | <config> EOL 

comment ::= #.* 

config ::= disk_config lvm 
           | disk_config raid
           | 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 */
           | <volume>

option ::= /* empty */
           | preserve:[[:digit:]]+(,[[:digit:]]+)*
           /* preserve partitions */
           | disklabel:(msdos|sun)
           /* 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 */

volume ::= <type> <mountpoint> <size> <filesystem> <mount_options> <fs_options>
           | vg <name> <size>
           /* lvm vg */

type ::= primary
         /* for physical disks only */
         | logical
         /* for physical disks only */
         | raid[015]
         /* raid level */
         | [^/[:space:]]+-[^/[:space:]]+
         /* lvm logical volume: vg name and lv name*/

mountpoint ::= -
               /* do not mount */
               | swap
               /* swap space */
               | /[^[:space:]]*
               /* fully qualified path */

name ::= [^/[:space:]]+
         /* lvm volume group name */

size ::= [[:digit:]]+%?(-[[:digit:]]+%?)?(:resize)?
         /* size in megabytes or %, possibly given as a range; physical
          * partitions or lvm logical volumes only */
         | -[[:digit:]]+%?(:resize)?
         /* size in megabytes or % given as upper limit; physical partitions 
          * or lvm logical volumes only */
         | preserve[[:digit:]]+
         /* do not modify this partition */
         | [^,:[:space:]]+(:(spare|missing))*(,[^,:[:space:]]+(:(spare|missing))*)*
         /* devices and options for a raid or lvm vg */

mount_options ::= [^[:space:]]+

filesystem ::= -
               | swap
               | [^[:space:]]
               /* mkfs.xxx must exist */

fs_options ::= .*
               /* options appended to mkfs.xxx call */

Some examples