3

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.

8
  • 1
    What type of NAS is it? Whether you can actually replace just two HDDs (instead of all four) depends on how the RAID was implemented -- actual "traditional" RAID 1 (well, 1+0 or 0+1 when it's four disks) works at disk level and needs all disk sizes to be identical, while e.g. Btrfs 'raid1' works at chunk level and allows various combinations. – user1686 Jan 22 at 12:40
  • 10
    "and the other 50% serve as backup" -- "Redundancy" is a better term. – Kamil Maciorowski Jan 22 at 12:45
  • I'm thinking of using a Synology DS420+ as the NAS system. Basically what you're saying, even if I use 4 identical HDDs, the traditional RAID I would require me to exchange all four drives? Is it not possible to remove the mirroring and end up with two full, and two empty disks? – AudioCoder122 Jan 22 at 12:45
  • 2
    That's a bit different than what you were describing in the main post (which I couldn't really make much sense of, to be honest)... It should be possible to split a RAID1 so that both sides become independent, but it won't be RAID1 anymore after that point. What is it that you want to get? Do you want to retain RAID1 but replace the existing disks with larger capacity? Or do you want to disable RAID1 and re-use the current "mirror" disks (i.e. that lost 50% capacity) for storing new data? – user1686 Jan 22 at 12:53
  • 1
    Does this answer your question? Swapping disks with a higher capacity in a NAS – gronostaj Jan 22 at 14:23
9

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

9
  • Thank you so much for your input! It's very good to know that it's possible to simply exchange disks and letting the RAID rebuild (well, that is the purpose of RAID 1 I guess). Is it also possible to remove a disk, seeing as all data is already on there, and permanently archive it, and building a clean RAID 1 with a new disk (so 1 archived disk, and 4 RAID 1 disks again) instead of upgrading to more storage? The usage case would be that the data is old enough that it can be permanently archived and doesn't have to be available all the time on the NAS. – AudioCoder122 Jan 22 at 13:40
  • The reason why I'm insisting so much on the different usage case - assume that I'm using the Synology DS420+ with 4 slots, each slot occupied by a 5 TB HDD - I don't think it's possible to get MORE storage into this NAS, as I haven' really found anything larger than a 5 TB HDD that still fits the 2.5 inch form factor. – AudioCoder122 Jan 22 at 13:46
  • @AudioCoder122 RAID1 is limited to two disks so, in a four drive setup, you'd need to use RAID5. If you remove one of those disks in RAID5 then you won't be able to get any viable data from it. Worth noting that in a RAID1 setup you cannot increase the storage space without replacing both drives. If you're using SHR1 then you can swap one drive out, rebuild, swap the other drive out, rebuild and you'll have the additional space only after the very last task. – Richard Jan 22 at 14:03
  • @AudioCoder122 A single disk removed from a RAID is worthless. You need N-1 disks to be able to read data from SHR-1 (or RAID5), where N is the total number of disks. If you want to "archive" data, you need backups. And you really, really should have backups. RAID is not a backup. When you accidentally erase a file, RAID will make sure that all of its copies are erased. – gronostaj Jan 22 at 14:19
  • 2
    @AudioCoder122 As for total capacity, why are you looking just at 2.5" disks? DS420+ is designed for 3.5" disks, which I believe are available up to 18TB per disk. Also you should probably avoid disks using SMR technology. They have performance problems, especially when used in RAID (and everything 2TB+ in 2.5" format is SMR). Note that RAID is vulnerable when it's rebuilding: one drive is already gone, if another one drops the array will be destroyed. – gronostaj Jan 22 at 14:22
3

Disk 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):

Synology classic RAID1 Synology classic RAID1 upgrade

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:

Synology SHR-1 upgrade

7
  • SHR is Synology's branding of mdadm. The RAID type changes depending on the number of disks you have. With 2 disks it's RAID1 and with 3 or more drives it's automatically converted to RAID5. – Richard Jan 22 at 13:21
  • @Richard: That makes more sense, thanks. – user1686 Jan 22 at 13:25
  • 4
    Actually SHR is an additional layer over mdadm and LVM, which will automagically slice disks into smaller RAID pieces to maximize available capacity while maintaining required redundancy. For example with 4TB+4TB+3TB disks in SHR-1 you'll get a 3TB RAID5 logically concatenated with a 1TB RAID1. – gronostaj Jan 22 at 14:27
  • 1
    @user1686 I haven't checked what the actual performance is, but it does warn you when creating a volume that plain RAID may perform better – gronostaj Jan 22 at 16:21
  • 1
    (btw it doesn't use any proprietary solutions under the hood - the SHR itself is proprietary, but arrays that it manages can be accessed on any Linux box if you need to for some reason) – gronostaj Jan 22 at 16:23

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.