GRUB & RAID have me Stumped

Paul Lussier p.lussier at comcast.net
Fri Jun 16 13:32:01 EDT 2006


"Ben Scott" <dragonhawk at gmail.com> writes:

> On 6/16/06, Paul Lussier <p.lussier at comcast.net> wrote:
>> I have set up a 4-way mirror of my OS partions.
>
>   Four-way?  Are you really, really afraid of data loss or something?  ;-)

No, trying to increase overall system reliability.  The system (in
theory, where everything works correctly :) the system is 4x less
likely to crash as a result of losing one of the 4 OS disks than it is
if it loses one of only 1 OS disk :)

>>  4. Reboot, telling grub that / is now on /dev/sdb1.
>
>   I suspect the trouble is around here.

Yeah, me too.

>   However, the kernel *does* write to the filesystem (of course).  So
> you have to tell the kernel to use the RAID device, not the physical
> device.  In other words, while your GRUB config file might say "root
> (hd0,0)", your kernel command line will say "root=/dev/md0".

So, I have a menu.lst entry like this:

title      Debian GNU/Linux, kernel 2.4.32pcore-a.15, /dev/sda1
root       (hd0,0)
kernel     /boot/vmlinuz-2.4.32pcore-a.15 root=/dev/md0 ro console=tty0 nosmp noapic 
savedefault
boot


And my system did indeed come up (apparently on /dev/md0) but it
remained read-only, to the point where nothing else was mounted
because /etc/mtab couldn't be changed?

Something's wacky.

>>   # mount /dev/sda1 /mnt
>
>   Never ever do that.
>
>   You've just told the kernel to mount a filesystem (read-write) which
> is actually a component of a RAID mirror.  So the kernel will be
> seeing two slightly different filesystems, and updating them
> independently, but on the same device!  I'm somewhat amazed you
> haven't trashed the filesystem completely.

Yeah I know :) But, since I wasn't writing to it, and I've trashed
this system dozens of times this week, why not :) This is a lab
system, not production, so it's rather fun to be able to do things you
always hear or tell people too "never, ever, ever do that, no matter
what!" :)

>If you can, just wipe everything and reinstall from scratch.  It'll
>be easier.

Yep, been there so many times this week I've got an entire automated
script which does all my config, detects if it's as I expect it, and
if not, reboots into the re-installation :)  

-- 
Seeya,
Paul



More information about the gnhlug-discuss mailing list