Situation:
I have a 3-drive (SSD) software RAID5 (mdadm
) array (SATA) on the server (Linux Debian 8.5) for data only. I need to temporarily remove these drives in order to do something with some other drives.
Questions:
- What is the correct procedure? Is it as simple as stopping all related services, unmounting the array and stopping it? Can I safely do that and then unplug the drives while having the server running?
- Do I have to remember which drive has been connected to what SATA port?
- Do I have to reboot to start the array again, once I put those drives back?
I don't know anything about hot-swapping drives with software raid. You also don't mention anything about having a controller/backplane/chassis that can handle that. If you don't have something like that, don't do it. If you can hot-swap, there are some extra steps. Raid will need to be disabled and when you put the drive back in, it needs to be detected by the OS before it can be used, which is not automatic (last I checked)...
Linux MD raid doesn't assemble arrays based on device names or port numbers unless you manually configure it to do so. By default it should like something like this in your config file
/etc/mdadm/mdadm.conf:
If you turn off the system, you can remove the drives... and turn it off again later and add them back in again. Raid is autodetected, so you do not need to remember what sata port or drive (/dev/sdx) the raid members where on.
If for any reason you need to reassemble the array:
Then mount it. Though this should all be automatic.
If for some reason you assembled it using device names, you may want to switch (in advance) to device names under
/dev/disk/by-id/
rather than /dev/sdx so that you don't have to worry about things getting all rearranged when the drives are back in and the system comes back up. Or you can set it up to autoassemble as shown in the above configuration example.