help-grub
[Top][All Lists]
Advanced

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

Re: booting a clone from a /dev/md0 disk as single ext4 disk


From: Andrei Borzenkov
Subject: Re: booting a clone from a /dev/md0 disk as single ext4 disk
Date: Sun, 23 Oct 2016 20:03:48 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

23.10.2016 19:09, John Griessen пишет:
>>
>>> > and cannot utilize a hand written grub.cfg menu entry like this:
>>> >
>>> > menuentry 'Debian stretch/sid Linux 4.7.0-1-amd64' --class debian
>>> > --class gnu-linux --class gnu --class os {
>>> >   load_video
>>> >   insmod gzio
>>> >   insmod part_msdos
>>> >   insmod diskfilter
>>> >   insmod mdraid1x
>>> >   insmod ext2
>>> >   set root=UUID=87d52f42-838c-4418-a37e-f0d0a63ed8ed
>> This line is bogus. I'm surprised code after this works at all.
>>
>>> >     echo 'Loading Linux 4.7.0-1-amd64 ...'
>>> >     linux /boot/vmlinuz-4.7.0-1-amd64
>>> > root=UUID=87d52f42-838c-4418-a37e-f0d0a63ed8ed  ro rootdelay=20
>>> >     echo 'Loading initial ramdisk ...'
>>> >     initrd /boot/initrd.img-4.7.0-1-amd64
>>> > }
>>> >
> 
> hints about where to read next would be helpful.
> 

Well, grub2 documentation
(https://www.gnu.org/software/grub/manual/grub.html) could be starting
point. This is a bit dated, but it does explain disk name syntax used by
grub and what root variable does. It also gives some fairly complete
command language description, although too few commands are described.

"set root=..." sets grub2 root, and if you want to base it on UUID you
need to use `search' command (which is what grub-mkconfig does). This
command is even documented in the manual :)

...

> Can you run
>> dpkg-reconfigure from outside of installed root at all? I do not see any
>> option to specify where root is located.
> 
> I doubt dpkg-reconfigure is ever able to do anything but affect an
> installed debian linux system
> from within, or with chroot from the same kernel and probably the same
> initrd.img.
> 

Well, dpkg itself has `--root' option which allows you to call it off-root.

> Any hints about where to study the boot process as far as making cloned
> drives that started
> with boot from /dev/md0 run as single drives will be appreciated. 

Sorry, I could not parse this sentence. What I'd do,

1. create target devices (presumably, Linux MD)
2. copy from source to target
3. adjust /etc/fstab, /etc/mdadm.conf and whatever else is appropriate
(which may include recreating initrd)
4. chroot and run grub-install and grub-mkconfig or your distro command
that calls them

Note that in case of Linux MD grub2 grub-install only supports
installation on MBR. You also need to install grub2 individually on each
disk that belongs to MD array holding /boot/grub if you want resiliency
against individual disk failures.

Also note that in relation to grub2 "Linux MD" is really relevant only
if grub2 itself (i.e. /boot/grub directory) is on MD array.

5. configure your distro to use new bootloader location(s) as default.
So next time you update grub2 package it runs grub-install with correct
parameters. In case of Debina-based distro this actually means running
dpkg-reconfigure.



reply via email to

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