help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grub2 and and mdraid


From: Patrick Begou
Subject: Re: Grub2 and and mdraid
Date: Thu, 01 Oct 2015 13:00:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0 SeaMonkey/2.19

Hi Andrei and thanks for your answer. As you notice I'm not a GRUB gourou...

My Grub is "1-99-27+deb7u2"

Since yesterday I've spent many hours on this problem.
Adding in /etc/default/grub the line:
GRUB_PRELOAD_MODULES="ext2 lvm mdraid1x part_msdos raid"
(which was described as a solution on a forum when the mdarray is degraded) has allowed me to start grub. This morning I removed this line to test your suggestion:

address@hidden:~# grub-install --boot-directory=/mnt/boot /dev/sdc
Installation finished. No error reported.

and Grub is also starting, with or without the --recheck flag. I'm unable to go back in yesterday's bad situation and I do not understand why as it is the only change I've done in this config file.

On /mnt/boot/grub I've setup a minimal grub.cfg file which is booting /dev/sdc:
This minimal grub.cfg file is:

set timeout=10
set root='(md/2)'
menuentry "boot raid1 test" {
linux /vmlinuz-2.6.32-32-pve root=/dev/mapper/pveraid-root ro quiet
initrd /initrd.img-2.6.32-32-pve
}

This is my /dev/sdc architecture as returned by lsblk
disk sdc WDC WD5003ABYX-1
part ├─sdc1
part ├─sdc2 linux_raid_member 769078af-81d6-0a71-c682-6e0277f431cd
raid1 │ └─md2 ext4 c65cfbac-c874-4d3b-9b43-47e9d539db35
part └─sdc3 linux_raid_member c54e9f37-2c41-1eaa-f1f8-b38dff83b316
raid1 └─md3 LVM2_member NOjFw4-vL4J-mIds-Fwib-3Czn-XYjA-ooJxSe
lvm ├─pveraid-swap (dm-3) swap 99b604a7-f0f8-4d39-adc4-19d3db53a0c1
lvm ├─pveraid-root (dm-4) ext4 64342e2a-867b-421a-b5e1-062558c782f0
lvm └─pveraid-data (dm-5) ext4 4bb237a2-b82e-4f25-993a-e2bb85a8bc26

Now I've to understand how to set this in /etc/grub.d architecture to allow "update-grub" functionality as it will overwrite my actual config.

Thanks

Patrick



Andrei Borzenkov wrote:
On Wed, Sep 30, 2015 at 3:04 PM, Patrick Begou
<address@hidden> wrote:
Hi,

for a while now I'm trying to set up grub to boot on a md array without any
success.
What is grub version?

                The system is actualy runing with:
/dev/sda2 mounted on /boot
/dev/sda3 a physical volume and /dev/mapper/pve-root mounted on /root
(proxmox distribution)

I've added a second disk /dev/sdc to move to a RAID1 config.

/dev/sdc2 is part of a degraded raid1 array /dev/md2  and /dev/md2 is an
ext4 filesystem for /boot
/dev/sdc3 is part of a degraded raid1 array /dev/md3  and /dev/md3 is a lvm
physical volume.
On dev/md3 there is a logical volume /dev/mapper/pveraid-root, with ext4
filesystem to mount as /

System has been copied from sda to sdc.

I try to set-up grub with:

mount /dev/md2 /mnt/boot
mount /dev/pveraid/root /mnt/root
cp -dpRx / /mnt/root
cp -dpRx /boot/* /mnt/boot
update-grub  -o /mnt/boot/grub/grub.cfg
grub-install --no-floppy --modules="biosdisk raid mdraid1x ext2 part_msdos
part_gpt"
Why do you attempt to outsmart grub-install? It exists exactly to
detect and include in core.img all required modules as well as set
suitable prefix. If it fails to do it, it is a bug.

--boot-directory=/mnt/boot --recheck /dev/sdc
--recheck is pretty useless, IIRC the only thing it does is to delete
device.map.

I've added a menu /etc/grub.d/09_swraid1_setup to try to boot /dev/sdc using
It is irrelevant, according to your description grub is never as far
as even reading grub.cfg. Let's fix it first. Does plain grub-install
--boot-directory=/mnt/boot /dev/sdc work?

the uuids as described in
http://unix.stackexchange.com/questions/196212/required-grub-modules-for-booting-on-mdadm-raid1
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type
the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'proxmox with RAID1' --class proxmox --class gnu-linux --class gnu
--class os {
   load_video
   set root=(mduuid/c65cfbac-c874-4d3b-9b43-47e9d539db35)
   echo 'Loading Proxmox with RAID...'
   linux /vmlinuz-2.6.32-32-pve root=64342e2a-867b-421a-b5e1-062558c782f0 ro
quiet
   echo 'Loading initial ramdisk...'
   initrd /initrd.img-2.6.32-32-pve
}

Or without the UUIDs as discribed in
https://www.howtoforge.com/how-to-set-up-software-raid1-on-a-running-system-incl-grub2-configuration-debian-squeeze-p2
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type
the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
menuentry 'proxmox with RAID1' --class proxmox --class gnu-linux --class gnu
--class os {
   load_video
   insmod raid
   insmod raid1
   insmod mdraid
   insmod part_msdos
   insmod ext2
   set root='(md/2)'
   echo 'Loading Proxmox with RAID...'
   linux /vmlinuz-2.6.32-32-pve root=/dev/mapper/pveraid-root ro quiet
   echo 'Loading initial ramdisk...'
   initrd /initrd.img-2.6.32-32-pve
}


But every time I get in the a rescue shell, saying the disk is not found. In
the "ls" command of the rescue shell no md devices seams available.

When I try to boot on the raid config, I set /dev/hdc to be the first in the
device order at boot time via the bios.

I can of course restart the server on /dev/sda  to keep it runing.

I do not find any help in the grub2 manual nor on the web, just an old
discussion (2013) on a problem with degraded arrays...

Thanks for your advices

Patrick



--
===================================================================
|  Equipe M.O.S.T.         |                                      |
|  Patrick BEGOU           | mailto:address@hidden |
|  LEGI                    |                                      |
|  BP 53 X                 | Tel 04 76 82 51 35                   |
|  38041 GRENOBLE CEDEX    | Fax 04 76 82 52 71                   |
===================================================================


_______________________________________________
Help-grub mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-grub


--
===================================================================
|  Equipe M.O.S.T.         |                                      |
|  Patrick BEGOU           | mailto:address@hidden |
|  LEGI                    |                                      |
|  BP 53 X                 | Tel 04 76 82 51 35                   |
|  38041 GRENOBLE CEDEX    | Fax 04 76 82 52 71                   |
===================================================================





reply via email to

[Prev in Thread] Current Thread [Next in Thread]