There is a Ubuntu 16.04 system which is based on Software Raid 1. What are the ways to replace all HDD in RAID 1 with more capacious ones? In short, you need to transfer the system from Software RAID 1 160G to Software RAID 1 500G.

  • 2
    But simply it is impossible to replace it sequentially? - aleksandr barakin
  • one
    I had it easier. The system is on a separate HDD without RAID. A hard RAID for data only. Moved from 160 GB to 1 TB by simple copying. - Konstantin
  • one
    And Software RAID it with the help of some Software, the fact that in linux, i.e. mdadm or something else - Mike
  • @Mike using mdadm assembled. - Vladimir

1 answer 1

The raid is probably compiled via the linux raid , better known as mdadm .

If it is possible to connect all 4 disks at once, then connect all disks, mark them up as necessary. Then you expand the array to all 4 disks, raid1 can change the number of disks in the array without any problems.

 mdadm /dev/mdX -a /dev/sdcX mdadm /dev/mdX -a /dev/sddX mdadm --grow /dev/mdX -n 4 

Waiting for the end of synchronization. After that, remove the old disks and narrow the array back to 2 disks.

 mdadm /dev/mdX -f /dev/sdaX mdadm /dev/mdX -r /dev/sdaX mdadm /dev/mdX -f /dev/sdbX mdadm /dev/mdX -r /dev/sdbX mdadm --grow /dev/mdX -n 2 

Everything, the array now lives on new disks, stry disks can be physically disconnected. Now we can say mdadm that we need to increase the size of the array with the command

 mdadm --grow /dev/mdX --size=max 

Further actions depending on what is located on the array. If the file system is looking at which file system: xfs_growfs , resize2fs or something else. If LVM, then pvresize command, pvresize can say that the device size has changed.

If there is an opportunity to connect only two disks, then one by one you disconnect one old one, add one new one, wait for array synchronization, unplug the second old disk, put the second new one. Then continue with --grow --size=max . Expand the array to new disks and only after synchronization remove the old ones a little more reliably for the border case, when 1 disk was removed, and while synchronizing with the new one, the old disk that died suddenly died.

  • Thank you very much. Exactly what is needed. - Vladimir
  • In order not to produce a separate topic (or need?), But how to replace RAID 1 HDD with more capacious ones, but already in windows 10 (software RAID is also built-in with built-in Windows tools)? - Vladimir
  • 2
    Better spawn the topic. I have no idea, I do not work with Windows. - Shallow
  • Understood thanks. - Vladimir