0

I'm searching for a good solution to backup /home of my Debian linux system to a USB memory stick of size 128 GB. The directory /home weights about 65 GB and is formatted as ext4. Naturally, with the files, I wish to backup their permissions and keep soft links as soft links. Moreover, some files names go beyond ASCII and include German umlaute or cyrillic letters. There are no hard links in /home, I'm not using extended attributes, and I don't care about last-access times. (However, the directory /home/〈username〉/.mozilla apparently contains files with extended attributes or nonregular files such as sockets, so, for the purpose of easy handling, I'd like to backup the whole directory completely with these files or not all all.) The backup will happen weekly on average and will most likely be incremental. Once a month I would use the memory stick on a different linux machine to transfer files, so the file tree in the backup should be simply the same as in /home.

My previous solution to use ext4 on a (different) USB-stick resulted in issues which are hard to reproduce and hard to debug: How to remove a file with bogus permissions and owner in ext4?, ext4 on USB flash fails . Thus, I'd like to give some other file system a try. Which one would suit? The primary goals are stability, long-term support by linux kernel&tools, and storing the metadata. The secondary goal would be low maintenance: I don't want to invoke some manual operation (such as defragmentation, trimming, etc.) 'every once in a while'. The tertirary goal could be low wear. The quaternary goal could be gimmicks such as read caches, write caches, and transparent compression. The quinary goal would be usability with Windows 10.

  • When you say supportable on Windows 10, what do you mean? Are you willing to use the windows-linux-subsystem? You might want to look at using borgbackup. I don't think it is very picky about the destination filesystem, and supports compression, dedup, encryption. Pretty much all meta-data for most *nix filesystems is supported and stored. – Zoredache Oct 26 '17 at 23:36
  • You may look at UDF: see this and this. – kostix Oct 27 '17 at 15:50
0

file system

It seems you had a bad experience with ext4, but as you can see here most linux distributions trust the ext4 file system.

So for the long-term stability and support, this is probably the best file sytem.

btrfs is less mature, but has some really interesting features for backups (snapshot and diff between snapshots). btrfs even has support for transparent compression. When the source and destination are both btrfs, you can easily do incremental backups on btrfs, some interesting reading here : incremental backups on btrfs.

It is probably a good idea to always unmount before removing the USB stick.

Wear

Flash wear is due to the limited number of erase cycle that can be done on a flash sector. Erasing a sector is necessary when data is written. If you plan to update your backup once a week, I would not be particularly worried by the flash wear.

You can reduce the flash wear by:

  • Not writing access time to the file system (noatime) mount option
  • Using an utility to write only what has changed (rsync).

rsync and noatime will also greatly speed-up the backup.

I also recommend to physically eject the drive when it is not mounted since I have seen some USB memory stick getting very warm even if unused.

caches and compression

Your question about (write-)caching is probably because Windows does not enable write caching by default on removable media, but Linux does. The cache for reading is always enable (execpt when you use the O_DIRECT flag with the open function). Caching is probably not a so important feature is you plug the disk only for reading/writing the backup.

Now about (transparent-) compression, it will probably increase the wear because even a small change can change the complete archive.

Windows 10

ext2fsd can be used to mount an ext4 partition on Windows, and WinBtrfs for btrfs partitions.

Conclusions

Choose a file system that you're comfortable with. If the idea of snapshot and btrfs send | btrfs receive seems to obscure, go for the good old rsync over ext4.

The really important part in a backup solution is that you do it and test it regularly.

  • Please see my edited answer – pim Oct 27 '17 at 12:31
  • The wear increase or decrease will depend of your data. For instance when trying to compress uncompressible data, the compressed data will be bigger than the original! – pim Oct 27 '17 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy