News for hackers. Stuff that matters.
Re:Don’t Be Afraid of RAID by 013a on Sunday May 24, 2020 @11:09AM (#23292014)
I'm something of a data hoarder. 20TB array of four disks.

I tell everyone who is interested in this "hobby"; Synology. Their products are, bar none, the best in the industry. I'd estimate that their direct competition will never catch up. They're so easy to use and maintain, I would assert that if you can install a web browser and check your email, you could run a Synology NAS. And the prices don't even have much of a surcharge over DIY (maybe 30%? you could DIY a server for pretty cheap with hand-me-down enterprise hardware, so hard to compare, but Synology's prices are very fair).

Let me outline a few things Synology does that makes your life so much easier:

- All of the administration happens through a web portal. And its not a basic, geeky portal. Its literally a full desktop. They've implemented windowing, minimizing/maximizing, desktop shortcuts, a start menu, it feels like a literal desktop running in your web browser. Just YouTube some videos of "Diskstation Manager".

- But, its also just Linux. You can SSH into it. It supports everything Linux does.

- They don't use ZFS or mdadm; they've implemented their own raid system they call "synology hybrid raid" (SHR). It supports surprisingly smart heterogenous drive size utilization while still maintaining N-Drive redundancy; with, for example, a 2TB+4TB+6TB+8TB drive combination in SHR-1 (RAID-5 equivalent), only 2TB of drive storage is totally unused (12TB storage + 6TB redundancy). Traditional RAID-5 would leave 12TB unused [1]. They put btrfs on top of it, so its not totally custom.

- When a drive goes bad, the physical unit starts beeping at you. No configuration necessary. You can see which drive is dead via the LEDs on the front, swap it out without turning the unit off, and a rebuild begins; you don't even have to visit the amazing Admin UI if you don't want to. You can also have it email you if you want, which is far easier than setting up an email notification on a bare linux server.

- It has an app store. A server app store! Want Plex? One click and you're online. Want Minecraft? Done. Want backups? Their "hyper backup" software supports a dozen targets including another Synology NAS, their own cloud storage, Google Drive, S3, Azure, SFTP, RSync, a USB drive, Dropbox, bunch of other stuff, it supports encrypted backups, it supports incremental backups. Want dynamic dns? Built in, with multiple providers including Synology's own, no cost. Wordpress? One click. MariaDB? One click. Email server? Done. MediaWiki? LDAP? OAuth IDP? Easy. All of this is as simple as installing a web browser. Actually, its simpler.

- Want to share external links with friends, like Google Drive? Synology Drive. It has a document and spreadsheet editor, totally custom, and probably 70% as good as Google Drive (which is pretty impressive considering you've never heard about it). If you have internet which isn't NAT'ed in a way that blocks hosting a server, it'll work. Generate a public link. Send it. Done.

Synology is awesome. If you thought self-hosting a server was too hard, think again. Anyone can do this. The unit sitting under my TV has an uptime of three years (I do have a UPS that can power it for about an hour or two; this has been used many times). I literally cannot express how little I've touched it in that time. I maintain all of our company's production cloud workloads on AWS, and I'd feel comfortable moving some things to a Synology unit, if you can develop a better story around redundant networking and power (this is the real challenge with self-hosting; not the server itself, not data redundancy, but the pipes supplying it).

[1] https://www.synology.com/en-us/support/RAID_calculator

Re:Don’t Be Afraid of RAID by vetinari on Sunday May 24, 2020 @05:14PM (#23294871)
While I love my Synology too, but let's not paint too rose picture:

- They are not expensive; you are getting a bunch of software on top. Not everything is based on open source, there's lot of Synology own developed software (and services, like quickconnect) too.

- SHR and SHR2 are build on top of bog-standard mdraid. You can mount them in standard linux machine, you you ever need it.

- You have option of btrfs and ext4. On cheaper models, only ext4. Btrfs is running on top of mdraid, not in btrfs raid mode.

- I had a drive failure; it beeped at me, exactly as you described, but after swapping the drive, I had to run rebuild from the web UI. It didn't start rebuilding automatically.

- App store: some things are great - Synology Drive kicks Nextcloud's ass. The office, calendar, mail packages are very nice. Synology DNS is Bind and Synology Directory Server is Samba in AD mode. with some options disabled (you can't join AD domain as another domain controller; only one can exist). What's worse, many open-source packages are available in old versions, as if someone packaged it once, threw over the wall and they are seldomly updated. And you won't be able to install postgres, because DSM (the Synology system) uses one internally, ancient version at that (9.3.22 on my system). That's why so many use Docker (on models capable of running it. Not all models can do that!). Similarly to that, you are probably running an ancient kernel. Wireguard? Forget it.

- You don't need public IP or play with port forwarding (even though it is better to have public IP/port forward): you can use Synology quickconnect, which will either hole punch your NAT for you, or do forwarding for you. You can share your files with Drive, even if you are behind CG-NAT.

So is it perfect? No. But it is very nice.

Re:Don’t Be Afraid of RAID by matheusmoreira on Sunday May 24, 2020 @11:34AM (#23292225)
> They don't use ZFS or mdadm; they've implemented their own raid system they call "synology hybrid raid" (SHR). It supports surprisingly smart heterogenous drive size utilization while still maintaining N-Drive redundancy

This is their best feature in my opinion. It allows users to just buy random drives from time to time and add them to the NAS when they need to expand storage capacity. Unraid also offers a similar feature albeit with a different implementation.

Current open source solutions just don't compare. Expanding storage with Linux device mapper involves failing and replacing each storage device:

https://raid.wiki.kernel.org/index.php/Growing

Even btrfs wastes 6 TB when given its 2+4+6+8 TB example:

https://carfax.org.uk/btrfs-usage/index.html

I wonder why existing systems can't support this easy expansion. It'd be a huge help for home users who'd like to slowly expand their storage capacity.

Re:Don’t Be Afraid of RAID by gravitas on Sunday May 24, 2020 @01:02PM (#23292855)
> Expanding storage with Linux device mapper involves failing and replacing each storage device

The same process is generally true of mainstream enterprise controllers such as Dell PowerEdge/PERC and HPe ProLiant/SmartArray; each existing drive is failed out (in turn) and the RAID rebuilt onto the new larger drive, then the controller array container is expanded once all drives are replaced.

Re:Don’t Be Afraid of RAID by zozbot234 on Sunday May 24, 2020 @12:54PM (#23292797)
> It supports surprisingly smart heterogenous drive size utilization while still maintaining N-Drive redundancy: with, for example, a 2TB+4TB+6TB+8TB drive combination

You can do this yourself with ease by creating 2TB partitions on all drives and setting up RAID separately on each. Then you could use LVM to access them as unified storage, or keep them separate for extra flexibility when restoring.

Re:Don’t Be Afraid of RAID by fomine3 on Sunday May 24, 2020 @08:17PM (#23296252)
It's theoretically possible but I'm afraid of operation failure for such complex array. So It's nice to have simple user interface like Synology.
Re:Don’t Be Afraid of RAID by 013a on Sunday May 24, 2020 @01:08PM (#23292888)
You can also replicate Dropbox quite trivially by getting an FTP account, mounting it locally with curlftpfs, then use SVN or CVS on the mounted filesystem [1]

[1] https://news.ycombinator.com/item?id=8863

Re:Don’t Be Afraid of RAID by singron on Sunday May 24, 2020 @05:38PM (#23295050)
What parameters are you using to make btrfs waste 6TB? With 2 copies (RAID1) and 2+4+6+8, that calculator shows it with 0 unusable space?
Re:Don’t Be Afraid of RAID by matheusmoreira on Sunday May 24, 2020 @05:41PM (#23295076)
I used RAID 6. That's 1 copy and 2 parity stripes.
Re:Don’t Be Afraid of RAID by singron on Sunday May 24, 2020 @05:52PM (#23295173)
Ah that explains it. Don't use parity with btrfs (i.e. RAID5/6). If you really want that, that's a good reason not to use btrfs.
Re:Don’t Be Afraid of RAID by matheusmoreira on Sunday May 24, 2020 @06:27PM (#23295442)
Because of the write hole, right? I've been avoiding btrfs because of that issue. Multiple copies are too wasteful and the parity implementation isn't perfect. Hope it gets fixed soon.
Re:Don’t Be Afraid of RAID by zrm on Sunday May 24, 2020 @11:08PM (#23297382)
That was recently fixed in mdadm. You can now specify a journal device (--write-journal) which closes the write hole. I don't see any reason btrfs couldn't do something equivalent.
Re:Don’t Be Afraid of RAID by ahnick on Sunday May 24, 2020 @01:22PM (#23293012)
The reason I avoided synology in the past was due to the lack of an ability to automatically detect and repair data corruption. It seems nowadays that their systems with BTRFS can automatically repair data corruption with the checksum. (https://blog.synology.com/how-data-scrubbing-protects-agains...)

Does anyone have any experience with this? Has it correctly caught data corruption for you? How does it compare to scrubbing on ZFS?

Re:Don’t Be Afraid of RAID by duskwuff on Sunday May 24, 2020 @10:26PM (#23297120)
> All of the administration happens through a web portal. And its not a basic, geeky portal. Its literally a full desktop. They've implemented windowing, minimizing/maximizing, desktop shortcuts, a start menu, it feels like a literal desktop running in your web browser.

That's a feature of Sencha ExtJS [1]. Synology didn't do the heavy lifting there.

> They don't use ZFS or mdadm; they've implemented their own raid system they call "synology hybrid raid" (SHR).

Which is just mdadm with extra steps. (Create a RAID array spanning all devices up to the size of the smallest device; repeat with the remaining space as long as there are at least two devices; create a JBOD of those arrays.) It's a kind of hokey approach, honestly.

[1]: https://examples.sencha.com/extjs/6.0.0/examples/classic/des...

Re:Don’t Be Afraid of RAID by louwrentius on Sunday May 24, 2020 @12:50PM (#23292761)
From what I can tell: Synology SHR is just MDADM RAID with some custom logic to slice up the drives so they can setup RAIDs with hard drives with different sizes.
Re:Don’t Be Afraid of RAID by cvubrugier on Sunday May 24, 2020 @04:54PM (#23294632)
Exactly! Suppose you have four HDDs: two 1 TB HDDs and two 2 TB HDDs. A single 1 TB partition is created on the 1 TB HDDs. Two partitions (1 TB each) are created on the 2 TB HDDs. A first RAID array (what you may call a slice) is created using the first partition of all four drives (4 x 1 TB, RAID5 = 3 TB). A second RAID array is created using the second partition of the 2 TB drives (2 x 1 TB, RAID 1 = 1 TB). Then the two RAID arrays are assembled with LVM (= 4 TB). SHR is basically LVM over MD.
Re:Don’t Be Afraid of RAID by magicalhippo on Sunday May 24, 2020 @08:31PM (#23296357)
Thank you for the explanation, I was wondering how that worked. How does it work if you then later add a fifth 4TB drive?

Anyway, I guess in this sense you could do something similar with ZFS, create a bunch of 1TB partitions and then make vdevs (slice) across a set of partitions on each drive.

Not sure if it's a good idea or not though. I do know you supposedly lose some performance when handing ZFS a partition rather than the whole drive, but maybe there's something else I can't think of right now.

Re:Don’t Be Afraid of RAID by cvubrugier on Monday June 01, 2020 @12:57PM (#23380679)
> How does it work if you then later add a fifth 4TB drive?

If you later add a fifth 4 TB drive, two partitions (1 TB each) are created on it. The remaining 2 TB will be unused: a slice with a single element cannot be replicated.

The first slice is expanded from "4 x 1 TB, RAID5" to "5 x 1 TB, RAID5", so the logical capacity of that slice is now 4 TB.

The second slice is migrated from "2 x 1 TB, RAID1" to "3 x 1 TB, RAID5". MD is able to change the RAID level (aka the "personality") of a RAID array, which is pretty cool.

Then the LVM layer is made aware of the increased capacity of the MD layer with `pvresize`.

The solution of using "LVM over MD" suffers from its complexity because you have to manage two distinct layers. For instance, you have to run LVM / mdadm commands in the right sequence to replace a failed drive.

Re:Don’t Be Afraid of RAID by deepspace on Sunday May 24, 2020 @04:58PM (#23294690)
Agree. I used to do enterprise storage for a living and I deployed roll-your-own ZFS storage servers at home in the past. But these days I just use a Synology box. I have ~40TB spinning on 5+1 SHR and the thing has been rock-solid for years.

I tend to not run many apps on the NAS but I do use HyperBackup for local and remote backups, and it works pretty well.

Re:Don’t Be Afraid of RAID by chiph on Sunday May 24, 2020 @08:27PM (#23296335)
How do you have HyperBackup setup? I want to use external USB drives (so I can store copies offsite) and from what I've read it won't span backups across multiple drives - my Synology capacity is 20TB and the external drives are 8TB. So what I'm doing now is doing old-school file copies across to a desktop machine, which isn't ideal.
Re:Don’t Be Afraid of RAID by sz4kerto on Sunday May 24, 2020 @11:18AM (#23292091)
Qnap started to roll out ZFS-based NAS models, those also worth looking at.
Re:Don’t Be Afraid of RAID by nemo on Sunday May 24, 2020 @12:53PM (#23292785)
Yep, I have a Synology NAS and have been very happy with it. One other thing worth mentioning is that if you're using it as a media server, it supports streaming to a Chromecast so you can stream directly from the NAS.
Re:Don’t Be Afraid of RAID by barrkel on Sunday May 24, 2020 @08:17PM (#23296244)
Anything which can serve MP4 over http can stream to a Chromecast; the only trick is telling the Chromecast to start.
Re:Don’t Be Afraid of RAID by renox on Monday May 25, 2020 @09:08AM (#23300592)
Chromecast doesn't support .srt subtitles :-(