Re: How to move a singleton raid1 drive from raid1 /dev/md2 to /dev/md1

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

 



On Thursday April 7, mlaks@xxxxxxxxxxx wrote:
> Hi Software Raid Gurus!:
> 
> I have 
> 
> A1:~# cat /proc/mdstat
> Personalities : [raid1]
> md0 : active raid1 hdb1[0] hdg1[1]
>       244195904 blocks [2/2] [UU]
> 
> md1 : active raid1 hdc1[0]
>       244195904 blocks [1/1] [U]
> 
> md2 : active raid1 hde1[0]
>       244195904 blocks [1/1] [U]
> 
> Now I want to take /dev/hde1 and get rid of /dev/md2 and add /dev/hde1 
> to /dev/md1.

md1 is a 1-drive array.  You to make it a 2-drive array you need a
recent 2.6 kernel and a recent release of mdadm.  If you have these,
then

  mdadm -S /dev/md2  # shutdown md2 and release hde1
  mdadm /dev/md1 -a /dev/hde1 # add hde1 as a spare in md1
  mdadm -G -n2 /dev/md1 # grow md1 to have two devices.

If you don't have 2.6, then you will have to recreate md1 with
the desired number of components, which will require unmounting it.

   mdadm -S /dev/md2
   mdadm -S /dev/md1
   mdadm -C /dev/md1 -l1 -n2 /dev/hdc1 missing

   mdadm /dev/md1 -a /dev/hde1

NeilBrown
-
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