changing MD device

3 messages, 2 authors, 2004-01-15 · open the first message on its own page

changing MD device

From: Aaron Gee <hidden>
Date: 2004-01-14 21:44:39

I have a system up and running, the root directory is mounted on device 
/dev/md0 which is a raid1 of 2 IDE drives.  My question is, how can I 
change it so that the my raid device is /dev/md1 not /dev/md0 and not 
loose the data.  Originally I was thinking of booting with a rescue 
disk, breaking the raid1, and rebooting.  Once rebooted create the raid 
device again as /dev/md1.  Is there a simpler way to do this? 

Why do I want to do this?  I have several external FC arrays with 
software raid, and XFS file systems using an external log dev that is 
/dev/md0 which is defined as a raid1 on the same array.  I want to be 
able to recover the external arrays - therefore my /dev/md0 on the 
backup machine needs to change to /dev/md1.

TIA
cluge

Re: changing MD device

From: Luca Berra <hidden>
Date: 2004-01-14 22:02:00

On Wed, Jan 14, 2004 at 04:44:39PM -0500, Aaron Gee wrote:
I have a system up and running, the root directory is mounted on device 
/dev/md0 which is a raid1 of 2 IDE drives.  My question is, how can I 
change it so that the my raid device is /dev/md1 not /dev/md0 and not 
loose the data.  Originally I was thinking of booting with a rescue 
disk, breaking the raid1, and rebooting.  Once rebooted create the raid 
device again as /dev/md1.  Is there a simpler way to do this? 
if your rescue disk contains mdadm you can use the
mdadm -A -U super-minor /dev/md1 /dev/hd?? once and the array will be
started and the minor updated

L.

-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

Re: changing MD device

From: Aaron Gee <hidden>
Date: 2004-01-15 19:36:45

Thanks for the advice, worked like a charm. I'm including the full 
procedure below for those that may need it in the future.

 > bluca@comedia.it wrote:
 > if your rescue disk contains mdadm you can use the
 > mdadm -A -U super-minor /dev/md1 /dev/hd?? once
 > and the array will be started and the minor updated

How to change software raid minor number with RH installs.

1. On your running system get and install mdadm
2. mount a blank floppy, copy /sbin/mdadm to floppy
3. On your running system tar up /dev/md*  (tar -cvf /mnt/floppy/dev.tar 
/dev/md*)
4. Boot from rescue disk - do NOT mount your linux install
5. At sh prompt, switch disks, mount the floppy that contains the tar 
file and mdadm
6. untar the devices (RH rescue disks only create /dev entries for 
arrays that it finds)
you should now have several /dev/md* entries. 
7. Copy mdadm to /sbin annd run it using the command line above
example: mdadm -A -U super-minor /dev/md[new number here] /dev/1stdev 
/dev/2nd /dev/etc
8. cat /proc/mdstat - is the array running and synched now?  Should be.
9. Mount your system useing the new device number where appropriate and 
modify /etc/fstab, /etc/raidtab and /etc/grub.conf to match your new 
raid settings
10.unmount all your system partitions and reboot

cluge
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help