Re: Help - raid not assembling right on boot (was: Resizing a RAID1)

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

 





On Thu, 27 Jan 2011, Hank Barta wrote:

Hi,

You may just want to dd and start over; or:


If I try to zero the superblock that seems to be in error, I get:
=============================
root@oak:/var/log# mdadm --zero-superblock /dev/sdb
mdadm: Couldn't open /dev/sdb for write - not zeroing
root@oak:/var/log#
=============================

Have you tried using the partition itself?
/dev/sdb1?

Also, any reason for making partitions on a MD raid device?
[   16.532107] EXT4-fs (md2p2): bad geometry: block count 485756928
exceeds size of device (483135232 blocks)

This is generally not a good idea.

It sounds like you want to make a raid-1 with two disks and pop it into a new system?

Way I typically do this is insert both drives into the new system, boot off a system rescue cd and then create the raid there, boot off the cd again, with root=/dev/md2, then run LILO, make sure to use 0.90 superblocks.

See below:

USE --assume-clean FOR LARGE FILESYSTEMS so you can reboot directly after
array creation and system restore implantation. (you will want to run an
echo repair > /sys/..sync_action though afterwards)

root@Knoppix:/t/etc# mdadm --create -e 0.90 --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 mdadm: size set to 8393856K
mdadm: array /dev/md0 started.
root@Knoppix:/t/etc# cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdb1[1] sda1[0]
      8393856 blocks [2/2] [UU]
      [>....................]  resync =  1.4% (120512/8393856) finish=3.4min speed=40170K/sec

root@Knoppix:/t/etc# mdadm --create -e 0.90 --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2
mdadm: size set to 136448K
mdadm: array /dev/md1 started.
root@Knoppix:/t/etc#

root@Knoppix:/t/etc# mdadm --create -e 0.90 --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
mdadm: size set to 382178240K
mdadm: array /dev/md2 started.
root@Knoppix:/t/etc#

root@Knoppix:/t/etc# cat /proc/mdstat Personalities : [raid1] md2 : active raid1 sdb3[1] sda3[0]
      382178240 blocks [2/2] [UU]
        resync=DELAYED

md1 : active raid1 sdb2[1] sda2[0]
      136448 blocks [2/2] [UU]
        resync=DELAYED

md0 : active raid1 sdb1[1] sda1[0]
      8393856 blocks [2/2] [UU]
      [==========>..........]  resync = 51.0% (4283072/8393856) finish=1.0min speed=62280K/sec

unused devices: <none>
root@Knoppix:/t/etc#

After this, you'll need to set them as 0xfd and make sure the boot is bootable,
your LILO config should look something like this:

boot=/dev/md1
root=/dev/md2
map=/boot/map
prompt
delay=100
timeout=100
lba32
vga=normal
append=""
raid-extra-boot="/dev/sda,/dev/sdb" # make boot blocks on both drives
default=2.6.37-3

image=/boot/2.6.37-3
  label=2.6.37-3
  read-only
  root=/dev/md2


Justin.

[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