In my server there's an mdadm RAID-1 array consisting of two SATA disks, named sdb and sdc. The sdb disk might fail soon (according to SMART data), and I want to replace it with a newly bought disk. The solution at https://unix.stackexchange.com/a/104052 sounds good for copying contents from the failing disk to the new one without stressing the remaining good disk too much (essentially the new disk is added as spare, then all data is copied from sdb to the spare).

Unfortunately the server only has two SATA ports, so I'd like to attach the new disk via a USB-SATA adapter for the copy operation, and later attach it to the SATA port.

But I guess this way the new disk will first get a name like /dev/sdd when attached via USB, and when I disconnect the failing disk and connect the new disk via SATA the new disk will be named /dev/sdb. Will the RAID software cope with this gracefully? Or will this confuse the RAID array? Will it cause an unnecessary rebuild of the array? And if so, what would be a better way to perform this procedure?

This is on Debian 7 (Wheezy), with Linux 3.2 and mdadm 3.2.5.

  • 1
    Some USB->SATA bridges do 'weird' things, such as remapping from 512bytes sectors to 4K sectors. It might get interesting if you use such a clippy-style-smart device. Otoh with a normal 'dumb' USB to SATA bridge it should work. – Hennes Nov 29 '15 at 16:18
  • 1
    @Hennes: good hint - apparently the USB-SATA bridge I use changes 4K sectors to 512B sectors, or at least fdisk displays different "I/O size" values depending on the adapter and host. – oliver Dec 5 '15 at 17:09
  • Interesting. I know there are 512byte disks (classic PC setup), then there is 4k setup (new AF format. Better for big disks) and 512e (4k disks, but reported as 512b and emulated as it. This allows old stuff sunch as XP to work with it though tou want to take care you align partitions on 4K boundaries for performance reasons. And to complicate things there is 2TiB limit for 512b disks with a MBR setup. If have a 4k disk then this becomes a 16TiB MBR limit. Now add these three disk formats (some of which even lie about their format) and some 'smart' bridges which help you use 512b disks as 4K – Hennes Dec 5 '15 at 17:31
  • Most of these last 'clippy stule helpful' items are actually A-branded external cases aimed at helping mostly clueless users. And I must admit it does prevent a problems for clueless users who connect >2TiB drives to XP. But if you move sunch a drive outside the case it suddenly becomes no fun. – Hennes Dec 5 '15 at 17:32

mdadm works with disks UUIDS on its later versions, so it's not important which device they are on. So, for this question, the answer is: No, there is no problem if your system is newer than 5 years ago.

| improve this answer | |
  • This is on Kernel 3.2 which is from 2012, so I guess it's recent enough. – oliver Nov 29 '15 at 19:36
  • Yes, it is. Go ahead. – emi Nov 29 '15 at 19:38
  • I didn't test your answer after all because I created a wholly new RAID array in the end; but it still sounds valid. – oliver Dec 6 '15 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.