News for hackers. Stuff that matters.
Re:Building a Budget Homelab NAS Server by hddherman on Sunday May 29, 2022 @10:10AM (#31549254)
> I see people talking about snapshotting, but I haven’t found a need for it. I already have snapshots in my restic backup solution. They’re not especially convenient, but I’ve been using restic for two years, and I only recall needing to recover data from a snapshot once.

The ease at which you can revert mistakes using ZFS snapshots is much better compared to restic. You can pretty much navigate to the correct snapshot on your live filesystem and restore whatever you need to restore.

It also makes backups easier as you can just send the snapshots to the backup device (another server or external storage device).

Re:Building a Budget Homelab NAS Server by zaarn on Sunday May 29, 2022 @10:29AM (#31549408)
If you setup SMB right (TrueNAS configures this out of the box, SCALE is great if you need a Linux NAS), you can use Windows Shadow Copies to access ZFS snapshots and browse or restore file contents from them.
Re:Building a Budget Homelab NAS Server by MaKey on Sunday May 29, 2022 @11:04AM (#31549678)
Also possible with BTRFS. I set this up once for a small business with hourly snapshots during working hours. This way users could just restore older versions of files they accidentally deleted, overwrote or messed up in some other way. Another benefit: Those snapshots were read-only, so they also served as a protection against ransomware.
Re:Building a Budget Homelab NAS Server by zaarn on Sunday May 29, 2022 @11:07AM (#31549710)
I don't think BTRFS supports NFSv4 ACLs yet (ie, Windows ACLs are natively supported on ZFS, there is patchset so Linux also supports it but BTRFS obviously has no integration for a patchset that only exists for ZFS).

Having NFSv4 ACL access is a huge plus since you can configure permissions natively from windows and have them enforced even on the shell.

Re:Building a Budget Homelab NAS Server by vetinari on Sunday May 29, 2022 @01:07PM (#31550725)
Not sure how Synology implemented it, but they do support Windows ACLs on btrfs volumes.
Re:Building a Budget Homelab NAS Server by zaarn on Sunday May 29, 2022 @05:28PM (#31553040)
They likely use XATTRs to store the ACL (that is an option in Samba), but it's not native like it's on the TrueNAS systems with the kernel. I bet if you log into the Syno's via SSH you don't get the ACLs enforced on the shell. With the NFSv4 ACL patchseries, they would and you could benefit from the better options that the NFSv4 ACLs give you.

Storing them in metadata is not the same as having them natively.

Re:Building a Budget Homelab NAS Server by semiotic1 on Sunday May 29, 2022 @09:22PM (#31554598)
They maintain their own kernel module to handle ACLs (synoacl_vfs) and they are indeed enforced locally as well. They can be read and modified by using the `synoacltool` cli.

  $ synoacltool -get .config
  ACL version: 1 
  Archive: is_inherit,is_support_ACL 
  Owner: [semiotic(user)] 
  --------------------- 
   [0] user:semiotic:allow:rwxp-DaARWc--:fd-- (level:1)
   [1] group:users:allow:r-x---a-R-c--:fd-- (level:1)
Re:Building a Budget Homelab NAS Server by zaarn on Monday May 30, 2022 @01:20AM (#31555706)
Is that kernel module open source? One of the advantages of what TrueNAS did is that I can patch it into my own kernels if I'd need to. Plus being compatible to the NFSv4 ACL binary format, so it works via NFS too. Also handling Active Directory would be important there.
Re:Building a Budget Homelab NAS Server by vetinari on Wednesday June 01, 2022 @07:03AM (#31580209)
Not sure about the module being open-source, but running custom kernels is not really a thing on Synology. They seem to integrate SoC BSPs into kernels for each specific model, and they do not seem to port them across versions. Different models use different kernel versions in the same DSM (Synology distro) version.

The ACLs do work via NFS and it also works with Active Directory. They ship an AD implementation too, if you are interested in that (it is actually Samba in AD mode).

Re:Building a Budget Homelab NAS Server by zaarn on Wednesday June 01, 2022 @08:51AM (#31581077)
Well, TrueNAS Scale isn't exactly designed to be run on a SoC, it's more of a normal linux distro for NAS/SAN Servers. Hence most of it is open source and there is active upstreaming efforts. Plus the entire ACL thing is native to ZFS already, it's just the glue layer that's missing in Linux. For Linux it's presented in an XAttr for compatibility, for Solaris it's part of the proper permission bit fields.
Re:Building a Budget Homelab NAS Server by geek_at on Sunday May 29, 2022 @11:18AM (#31549799)
Not only that but also

> I chose raidz1. With only a handful of disks, the odds of two drives failing simultaneously is fairly low.

Which is not really the case of you bought x amount of the same disks and always use them together. I had that happen to me just a few months ago. 4 identical discs bought at the same time. Raidz1 reported one dead/dying disk so I replaced it and started resilvering, which can take days and leaves the disks at 100% utilization.

So after 12 hours or so a second one failed and the data was gone.

Lesson learned: mix up your disks

Re:Building a Budget Homelab NAS Server by madjam002 on Sunday May 29, 2022 @12:07PM (#31550232)
In my case even mixing up the disks might not help but I agree it’s still helpful.

I bought 4x Seagate Ironwolf Pro 12TB drives from different vendors, one failed after a year, then when I got the replacement another drive failed during the rebuild, and then 6 months later the replacement failed. Now another one of the original drives is also reporting reallocated sectors.

Same system has 4x WD Red drives which have been running fine with 0 reallocated sectors for almost 7 years.

Re:Building a Budget Homelab NAS Server by idoubtit on Sunday May 29, 2022 @11:19AM (#31549814)
I'm okay with claims that snapshots are much better than backups for many uses. But in this case the GP was explaining that they only used their backups once in several years, so they did not need to change their backup system.

I'm in the same boat. I configured remote backup systems on a handful of computers. I think I reached for backups only twice over the last ten years. Of course I need something, backups or snapshots, but for my use case snapshots (with a network copy) would need work to set up. And if the remote storage is worse, that would be more of a problem than the changes in the restore process.

Re:Building a Budget Homelab NAS Server by whoopdedo on Sunday May 29, 2022 @12:03PM (#31550199)
I think of a backup like a fire extinguisher. It's better to have one and never need it than to one day need it and it's not there.
Re:Building a Budget Homelab NAS Server by eminence32 on Sunday May 29, 2022 @10:20AM (#31549337)
I have personally been saved by ZFS snapshots (multiple times!) because sometimes I do dumb things, like running:

    rm -rf tmp *
Instead of:

    rm -rf tmp*
Re:Building a Budget Homelab NAS Server by tenken on Sunday May 29, 2022 @11:28AM (#31549889)
I never do "rm prefix" in a dir. I always do "rm ./aDir/prefix" for example. This assures I'm not globbing outside a directory (or just a directory) and tries to help assure I'm not shooting my own foot.

Yea, i love up 1 directory before I delete anything.

Re:Building a Budget Homelab NAS Server by lostmsu on Thursday June 02, 2022 @05:23PM (#31600672)
I just never do rm. Always use GUI file manager and have 0 problems.
Re:Building a Budget Homelab NAS Server by mmastrac on Sunday May 29, 2022 @12:12PM (#31550263)
> i love up 1 directory

It took me a minute, but I assume this should be "move up". This seems like a good habit.

Re:Building a Budget Homelab NAS Server by tenken on Wednesday June 01, 2022 @03:15PM (#31586647)
Yes, i typed the reply on my phone and it autocorrected to that. :(
Re:Building a Budget Homelab NAS Server by linsomniac on Sunday May 29, 2022 @10:23AM (#31549357)
This. I'm always going into my backup server and looking in the ".zfs/snapshots" directory to look at the history of how files have changed over the backups. Love restic, but the ZFS snapshots are fantastic.