在LVM卷上安装debian 8并键入RAID1 GRUB2无法find卷组

你好社区!

我花了整整一天的时间在Debian 8.5上build立一个LVMtypes的Raid1卷,但服务器无法从它启动

首先这里是我从GRUB2得到的错误:

GRUB2

lvm lvs&lvm pvs

这里是我做的步骤,首先我启动到grml(Live-CD / Rescue-System):(工厂新的/ dev / sda&/ dev / sdb)

1。 然后我在两个驱动器上创build分区:

  • 512M主(Linux RAID自动检测)
  • 20G主要8e(Linux LVM)

2.现在我创build我的/ boot的RAID和格式为ext4

  • mdadm –create / dev / md0 –level = 1 –raid-disks = 2 / dev / sda1 / dev / sdb1
  • mkfs.ext4 / dev / md0

3.它的时间为卷组

pvcreate /dev/sda2 pvcreate /dev/sdb2 vgcreate vg0 /dev/sda2 /dev/sdb2

4.我们来卷和格式化他们

lvcreate -n root -L 20G vg0 --type raid1 lvcreate -n swap -L 4G vg0 --type raid1

root@grml ~ # lvscan ACTIVE '/dev/vg0/root' [10,00 GiB] inherit ACTIVE '/dev/vg0/swap' [4,00 GiB] inherit

mkfs.ext4 /dev/vg0/root mkswap /dev/vg0/swap

5.安装卷

mount /dev/vg0/root /mnt cd /mnt mkdir boot mkdir proc mkdir dev mkdir sys mkdir home mount /dev/md0 boot/

  1. 创buildfstab

mkdir etc cd etc vi fstab

 `proc /proc proc defaults 0 0 /dev/md0 /boot ext4 defaults 0 2 /dev/vg0/root / ext4 defaults 0 1 /dev/vg0/swap none swap defaults,pri=1 0 0` 

7. debootstrap debian jessie

debootstrap --arch amd64 jessie /mnt ftp://ftp.de.debian.org/debian/

8.安装一些必需品

mount -t proc none /mnt/proc mount -o bind /dev /mnt/dev mount -o bind /sys /mnt/sys

9. chroot进入shiny的新debian

chroot /mnt /bin/bash

10.设置一个新的root密码 passwd

11.添加贡献和非免费的源列表

nano /etc/apt/sources.list

deb http://ftp.de.debian.org/debian jessie main contrib non-free

12.安装软件包

apt-get install mdadm openssh-server lvm2 locales ntp vim-nox firmware-realtek

13.configuration语言环境

dpkg-reconfigure locales tzdata

14.安装内核

apt-get install linux-image-amd64

15. grub2 apt-get install grub2

selectsda&sdb作为安装设备

grub-install --no-floppy /dev/sda grub-install --no-floppy /dev/sdb update-grub /dev/md0 update-initramfs -u

16.退出并重启

exit shutdown -r now

也许任何身体可以帮助我,我希望我只会忘记一些东西。

据红帽员工介绍 :

Grub不支持LVM RAID1(仅支持RAID 4/5/6 IIRC型)

Debian 8有一些旧的内部,你可以达到同样的限制,我想find一些关于Grub的限制的官方信息,不幸的是我失败了。

 Re: [linux-lvm] GRUB boot problem with lvm mirror type raid1 From: Peter Rajnoha <prajnoha redhat com> To: gk180984 interia pl Cc: LVM general discussion and development <linux-lvm redhat com> Subject: Re: [linux-lvm] GRUB boot problem with lvm mirror type raid1 Date: Mon, 14 Apr 2014 11:40:36 +0200 
 On 04/14/2014 10:42 AM, gk180984 interia pl wrote: Hi I want to ask it is possible boot root file system (via GRUB) from LVM RAID1 volume? I can boot root file system (with /boot) from linera LVM volume and from mirror volume, but when I create raid1 mirror GRUB can't boot from it: lvconvert --type raid1 -m1 gsys/vsys LVM mirror is work: lvconvert -m1 gsys/vsys I have two disk and use only LVM, not other raid software. GRUB have lvm module. 
 Grub doesn't support LVM RAID1 (it supports only RAID 4/5/6 type IIRC). However, I don't recommend using /boot on LVM at the moment since grub support for LVM is limited and unofficial. There's a plan to add official and more robust support though - there are ongoing discussions between grub and LVM team...