LVM Disk Recipes for Debian

Sep 30, 2009 [ #lvm #debian #linux #blogger ]

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 Point Type VG LV Name Size (MB) Filesystem
/boot Primary 100 ext3
/ LVM vg00 /dev/vg00/rootvol 4096 ext3
/var LVM vg00 /dev/vg00/varvol 1024 ext3
swap LVM vg00 /dev/vg00/swapvol 2048 swap
/home LVM vg00 /dev/vg00/homevol remaining space ext3

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 }
.