LVM and RAID support

Sam Vilain sam at vilain.net
Thu Oct 16 05:28:18 CEST 2003


Hi all,

I've added RAID support to setup_harddisks.  It involved a slight
refactoring of the script, and I didn't check functionality for the
features I'm not using (eg, logical partitions - keep reading for
why).

I've also a sketch for LVM support, though I haven't implemented it
yet.  The idea is that you can feed in disk configs like this:

# <type> <mountpoint> <size in mb> [mount options]     [;extra options]

disk_config sda

primary  /             	256         rw,errors=remount-ro ; raid(1,md0)
primary  swap          	1024        rw                   ; raid(1,md1)
primary  -		0-				 ; lvm,raid(1,md3)

disk_config sdb
primary  -		0-				 ; lvm,raid(1,md2a)

disk_config sdc
primary  -		0-				 ; lvm,raid(1,md2a)

disk_config sdd
primary  -             	256         rw,errors=remount-ro ; raid(1,md0)
primary  -          	1024        rw                   ; raid(1,md1)
primary  -		0-				 ; raid(1,md3)

disk_config sde
primary  -		0-				 ; raid(1,md2b)

disk_config sdf
primary  -		0-				 ; raid(1,md2b)

# config the LVM
vg_config default
vg_extent_size 8
lv	/usr			2048        rw,notail    ; reiser
lv	/var			600         rw,notail    ; reiser
lv	/export/home		10240       rw           ; reiser
lv	/export/sites		2048        rw           ; reiser
lv	iblog01			128                      ; pv(md3)
lv	iblog02			128                      ; pv(md3)
lv	ibdata01		4096                     ; pv(md2)
lv	/vservers		2048        rw           ; ext3

Hopefully you can see what is going on in the above config.  Disks 0,
1 and 2 are mirrored copies of disks 3, 4 and 5.  There is a RAID 10
set of disks 1,2 and 4,5.  md2 and md3 are LVM partitions - both going
to the same volume group.  Inside the LVM there are the regular
filesystems - reiserfs so that they may be easily resized, along with
a few LVs that are simply named - thus implying they are not mounted
anywhere.  I've also suggested a syntax for specifying that the LV is
to be located on a particular Physical Volume, and specifying the size
of the VG extents.

To get this working, you need LVM and/or MD support in your FAI kernel
(modules are possibly OK).  The LVM support is hopefully only going to
need a symlink in the NFSroot /etc/lvmtab.d to /tmp/fai/etc/lvmtab.d,
but it might end up needing a patch to the lvm utilities (or an
LD_PRELOAD wrapper) if we're unlucky.

The new setup_harddisks is at:

  http://vilain.net/linux/fai/setup_harddisks

Still to-do:

  a) integration with GRUB/LILO so that it installs to the correct
     location
  b) LVM support.

Feedback most welcome.
-- 
Sam Vilain, sam at vilain.net

You're either part of the solution, or part of the precipitate.
 - George W. Bouche, renowned chemist.




More information about the linux-fai mailing list