Re: converting to raid - Error 2

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

 





On 5/5/2010 9:25 AM, Doug Ledford wrote:
On 04/30/2010 05:58 PM, Timothy D. Lenz wrote:


On 4/30/2010 1:53 PM, Doug Ledford wrote:

You can't use the setup macro (can't remember why, I just know it
generally doesn't work) when putting grub on your raid1 array.  You need:

install --stage2=/grub/stage2 /grub/stage1 (hd0) /grub/e2fs_stage1_5
/grub/stage2 /grub/grub.conf

and if that doesn't work in your particular configuration, you can add
the d option after stage1 and before (hd0), but if you use it, then your
boot disk must always be BIOS device 0x80, which means setting your BIOS
to boot off of some disk other than the first disk found usually won't
work and instead you just have to make whatever disk you want to boot
off of the first disk found by the BIOS.  You can switch (hd0) to
(hd0,0) if you want and if you have a normal DOS master boot record.

   grub>device (hd0) /dev/sdb
   grub>root (hd0,0)
   grub>setup (hd0)

To copy the current boot drive hda1 over to md0, I use a GRML boot disk,
mount /dev/md0 to /mnt/md0 and /dev/sdd1 (/dev/hda1) to /mnt/sdd1,
then do:

rsync -caHh --progress --delete /mnt/sdd1/ /mnt/md0.

Then I reboot normally. I have 2 copies of /boot/grub/device.map,
/boot/grub/menu.lst and /etc/fstab. one for normal boot and one for
raid. On /mnt/md0 I swap the normal boot files for the raid files by
adding .old to the names of normal boot and removing .raid from the raid
versions. Then reboot again and in cmos move the pata drive to the
bottom of the list so cmos tries the sata drives first. That worked for
the 32bit linux 2 drive system. But on this 64bit 3 drive I get:

Grub loading stage 1.5
Grub loading, please wait
Error 2

I can't remove the 3rd drive because it has part of md2 and I shouldn't
need to anyway. Copies of the above mentioned files I put at:
http://24.255.17.209:2400/vdr/local/raid/

grrr, used reply instead of reply all again, sorry:

I don't understand why using those commands at the grub>  prompt won't
work. It worked on the other computer.

Can't answer that for you.  I didn't bother to work out *why* it didn't
work, just that it's known to fail in some situations (the setup
command).  Maybe it's because it pulls information from the device map
and gets the device line wrong (and yes, the setup macro redoes whatever
device line you put in based upon the information in the device map
file).  Maybe it's something else.  Regardless, it's known to fail.

This is grub 1, not grub 2.

Yes, my instructions were for grub1.

I
haven't updated it yet. It is using lenny. I did start the upgrade to
grub2 on the other computer a short time ago, but haven't yet done the
final command to finish the change. Trying to solve one thing at a time
and right now this is the oldest. I don't recall ever doing any install
--stage2=/grub/st.... on the other system.

Here is what I get when I do this for sda:
---------------------------------------
grub>  device (hd0) /dev/sda

grub>  root (hd0,0)
  Filesystem type is ext2fs, partition type 0xfd

grub>  setup (hd0)
  Checking if "/boot/grub/stage1" exists... yes
  Checking if "/boot/grub/stage2" exists... yes
  Checking if "/boot/grub/e2fs_stage1_5" exists... yes
  Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  15 sectors are
embedded.
succeeded
  Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p
(hd0,0)/boot/grub/stage2 /boot/grub/menu.l
st"... succeeded
Done.
---------------------------------------

I know, it looks fine.  But it screws it up anyway.  It isn't reliable.
  You have to use the bare install command like I pointed out above.  You
also need to make sure that your boot partitions on the two drives are
*identical* in terms of placement on the drives (aka, the partitions
need to occupy the same logical sector numbers on both drives, which is
normal when they are both the first partition on each drive and the
drives use the same sector/head counts per track which is typical now a
days).

And I just noticed something.I used sda, not sda1. I can't remember
which I did before with the other, but my notes show sda. Would that
matter?

Normally sda would be the one I would use, but sda1 would work as long
as you have a normal DOS master boot record on the drive.


At this point I don't know if they are "normal DOS master boot record". I set the drives up a year ago or so. Here are the steps from my notes:
---------------------------------------
sudo fdisk /dev/sda
	Command (m for help): <-- n
	Command action
	   e   extended
	   p   primary partition (1-4)
	<-- p
	Partition number (1-4): <-- 1
	First cylinder (1-60801, default 1): <-- <ENTER>
	Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): <-- +25000M
	Command (m for help): <-- t
	Selected partition 1
	Hex code (type L to list codes): <-- fd
	Changed system type of partition 1 to fd (Linux raid auto)
-------
	Command (m for help): <-- n
	Command action
	   e   extended
	   p   primary partition (1-4)
	<-- p
	Partition number (1-4): <-- 2
	First cylinder (3041-60801, default 3041): <-- <ENTER>
	Using default value 3041
Last cylinder or +size or +sizeM or +sizeK (3041-60801, default 60801): <-- +5000M
	Command (m for help): <-- t
	Hex code (type L to list codes): <-- fd
	Changed system type of partition 1 to fd (Linux raid auto)
-------
	Command (m for help): <-- n
	Command action
	   e   extended
	   p   primary partition (1-4)
	<-- p
	Partition number (1-4): <-- 3
	First cylinder (3650-60801, default 3650): <-- <ENTER>
	Using default value 3041
Last cylinder or +size or +sizeM or +sizeK (3650-60801, default 60801): <-- <ENTER>
	Command (m for help): <-- t
	Hex code (type L to list codes): <-- fd
	Changed system type of partition 1 to fd (Linux raid auto)
-------
Make partition 1 bootable
	Command (m for help): <-- a
-------
save and write to disk
	Command (m for help): <-- w
---------------------------------------

I was thinking making one more try, but ether using su instead of sudo or just logging in as root as some stuff doesn't seem to work with sudo. Need to find the time when I'm home long enough with no interruptions to try it:).

Before I try the manual install, do you know what the "1+15 p" is in the install line the auto system did?
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux