RH - Need help rebuilding a mirror after throwing in a new HD?

smp

Diamond Member
Dec 6, 2000
5,215
0
76
EDIT: Please skip to reply #3 .. I have figured most of this stuff out, my main question lies there. Read it all if you'd like, and if you have time :)


-----------------------------

I just replaced one of my two hard drives in my mirror array on a RH 7.3 box. I was doing this with software raid.
I have a swap of 1 gig and a / of ~ 36 gig

here is my /proc/mdstat:


Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 hda2[0]
1020032 blocks [2/1] [U_]
md1 : active raid1 hda1[0]
38049856 blocks [2/1] [U_]
unused devices: <NONE>



Apparently, I'm supposed to use raidhotadd .... but I don't know how to use it, I'm not sure if the new disk has to be formatted. I kind of mucked around with some commands... raidhotadd /dev/md1 /dev/hda2 and that sort of thing but it gives me a "the disk is too small" .. or it gives me bad syntax
So I'm stumped .. off to do some more google searches, this is a headache.

mdstat: (or the part that matters right now)

VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci00:07.1
ide0: BM-DMA at 0xe000-0xe007, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0xe008-0xe00f, BIOS settings: hdc:pio, hdd:DMA
hda: MAXTOR 6L040J2, ATA DISK drive
hdd: MAXTOR 6L040J2, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide1 at 0x170-0x177,0x376 on irq 15
hda: 78177792 sectors (40027 MB) w/1819KiB Cache, CHS=4866/255/63, UDMA(100)
hdd: setmax LBA 78177792, native 66055248
hdd: 66055248 sectors (33820 MB) w/1819KiB Cache, CHS=65531/16/63, UDMA(100)


This new drive is a 40 gig maxtor, as you can see it's the same model number, why is it only being registered as 33 gig?
Also why is it being detected in PIO mode? I have ata100 cables on both drives, both drives are on individual IDE channels. Abit KT7A (non raid) mobo


my cmd:


md0 : active raid1 hda2[0]
1020032 blocks [2/1] [U_]

md1 : active raid1 hda1[0]
38049856 blocks [2/1] [U_]

unused devices: <NONE>
[root@red root]# raidhotadd /dev/md0 /dev/hda1
/dev/md0: can not hot-add disk: invalid argument.
[root@red root]# raidhotadd /dev/md1 /dev/hda2
/dev/md1: can not hot-add disk: too small disk!
[root@red root]#
i/i]

Okay, I threw the old disk back in and did the following:
[root@red root]# raidhotadd /dev/md0 /dev/hdc
It returned no errors and the HDD LED got really active for a long while
I have two partitions though .. I was under the impression that /dev/md0 was swap and /dev/md0 was /
or something :confused:

[root@red root]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 hdc[1] hda2[0]
1020032 blocks [2/2] [UU]

md1 : active raid1 hda1[0]
38049856 blocks [2/1] [U_]
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
How do I read /proc/partitions ?

[root@red root]# cat /proc/partitions
major minor #blocks name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq
9 1 38049856 md1 0 0 0 0 0 0 0 0 0 0 0
22 0 39082680 hdc 4 48 104 10 0 0 0 0 -1 714680 42234992
3 0 39088896 hda 2110 3179 42282 18950 1653 1722 27112 51010 -2 712360 41590212
3 1 38049921 hda1 2102 3176 42218 18900 1651 1722 27096 51010 0 16390 69910
3 2 1020127 hda2 7 0 56 50 2 0 16 0 0 50 50


It appears that I have to partition my disk before I can mirror it (I guess this makes sense, but I thought that raidhotadd would do that for me, guess not) .. seems like it should though, if the idea of raid is uptime/redundancy anyways.
Reason I ask is cause I'm gonna use fdisk to partition, but I have to check my partitions on my other disk to match them, also I don't know how to use fdisk and the man page is bleak .. anyone have good refs for this? Thanks
 

smp

Diamond Member
Dec 6, 2000
5,215
0
76
I have two maxtor DX740-6L drives.
These drives should be identical.
Why is this happening? (/dev/hdc is not formatted, could this be why?)


<FONT size=2>
Disk /dev/hda: 255 heads, 63 sectors, 4866 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 4737 38049921 fd Linux raid autodetect
/dev/hda2 4738 4864 1020127+ fd Linux raid autodetect
------------------------
Command (m for help): p
Disk /dev/hdc: 16 heads, 63 sectors, 77557 cylinders
Units = cylinders of 1008 * 512 bytes
Device Boot Start End Blocks Id System


/dev/hdc is not partitioned either. I want to partition it the exact same as /dev/hda
how can I do this? Once I do this my problems will be solved.
</FONT>The unit size is different, why? how?
What's going on? :confused: