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

Re: Questions about software RAID level 1 (how long should it take to sync, etc?)



On 4/4/06, C. Jon Larsen <jlarsen@richweb.com> wrote:
>
> > okay, I just got to work and after doing a  cat /proc/mdstat, I see
> > the following:
> >
> > [===========>.........]  recovery = 59.6% (94640896/158577472)
> > finish=672.0min speed=1583K/sec
> >
> > I've googled a bit, but I can't seem to find any way to safely stop or
> > pause the synchronization process that was started with "mdadm --add
> > /dev/md0 /dev/hda1"..  Does anybody happen to know if this is
> > possible?  At this point, I don't mind losing all the data on the
> > drive that's being sync'd, but I'd rather not kill the source drive.
> > Thanks!
>
>
> Reboot, fix your drives, and then let it re-sync. You wont lose
> anything on the primary.

Okay, I stopped the sync process by doing a sudo reboot.  After the
reboot, I'm unable to boot from hdc1 which contains a copy of what was
on hda1 (and of course now hda1 is hosed).

The problem is that I initially compiled md/raid1 support into the
kernel and everything seemed to work fine.  I booted into hda1,
/proc/mdstat was there, so it seems RAID support was enabled.  I then
followed all the directions in rootraiddoc.97.html up to "Section - 5.
Reboot to RAID device", and after rebooting to hdc1 (now /dev/md0),
the boot process hung with a message saying "Could not open initial
console" or something like that.  I then rebooted back into hda1, and
decided to try making an initrd through mkinitramfs which contained md
and raid1 modules.  I was able to successfully boot into /dev/md0
using this initrd image created by mkinitramfs (which is a source of
much confusion, since I can't understand why I wasn't able to boot
into /dev/md0 from a kernel with md/raid1 support built in, but I
_was_ able to boot when using the initrd image with md/raid1 support -
can anyone explain this?).

The problem is, I installed this initrd image into /boot of hda1 
_after_ I had already followed "Step 4.3 Copy your Debian system to
RAID device." by using cp -axu / /mnt/md0, thus after I booted into
/dev/md0, then stopped the sync process (and killed hda1 by doing so),
I was unable to reboot into /dev/md0 since it didn't have a copy of
this initrd (arrgghh!).  Luckily, I had made a backup copy of hda1
using partimage before this whole process began, so I figured I'd just
restore from the backup image and start the process over again, right?
 Wrong.  As it happens, the machine that I had backed up hda1 to had
some _very_ faulty RAM (which I replaced last night), so when I tried
to copy over the image back onto hda1, it failed with CRC errors ;(

I then decided to reinstall debian testing on hda1, so I could create
another initrd (I have no other working debian machine here at the
moment).  I created a new initrd with md and raid1 support, then did a
"mount -t ext3 /dev/hdc1 /mnt/hdc1; cp /boot/initrd-2.6.15-486-RAID
/mnt/hdc1/boot".  I was hoping that I'd now be able to install grub on
/dev/hdc, set up menu.lst so it boots from /dev/md0 (with the RAID
initrd) and everything would be good.  Unfortunately, when I now
disconnected /dev/hda and boot from /dev/hdc, I get the following
messages:

md: md driver 0.90.3 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: bitmap version 4.39
md: raid1 personality registered as nr3
.
.
Begin: Mounting root file system...
Begin: Running /scripts/local-top
Done.
ALERT! /dev/md0 does not exist.  Dropping to a shell!

At which point I get dropped into busybox..  One thing I notice is
that although it shows the md module being loaded, it doesn't really
say anything about configuring/adding any RAID disks (which is used to
say, back when I had first booted into /dev/md0 (hdc1) before killing
/dev/hda1).  So now apparently /dev/md0 no longer exists, and I have
no idea how to create it.

In fstab on /dev/hcd1, I have:

/dev/md0 / ext3 defaults 0 0

and in /boot/grub/menu.lst I have:

title           Debian GNU/Linux, kernel 2.6.15-486 RAID
root            (hd0,0)
kernel          /boot/vmlinuz-2.6.15-486 root=/dev/md0 ro
initrd          /boot/initrd.img-2.6.15-486-RAID
savedefault
boot

Now, /dev/md0 was originally created by using:

mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/hdc1

can anybody tell me why /dev/md0 is no longer available on /dev/hdc1,
and if possible how to recreate it?

I should mention that after I cancelled the synchronization process,
and was unable to reboot into /dev/hdc1, I then mounted /dev/hdc1
through busybox, changed the Type of the disk from FD (linux raid) to
83 (linux), modified /etc/fstab and /boot/grub/menu.lst so it pointed
to /dev/hdc1 instead of /dev/md0.  I tried rebooting after changing
these options, and it gave me a message saying "Failed to mount root
file system" or something to that effect. Could changing the Type of
the disk or mounting /dev/hdc1 have caused /dev/md0 to become
corrupted/deleted?

Very sorry for writing such a long response, but as you can see, I'm
rather desperate.. If anybody has the time to read through my message
and give me some advice, I would very much appreciate it.  Thanks,

Mike

P.S. For those of you who had asked me for the results of hdparm -i
and -tT, the results are below (it seems /dev/hdc1 is running in UDMA2
but it's still showing disk reads as 29 MB/sec, so my throughput of
1.6 MB/sec seems _way_ too low, although I haven't tried modifying the
rebuild rates in /proc/sys/dev/raid as Mike Bird suggested..):

mike@asterisk:/mnt/hdc1/etc$ sudo hdparm -i /dev/hda

/dev/hda:

 Model=Maxtor 6Y160P0, FwRev=YAR41BW0, SerialNo=Y46TK2KE
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57
 BuffType=DualPortCache, BuffSize=7936kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 udma6
 AdvancedPM=yes: disabled (255) WriteCache=enabled
 Drive conforms to: (null):  ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3
ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7

 * signifies the current active mode

mike@asterisk:/mnt/hdc1/etc$ sudo hdparm -i /dev/hdc

/dev/hdc:

 Model=Maxtor 6Y160P0, FwRev=YAR41BW0, SerialNo=Y46V745E
 Config={ Fixed }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=57
 BuffType=DualPortCache, BuffSize=7936kB, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=268435455
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5 udma6
 AdvancedPM=yes: disabled (255) WriteCache=enabled
 Drive conforms to: (null):  ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3
ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6 ATA/ATAPI-7

 * signifies the current active mode

mike@asterisk:/mnt/hdc1/etc$ sudo hdparm -tT /dev/hda

/dev/hda:
 Timing cached reads:   2680 MB in  2.00 seconds = 1340.20 MB/sec
 Timing buffered disk reads:  172 MB in  3.03 seconds =  56.79 MB/sec
mike@asterisk:/mnt/hdc1/etc$ sudo hdparm -tT /dev/hdc

/dev/hdc:
 Timing cached reads:   2652 MB in  2.00 seconds = 1324.88 MB/sec
 Timing buffered disk reads:   88 MB in  3.01 seconds =  29.20 MB/sec



Reply to: