You can move a RAID array (software based RAID array) to another system. However, if /dev/md0 is already is use on serverB, you can rename /dev/md0 as /dev/m2 (or next available md device). In this example:
| Tutorial details | |
|---|---|
| Difficulty | Advanced (rss) |
| Root privileges | Yes |
| Requirements | Linux and mdadm |
| Estimated completion time | N/A |
- /dev/md0 is original software based RAID array.
- /dev/md0 is made of the two partitions called /dev/sdc1 and /dev/sdd2.
- I am going to rename /dev/md0 as /dev/md2 i.e. set /dev/md2 as the new device name.
WARNING! These examples may crash your computer if executed. Make a backup - it cannot be stressed enough how important it is to make a backup of your system before you do this.Type the following commands on serverA
# mdadm --detail /dev/md0
Sample outputs:
/dev/md0:
Version : 0.90
Creation Time : Sat Jan 1 05:30:03 2000
Raid Level : raid1
Array Size : 2490176 (2.37 GiB 2.55 GB)
Used Dev Size : 2490176 (2.37 GiB 2.55 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent
Update Time : Wed Nov 21 01:43:40 2012
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
UUID : 8c229b6a:c20a3bfa:2d164f4f:84bee133 (local to host nas03)
Events : 0.43537
Number Major Minor RaidDevice State
0 8 1 0 active sync /dev/sdc1
1 8 17 1 active sync /dev/sdd1
Note down the output, especially version number 0.90. It is recommended that you use the same version on the serverB. Next, stop the /dev/md0 on serverA, enter:
# mdadm --stop /dev/md0
The
Option #1: Rename a RAID
Next, you need to reassemble a pre-existing array as /dev/md2:
# mdadm --assemble /dev/md2 --super-minor=0 --update=super-minor /dev/sdc1 /dev/sdd1
The above command renames /dev/md0 indicated by the option --super-minor=0 as /dev/md2. The array is now ready to move into the serverB.
Option #2: Rename a RAID
The --super-minor option is only relevant for v0.90 metadata, and should not normally be used. Using --uuid is much safer. First, find out UUID for all devices, run:
# mdadm -Es
Sample outputs:
ARRAY /dev/md0 UUID=8c229b6a:c20a3bfa:2d164f4f:84bee133
ARRAY /dev/md1 UUID=b9cf66f0:f4e3e168:2d164f4f:84bee133
ARRAY /dev/md/2 metadata=1.2 UUID=e8e12adc:e0a02bdf:1cd25903:6c2f2b02 name=nas03:2
Type the following command reassemble the RAID device as /dev/md2:
# mdadm --uuid=8c229b6a:c20a3bfa:2d164f4f:84bee133 --update=super-minor --assemble /dev/md2
The array is now ready to move into the serverB.
Type the following commands on serverB
Attach /dev/sdc and /dev/sdd to the serverB and boot the server. The new server will use /dev/md2 immediately without any problem. You may need to update mdadm.conf file.
# cp -v /etc/mdadm/mdadm.{conf,bakup-nov-21-2012-by-nixcraft}
# mdadm -Es > /etc/mdadm/mdadm.conf
Possible caveats when renaming a RAID array
- You may need to update your grub.conf.
- This procedure may work fine but after reboot /dev/md2 may not be recognized at all. To avoid this problem use uuid when reassembling the RAID array.
- Make sure you update mdadm.conf on both serverA and serverB.
Recommended readings:- mdadm man page
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 3 comments… read them below or add one }
This would work if both server A & B are available, but what if server A can’t be booted & the array has to be moved to server B ?
In that case, just attach the drive and type option #1 or option #2 commands.
I might have missed something. Following Option #2, I obtain my UUID for the array-to-be-renamed.
I issue this command:
#> mdadm –uuid=61acc65f:0193c32a:f07e0e6d:1fff95a9 –update=super-minor –assemble /dev/md1
This is the error output:
#> mdadm: –uuid does not set mode, so cannot be the first option
my mdadm is pretty weak. what can my first option be?!