Wednesday, September 30, 2009

LVM Disk Recipes for Debian

After much wrangling and researching I finally figured out how to get LVM disk recipes to work with Debian preseeding. The following recipe will create a partition layout of what's in the table. When making these recipes make sure that you account for extra whitespace that may be hiding (especially spaces) otherwise it may yield unexpected results.


Mount PointTypeVGLV NameSize (MB)Filesystem
/bootPrimary100ext3
/LVMvg00/dev/vg00/rootvol4096ext3
/varLVMvg00/dev/vg00/varvol1024ext3
swapLVMvg00/dev/vg00/swapvol2048swap
/homeLVMvg00/dev/vg00/homevolremaining spaceext3


Recipe file:



Ubuntu/Debian Custom LVM Disk Recipe ::

100 1000 100 ext3
$primary{ }
$bootable{ }
device{ /dev/sda }
method{ format }
format{ }
use_filesystem{ }
filesystem{ ext3 }
mountpoint{ /boot }
.

100 100000 -1 lvm
$primary{ } $defaultignore{ }
method{ lvm } vg_name{ vg00 }
.

4096 10000 4096 ext3
$lvmok{ } in_vg{ vg00 } lv_name{ rootvol }
method{ format } format{ }
use_filesystem{ } filesystem{ ext3 }
mountpoint{ / }
.

1024 4000 1024 ext3
$lvmok{ } in_vg{ vg00 } lv_name{ varvol }
method{ format } format{ }
use_filesystem{ } filesystem{ ext3 }
mountpoint{ /var }
.

2048 5000 2048 linux-swap
$lvmok{ } in_vg{ vg00 } lv_name{ swapvol }
method{ swap } format{ }
.

1024 1000000 -1 ext3
$lvmok{ } in_vg{ vg00 } lv_name{ homevol }
method{ format } format{ }
use_filesystem{ } filesystem{ ext3 }
mountpoint{ /home }
.