So I have this NAS, it can do SMB or NFS. I don’t like NFS host based ‘security’, so NFS is out (It doesn’t support NFSv4 with Kerberos). My Linux box uses an ext4 filesystem.
I want to use the NAS for backups. Using SMB, if I do backups at the file level, will my Linux files loose permissions or attributes or ACLs?
If so what is the alternative? Save a hard drive image as a file?
Using Samba is for interfacing file servers/clients between Microsoft and Unix/Linux. And to be avoided when no Microsoft systems are involved. NFS is native to Unix/Linux.
And you will loose all ownership and permission information on copy of Unix/Linux files to a Microsoft system (even if it is emulated on the NAS).
So, by denying to yourself the obvious NFS solution, you will have to walk an adventurous path (like the suggestion to first tar the file(s) into a tar file, where the tar file then will loose ownership/permissions on backup, but the files inside it will keep them).
I was so shocked by your idea of using a non-unix/Linux solution that I missed this.
That depends on what your backup/recover strategy/policy is (something you should have before you try to find the technical solution to implement the strategy). Do you make your backups to be able (among other things) to retrieve a letter from your grandma that you by accident destroyed today? Then you will have to restore your complete disk (that is stored “as a file” on the NAS) onto space you should have for it on a Linux system, to get to the individual file system, to get from it the individual file you need.
rync is a very powerful tool for this purpose and the way to go. Easy to schedule a script with Cron to backup your favorite folders every night, if needed. But don’t copy back files via samba (if needed), take the same way (rsync)…
Well I could mount a disk image file using loopback. Anyway I like the tar suggestion. And rsync. Looks like I might be able to hack rsync into this thing.
I just wondered what other folks are doing. Thanks!
Most would not choose to use samba I would suspect, and some would likely use cloud backup these days. The suggestion to use tar was as a means to preserve ACLs etc, around your wish to use a NAS with samba connectivity.
That is a much more open question that the one you did. That one allowed only for using Samba or not.
When you ask what I am doing.
I use rsync in client/server situation. Thus to another system (just an older desktop with a text only openSUSE (13.1 or so, does not matter, only LAN access).
I keep several (in my case 10) generations of the backup situation, thus because I am doing it once a week (not very often, but it is fine for my situation), I can restore even files ten weeks back in time. That does not take as much space as you might think, because those generations are made using cp -al before doing rsync. The result is that files that have not changed are only once on the backup and in those 10 backup directories they are hard links.
First backup takes of course quite some time, but after that only changes are transferred, just minutes in my case.
I do not backup all of the system, installing is often faster. I do backup all in /home (all users’s data), /root (root’s home directory), /etc (to be able to consult system configurations on a fresh install), /boot (also because of configuration files) and /srv (I run Apache).
>>That is a much more open question that the one you did. That one allowed only for using Samba or not<<
Most of these consumer NAS devices and even the professional ones prefer SMB. The good news is that most of them are running some form of Linux or BSD, so one can make changes relatively easily.
>>I do not backup all of the system, installing is often faster.<<