使用LVM和RAID预播Ubuntu partman配方

我正在尝试预先安装Ubuntu 12.04服务器,并创建了一个配方,可以在2个驱动器上创建RAID 1,然后使用LVM对其进行分区.不幸的是,partman在创建LVM卷时抱怨说配方中没有可用于LVM的分区(在控制台中它抱怨无法使用的配方).

我所追求的布局是sdb和sdc上的RAID 1(从USB棒安装所以需要sda)然后使用LVM创建启动,root和交换.

奇怪的是,如果我将boot_lv的挂载点更改为home,则配方工作正常(除了安装在错误的位置),但安装在/ boot时失败

我知道我可以使用单独的/ boot主分区,但任何人都可以告诉我它失败的原因.食谱和相关选项如下.

## Partitioning using RAID
d-i     partman-auto/disk string /dev/sdb /dev/sdc
d-i     partman-auto/method string raid
d-i     partman-lvm/device_remove_lvm boolean true
d-i     partman-md/device_remove_md boolean true
#d-i     partman-lvm/confirm boolean true
d-i     partman-auto-lvm/new_vg_name string main_vg
d-i partman-auto/expert_recipe string           \
    multiraid ::                    \
        100 512 -1 raid         \
            $lvmignore{ }           \
            $primary{ }         \
            method{ raid }          \
        .                   \
        256 512 256 ext3            \
            $defaultignore{ }       \
            $lvmok{ }           \
            method{ format }        \
            format{ }           \
            use_filesystem{ }       \
            filesystem{ ext3 }      \
            mountpoint{ /boot }     \
            lv_name{ boot_lv }      \
        .                   \
        2000 5000 -1 ext4           \
            $defaultignore{ }       \
            $lvmok{ }           \
            method{ format }        \
            format{ }           \
            use_filesystem{ }       \
            filesystem{ ext4 }      \
            mountpoint{ / }         \
            lv_name{ root_lv }      \
        .                   \
        64 512 300% linux-swap          \
            $defaultignore{ }       \
            $lvmok{ }           \
            method{ swap }          \
            format{ }           \
            lv_name{ swap_lv }      \
        .

d-i partman-auto-raid/recipe string \
    1 2 0 lvm -                     \
          /dev/sdb1#/dev/sdc1       \
    .                               
d-i     mdadm/boot_degraded boolean true
#d-i     partman-md/confirm boolean true
#d-i     partman-partitioning/confirm_write_new_label boolean true
#d-i     partman/choose_partition select Finish partitioning and write changes to disk
#d-i     partman/confirm boolean true
#d-i     partman-md/confirm_nooverwrite  boolean true
#d-i     partman/confirm_nooverwrite boolean true

解决方法

经过一段谷歌搜索后,我发现下面是partman-auto-lvm的代码片段,似乎如果lvm recipe在LVM上检测到/ boot分区,它会拯救掉虽然完全有可能在LVM上启动/启动.根据我的研究,在GRUB 2之前,您无法从LVM启动,因此您需要单独的主启动分区.
# Make sure a boot partition isn't marked as lvmok
if echo "$scheme" | grep lvmok | grep -q "[[:space:]]/boot[[:space:]]"; then
     bail_out unusable_recipe
fi

解决方法是指定无挂载点并从设置屏幕手动执行,这在某种程度上无法实现无人值守安装的目的.

相关文章

在Linux上编写运行C语言程序,经常会遇到程序崩溃、卡死等异...
git使用小结很多人可能和我一样,起初对git是一无所知的。我...
1. 操作系统环境、安装包准备 宿主机:Max OSX 10.10.5 虚拟...
因为业务系统需求,需要对web服务作nginx代理,在不断的尝试...
Linux模块机制浅析 Linux允许用户通过插入模块,实现干预内核...
一、Hadoop HA的Web页面访问 Hadoop开启HA后,会同时存在两个...