FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-04-2012, 11:22 PM
Alan Chandler
 
Default how does update-grub choose the root filesystem

I am trying to figure out how to move my current rootfs to raid1 (its
just a partition at the moment).


The plan is to make a a raid device, copy the current root fs in to it -
but I then need to tell grub to set up this up as the root for the boot.


How do I do this?

--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FF4D03C.1070004@chandlerfamily.org.uk">http://lists.debian.org/4FF4D03C.1070004@chandlerfamily.org.uk
 
Old 07-05-2012, 10:10 PM
Tom H
 
Default how does update-grub choose the root filesystem

On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:
>
> I am trying to figure out how to move my current rootfs to raid1 (its just a
> partition at the moment).
>
> The plan is to make a a raid device, copy the current root fs in to it - but
> I then need to tell grub to set up this up as the root for the boot.

grub-install /dev/sdX


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAOdo=SxiSWebFUY-iDeCkMAZ8JTjrUVSm9xLSjRJQTHm9CZ_HA@mail.gmail.com
 
Old 07-06-2012, 06:24 AM
Alan Chandler
 
Default how does update-grub choose the root filesystem

On 05/07/12 23:10, Tom H wrote:

On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:

I am trying to figure out how to move my current rootfs to raid1 (its just a
partition at the moment).

The plan is to make a a raid device, copy the current root fs in to it - but
I then need to tell grub to set up this up as the root for the boot.

grub-install /dev/sdX


Reading the man page for this doesn't say how it finds out where the
root filesystem is. Thats the bit that is confusing me.


I currently have a root filesystem on /dev/sdb1. I am not sure which
disk contains the mbr - but it boots and then loads the root from there.


I have created a partially degraded mdadm raid array /dev/md0 comprising
/dev/sda1 and an empty slot. My desire is to install grub on both
/dev/sda and /dev/sdb to boot up from /dev/md0. When that is working I
will retire /dev/sdb1 and add it as the second component of /dev/md0.


The magic appears to be in grub-mkconfig (wrapped with update-grub).
But I am also confused as to whether I need to do anything about an
initramfs.


I want to achieve the mimimum of downtime on the machine I am trying to
make this work on, and am worried that if I go too far without properly
understanding what would happen I may end up with an unbootable system.


--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FF6848A.9040006@chandlerfamily.org.uk">http://lists.debian.org/4FF6848A.9040006@chandlerfamily.org.uk
 
Old 07-06-2012, 07:15 AM
Alan Chandler
 
Default how does update-grub choose the root filesystem

On 06/07/12 07:24, Alan Chandler wrote:

On 05/07/12 23:10, Tom H wrote:

On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:
I am trying to figure out how to move my current rootfs to raid1
(its just a

partition at the moment).

The plan is to make a a raid device, copy the current root fs in to
it - but

I then need to tell grub to set up this up as the root for the boot.

grub-install /dev/sdX


Reading the man page for this doesn't say how it finds out where the
root filesystem is. Thats the bit that is confusing me.


I currently have a root filesystem on /dev/sdb1. I am not sure which
disk contains the mbr - but it boots and then loads the root from there.


I have created a partially degraded mdadm raid array /dev/md0
comprising /dev/sda1 and an empty slot. My desire is to install grub
on both /dev/sda and /dev/sdb to boot up from /dev/md0. When that is
working I will retire /dev/sdb1 and add it as the second component of
/dev/md0.


The magic appears to be in grub-mkconfig (wrapped with update-grub).
But I am also confused as to whether I need to do anything about an
initramfs.


I want to achieve the mimimum of downtime on the machine I am trying
to make this work on, and am worried that if I go too far without
properly understanding what would happen I may end up with an
unbootable system.




I think the answer might be here.
http://unix.stackexchange.com/questions/5297/debian-grub2-moving-root-partition-to-new-drive
I have some other things to do right now, but I will try this out later.

It looks as though update-grub and/or grub-install use the current
root. So by chrooting into where you want to be you get them all set up.



--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FF6907E.5070900@chandlerfamily.org.uk">http://lists.debian.org/4FF6907E.5070900@chandlerfamily.org.uk
 
Old 07-06-2012, 12:27 PM
Alan Chandler
 
Default how does update-grub choose the root filesystem

On 06/07/12 08:15, Alan Chandler wrote:

On 06/07/12 07:24, Alan Chandler wrote:

On 05/07/12 23:10, Tom H wrote:

On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:
I am trying to figure out how to move my current rootfs to raid1
(its just a

partition at the moment).

The plan is to make a a raid device, copy the current root fs in to
it - but

I then need to tell grub to set up this up as the root for the boot.

grub-install /dev/sdX


Reading the man page for this doesn't say how it finds out where the
root filesystem is. Thats the bit that is confusing me.


I currently have a root filesystem on /dev/sdb1. I am not sure which
disk contains the mbr - but it boots and then loads the root from there.


