What to do when a RAID 1 is full?
I am a total beginner when it comes to RAID storage, but I hope you all bear with me on this.
I want to set up a network-based file server for my music recordings at home. For now, my plan is to use a Synology DS420+ NAS with four HDD slots and use those as a RAID 1 so I have a backup in case of disk failure.
Now - what happens if the NAS is full? Since only 50% is used for my actual files and the other 50% serve as backup, is it possible to disassemble (pardon my lack of jargon) the RAID 1, remove two of the HDDs, insert two new HDDs (so I have 4 empty ones again) and set up a new RAID 1?
Thanks for answering.
82 Answers
You mention in the comments that you're looking at a Synology NAS.
If you're going to use that, then configure it as 4 disk SHR-1 with Btrfs and data integrity enabled.
That'll actually give you RAID5, which provides more storage space than RAID1 whilst still keeping redundancy. The 1 in SHR-1 means that 1 disk can fail and you won't lose data. There is also SHR-2, which provides 2 disk redundancy but you will lose a lot of storage space and it's generally considered overkill for a 4 disk setup.
When you run out of space (in a 4 disk RAID5 configuration), you simply remove the disk, replace with a larger one and allow it to rebuild. A nice thing about SHR is that it allows you to mix disks of different sizes.
The first time you run out of space you'll have to replace two disks. After that, replacing a single disk will get you additional storage space.
The Synology RAID calculator is a useful page to determine what storage you get with a certain number and size of drives
9Disk replacement
Normally you shouldn't need to break up the array and create a new one – practically all RAID systems allow you to replace a disk on the fly. This is very useful for replacing failed disks, but you can use the same feature to replace a working disk with a larger one, while preserving everything else about the array, and without the filesystem even noticing that the change is happening.
(But only one at a time – you have to wait for the NAS to finish rebuilding the array before you can begin to replace the next disk.)
- Remove disk 1 and swap it with a larger disk, then allow the NAS to rebuild (resilver) it from the other disk that acted as its mirror.
- Remove disk 2 and swap it with a larger disk, wait for the NAS to rebuild.
- Swap disk 3, wait for rebuild...
- Swap disk 4, wait for rebuild...
- After all four disks are replaced, you now have a larger array.
RAID types
With traditional RAID, if you have four disks, then they're not in a single RAID 1 array – they're more likely to be RAID 1+0, where two 2-disk arrays are joined together using "striping" (each mirror stores a half of every sector). While striping provides some performance, it is not very flexible – both sides of the striped array have to be identical size, which means RAID 1+0 must consist of two identically sized RAID 1 arrays.
(If you actually had a 4-disk RAID 1 array, it would only give you 25% of space due to keeping 3 mirrors. So I'm fairly sure your NAS will using RAID 1+0.)
Synology has an article about this topic, as well as a visual calculator for various array types. Here's how it illustrates the limitation of the traditional RAID, and a diagram showing how you would upgrade it (though the illustrations seem to be for RAID 5 but the idea is still the same):
After all four disks have been replaced with larger ones, the NAS should be able to make use of the increased space.
(This restriction doesn't apply to newer methods such as Btrfs, which implements not disk-level, but chunk-level mirroring/striping and allocates space differently. If this was a regular Linux system, I would really prefer Btrfs 'raid1' over actual RAID 1.)
Meanwhile Synology offers "SHR-1", which appears to be a parity mode which allows mixed-size disks and gives you 66% or more capacity, instead of just 50% for basic mirroring. As the article shows, you will immediately get extra capacity after upgrading just two disks:
7