[WBEL-users] Adding to RAID 1, only sees new partition as spare...

Benjamin Smith lists at benjamindsmith.com
Tue May 17 16:42:54 CDT 2005


I have a server that does backups, and I want to replace an existing 160 GB 
drive, with a RAID 1 300 GB array. 

I don't have enough IDE slots to mount all at the same time. So, I installed a 
single 300 GB HDD, configured it as /dev/md0 RAID 1, made a filesystem, 
mounted, and copied all the data over. It's seen and mounts fine with all 
data present. 

Now, I've removed the original 160 GB HDD, and put the other new 300 GB in 
it's place. 

I've tried and tried, and I can't get the 2nd 300 GB drive to sync up to the 
first 300 GB drive. It keeps seeing it as a spare... 

What am I missing? 

1st 300 GB partn in array (with data on it) /dev/hdh1 
2nd 300 GB partn in array (seen as spare) /dev/hde1 

Starting out: 
--------------------------------------------------------
[root at hume etc]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 hdh1[0]
      293033536 blocks [1/1] [U]

unused devices: <none>
--------------------------------------------------------

Then, I check /etc/raidtab
---------------------------------------------------------------------
raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        chunk-size      32
        persistent-superblock 1
        device          /dev/hdh1
        raid-disk       0
        device          /dev/hde1
        raid-disk       1
---------------------------------------------------------------------

And, verify that the partition type is correct: 
---------------------------------------------------------------------
fdisk /dev/hde 

The number of cylinders for this disk is set to 36481.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/hde: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hde1             1     36481 293033601   fd  Linux raid autodetect
---------------------------------------------------------------------

So, then I add the partn. 
raidhotadd /dev/md0 /dev/hde1

And I get this in /proc/mdstat: 
---------------------------------------------------------------------
[root at hume etc]# cat /proc/mdstat
Personalities : [raid1]
read_ahead 1024 sectors
md0 : active raid1 hde1[1] hdh1[0]
      293033536 blocks [1/1] [U]

unused devices: <none>
---------------------------------------------------------------------

It won't sync - it sees hde1 as a spare. What am I doing wrong? Here's some 
more information, notice that the "required disks" is set to 1, even 
though /etc/raidtab has the nr-spare-disks set to 0!!!! 
---------------------------------------------------------------------
[root at hume etc]# lsraid -D -l -a /dev/md0
[dev 34, 65] /dev/hdh1:
        md version              = 0.90.0
        superblock uuid         = 66FC00A9.63D809AC.4F2DA6A1.53F7648F
        md minor number         = 0
        created                 = 1116302369 (Mon May 16 20:59:29 2005)
        last updated            = 1116365609 (Tue May 17 14:33:29 2005)
        raid level              = 1
        chunk size              = 32 KB
        apparent disk size      = 293033536 KB
        disks in array          = 2
        required disks          = 1
        active disks            = 1
        working disks           = 2
        failed disks            = 0
        spare disks             = 1
        position in disk list   = 0
        position in md device   = 0
        state                   = good

[dev 33, 1] /dev/hde1:
        md version              = 0.90.0
        superblock uuid         = 66FC00A9.63D809AC.4F2DA6A1.53F7648F
        md minor number         = 0
        created                 = 1116302369 (Mon May 16 20:59:29 2005)
        last updated            = 1116365609 (Tue May 17 14:33:29 2005)
        raid level              = 1
        chunk size              = 32 KB
        apparent disk size      = 293033536 KB
        disks in array          = 2
        required disks          = 1
        active disks            = 1
        working disks           = 2
        failed disks            = 0
        spare disks             = 1
        position in disk list   = 1
        position in md device   = -1
        state                   = spare
---------------------------------------------------------------------

-Ben 

-- 
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978


More information about the Whitebox-users mailing list