I have created a partially degraded mdadm raid array /dev/md0
comprising /dev/sda1 and an empty slot. My desire is to install grub
on both /dev/sda and /dev/sdb to boot up from /dev/md0. When that is
working I will retire /dev/sdb1 and add it as the second component of
/dev/md0.


The magic appears to be in grub-mkconfig (wrapped with
update-grub). But I am also confused as to whether I need to do
anything about an initramfs.


I want to achieve the mimimum of downtime on the machine I am trying
to make this work on, and am worried that if I go too far without
properly understanding what would happen I may end up with an
unbootable system.




I think the answer might be here.
http://unix.stackexchange.com/questions/5297/debian-grub2-moving-root-partition-to-new-drive


I have some other things to do right now, but I will try this out later.

It looks as though update-grub and/or grub-install use the current
root. So by chrooting into where you want to be you get them all set up.



Something went wrong - I am not sure what, but I ended up needing a
rescue disk to reset root back to its old location. I wonder if its to
do with trying to use a raid device as the root partition.


Do you need to create a special initrd for that?


--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FF6D9B8.1080903@chandlerfamily.org.uk">http://lists.debian.org/4FF6D9B8.1080903@chandlerfamily.org.uk
 
Old 07-06-2012, 05:43 PM
Tom H
 
Default how does update-grub choose the root filesystem

On Fri, Jul 6, 2012 at 2:24 AM, Alan Chandler <alan@chandlerfamily.org.uk>
wrote:
> On 05/07/12 23:10, Tom H wrote:
>> On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler
>> <alan@chandlerfamily.org.uk> wrote:
>>>
>>> I am trying to figure out how to move my current rootfs to raid1 (its
>>> just a partition at the moment).
>>>
>>> The plan is to make a a raid device, copy the current root fs in to it -
>>> but I then need to tell grub to set up this up as the root for the boot.
>>
>> grub-install /dev/sdX
>
> Reading the man page for this doesn't say how it finds out where the root
> filesystem is. Thats the bit that is confusing me.
>
> I currently have a root filesystem on /dev/sdb1. I am not sure which disk
> contains the mbr - but it boots and then loads the root from there.
>
> I have created a partially degraded mdadm raid array /dev/md0 comprising
> /dev/sda1 and an empty slot. My desire is to install grub on both /dev/sda
> and /dev/sdb to boot up from /dev/md0. When that is working I will retire
> /dev/sdb1 and add it as the second component of /dev/md0.
>
> The magic appears to be in grub-mkconfig (wrapped with update-grub). But I
> am also confused as to whether I need to do anything about an initramfs.

"grub-install /dev/sdX" uses grub-probe to find "/" and "/boot".

"grub-install /dev/sdX" installs grub in the MBR of sdX and
"grub-install -f /dev/sdXY" installs grub in the PBR of of sdXY. The
latter's not recommended in general and isn't necessarily possible
when using mdraid.

You have to install grub in the MBR of both drives in order to be able
to boot from a degraded array.

>From a system of mine:

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 34
of the same hard drive for core.img. core.img is at this location and
looks for (mduuid/801256bc800752eab5118583d15c4689)/boot/grub on this
drive.
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 34
of the same hard drive for core.img. core.img is at this location and
looks for (mduuid/801256bc800752eab5118583d15c4689)/boot/grub on this
drive.

update-grub calls "grub-mkconfig -o /boot/grub/grub.cfg" and creates
the grub menu configuration. It doesn't install grub on a disk.

You shouldn't have to worry about the initramfs. It's built with md
scripts and hooks in "/usr/share/initramfs-tools". You can check that
it's been done with "lsinitramfs /boot/<INITRAMFS> | grep md | grep -v
modules".


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/CAOdo=Swews0hjj32QSFU3XrQQCxmco7xMMpHeGBBRehjN=H_X Q@mail.gmail.com
 
Old 07-06-2012, 05:56 PM
Gary Dale
 
Default how does update-grub choose the root filesystem

On 06/07/12 01:43 PM, Tom H wrote:

On Fri, Jul 6, 2012 at 2:24 AM, Alan Chandler<alan@chandlerfamily.org.uk>
wrote:

On 05/07/12 23:10, Tom H wrote:

On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:

I am trying to figure out how to move my current rootfs to raid1 (its
just a partition at the moment).

The plan is to make a a raid device, copy the current root fs in to it -
but I then need to tell grub to set up this up as the root for the boot.

grub-install /dev/sdX

Reading the man page for this doesn't say how it finds out where the root
filesystem is. Thats the bit that is confusing me.

I currently have a root filesystem on /dev/sdb1. I am not sure which disk
contains the mbr - but it boots and then loads the root from there.

I have created a partially degraded mdadm raid array /dev/md0 comprising
/dev/sda1 and an empty slot. My desire is to install grub on both /dev/sda
and /dev/sdb to boot up from /dev/md0. When that is working I will retire
/dev/sdb1 and add it as the second component of /dev/md0.

The magic appears to be in grub-mkconfig (wrapped with update-grub). But I
am also confused as to whether I need to do anything about an initramfs.

"grub-install /dev/sdX" uses grub-probe to find "/" and "/boot".

"grub-install /dev/sdX" installs grub in the MBR of sdX and
"grub-install -f /dev/sdXY" installs grub in the PBR of of sdXY. The
latter's not recommended in general and isn't necessarily possible
when using mdraid.

You have to install grub in the MBR of both drives in order to be able
to boot from a degraded array.

> From a system of mine:

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 34
of the same hard drive for core.img. core.img is at this location and
looks for (mduuid/801256bc800752eab5118583d15c4689)/boot/grub on this
drive.
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at sector 34
of the same hard drive for core.img. core.img is at this location and
looks for (mduuid/801256bc800752eab5118583d15c4689)/boot/grub on this
drive.

update-grub calls "grub-mkconfig -o /boot/grub/grub.cfg" and creates
the grub menu configuration. It doesn't install grub on a disk.

You shouldn't have to worry about the initramfs. It's built with md
scripts and hooks in "/usr/share/initramfs-tools". You can check that
it's been done with "lsinitramfs /boot/<INITRAMFS> | grep md | grep -v
modules".

Grub-install is generally pretty good at installing on both drives in a
RAID1 array or all drives in other RAID arrays. Update-grub also manages
to find OS partitions in just about everything - including non-Linux
partitions.


When in doubt, if you've changed things, just run update-grub and
update-initramfs -u. They only take a few seconds to run.



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FF726BA.5060703@rogers.com">http://lists.debian.org/4FF726BA.5060703@rogers.com
 
Old 07-06-2012, 06:31 PM
Alan Chandler
 
Default how does update-grub choose the root filesystem

On 06/07/12 18:56, Gary Dale wrote:

On 06/07/12 01:43 PM, Tom H wrote:
On Fri, Jul 6, 2012 at 2:24 AM, Alan
Chandler<alan@chandlerfamily.org.uk>

wrote:

On 05/07/12 23:10, Tom H wrote:

On Wed, Jul 4, 2012 at 7:22 PM, Alan Chandler
<alan@chandlerfamily.org.uk> wrote:

I am trying to figure out how to move my current rootfs to raid1 (its
just a partition at the moment).

The plan is to make a a raid device, copy the current root fs in
to it -
but I then need to tell grub to set up this up as the root for the
boot.

grub-install /dev/sdX
Reading the man page for this doesn't say how it finds out where the
root

filesystem is. Thats the bit that is confusing me.

I currently have a root filesystem on /dev/sdb1. I am not sure which
disk

contains the mbr - but it boots and then loads the root from there.

I have created a partially degraded mdadm raid array /dev/md0
comprising
/dev/sda1 and an empty slot. My desire is to install grub on both
/dev/sda
and /dev/sdb to boot up from /dev/md0. When that is working I will
retire

/dev/sdb1 and add it as the second component of /dev/md0.

The magic appears to be in grub-mkconfig (wrapped with update-grub).
But I
am also confused as to whether I need to do anything about an
initramfs.

"grub-install /dev/sdX" uses grub-probe to find "/" and "/boot".

"grub-install /dev/sdX" installs grub in the MBR of sdX and
"grub-install -f /dev/sdXY" installs grub in the PBR of of sdXY. The
latter's not recommended in general and isn't necessarily possible
when using mdraid.

You have to install grub in the MBR of both drives in order to be able
to boot from a degraded array.

> From a system of mine:

=> Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at
sector 34
of the same hard drive for core.img. core.img is at this
location and
looks for (mduuid/801256bc800752eab5118583d15c4689)/boot/grub on
this

drive.
=> Grub2 (v1.99) is installed in the MBR of /dev/sdb and looks at
sector 34
of the same hard drive for core.img. core.img is at this
location and
looks for (mduuid/801256bc800752eab5118583d15c4689)/boot/grub on
this

drive.

update-grub calls "grub-mkconfig -o /boot/grub/grub.cfg" and creates
the grub menu configuration. It doesn't install grub on a disk.

You shouldn't have to worry about the initramfs. It's built with md
scripts and hooks in "/usr/share/initramfs-tools". You can check that
it's been done with "lsinitramfs /boot/<INITRAMFS> | grep md | grep -v
modules".

Grub-install is generally pretty good at installing on both drives in
a RAID1 array or all drives in other RAID arrays. Update-grub also
manages to find OS partitions in just about everything - including
non-Linux partitions.


When in doubt, if you've changed things, just run update-grub and
update-initramfs -u. They only take a few seconds to run.



I think you are simplifying things. update-grub needs to locate a root
filesystem and seems to do that based on what it is running on at the
moment. I you are changing that then you have to do all this is the
"context" of that new root. This means setting up the environment as
described in the link I left elsewhere in this thread





--
Alan Chandler
http://www.chandlerfamily.org.uk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4FF72EEA.9010109@chandlerfamily.org.uk">http://lists.debian.org/4FF72EEA.9010109@chandlerfamily.org.uk
 

Thread Tools




All times are GMT. The time now is 07:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org