2

We have a mix of Linux (Debian) and MacOS laptops. I have a 4 TB external USB mechanical rotary drive I'd like to use for backups. I'd not want to partition the drive with different file systems for each OS because IDK yet how much space each requires. So I need a file system that works on both systems and also allows one system to read files backed up from the other (e.g. if the Debian laptop is inaccessible, I want another person on a Mac to be able to get critical files from the backup).

Research shows exFAT is usually recommended as cross-platform file system. Time Machine on the Mac doesn't work with non-Apple formats, but I'm using Get Backup Pro, which should be fine with it.

Only for SSD?
I also read exFAT is optimized for flash memory / SSD. APFS is also optimized for SSDs and performs badly when used on spinning drives. Is that the case for exFAT too? What exactly makes exFAT optimized for flash and what are the implications for using it with a rotary drive?

Journaling
I understand exFAT doesn't have journaling. In a backup use case, where it's written to, maybe once a day or even week, and almost never read, is that still a problem? I assume, if for whatever reason the backup process fails, I could just re-run it?

Permission & owner data
I believe exFAT doesn't handle them? What permissions and owners would Linux files have if restored from an exFAT backup?

2
  • 1
    Just a note to not use any FAT structure for Apple's 'special' databases, photos libraries, FCP or Logic projects. They will break.
    – Tetsujin
    Apr 23 at 12:33
  • Don't focus on backup technology until you have decided your disaster recovery requirements. For example, do you need full system recovery? Or is your need just to be able to recover some user documents? And what disasters - e.g. accidental file deletion or corrupt boot disk?
    – Gilby
    Apr 23 at 23:13

1 Answer 1

4

I also read exFAT is optimized for flash memory / SSD. APFS is also optimized for SSDs and performs badly when used on spinning drives. Is that the case for exFAT too? What exactly makes exFAT optimized for flash and what are the implications for using it with a rotary drive?

exFAT is not really comparable to APFS – mainly, it is not a "copy-on-write" filesystem (meaning that file data as well as filesystem metadata is updated in-place). While CoW makes a filesystem much more resilient, it also naturally leads to data fragmentation, and fragmentation is what hurts performance on HDDs; Btrfs has the same problem. But exFAT works practically the same as FAT32, with in-place updates and relatively simple linear structures.

About the only "flash-optimized" things I see in exFAT is that it allows for better alignment of data and metadata to the internal block boundaries of flash memory (which, if I understand things correctly, can be much larger than a single sector – whereas HDDs didn't care as they dealt with individual sectors for a long time).

I understand exFAT doesn't have journaling. In a backup use case, where it's written to, maybe once a day or even week, and almost never read, is that still a problem?

Yes, if writes are being done at all (files are being created, etc), and there is a chance for those writes to be interrupted (e.g. power outage, flaky USB cable), then there is a chance for filesystem corruption. (Although that's all not any different from yanked-out USB sticks, really.)

Usually the corruption is mild enough that a fsck/scandisk/chkdsk can recover inconsistencies easily, e.g. collecting loose data into FOUND.000 or 'lost+found', but I would rather not rely on that.

I assume, if for whatever reason the backup process fails, I could just re-run it?

That's not at all the point. If it were the only problem, then yes, you could just re-run the backup – but the problems with non-journaled filesystems are that they're prone to metadata corruption, where the filesystem itself becomes inconsistent (e.g. clusters allocated but not belonging to any file, or the other way around).

Though in the usual case it's minor; you run chkdsk/fsck every time the disk is mounted and you just end up with the partially-created files becoming loose data that chkdsk collects, and then you re-run the backup again.

I believe exFAT doesn't handle them? What permissions and owners would Linux files have if restored from an exFAT backup?

The ones that your backup software stored when creating the backup. Any backup software worth using will use some archive format that preserves this metadata inside the archive file, independently from the outside filesystem that the archive's going to.

Tar and Zip archives will store the archived files' ownership and permissions as part of the archive; so will the proprietary formats used by Borg and Restic, for example.

(RAR can store NTFS permissions, but I don't remember it being able to store Unix permissions.)

But if you just copy-paste or 'cp -av' the files straight onto an exFAT volume, then the permissions will be "whatever the system makes up at restore time", e.g. all files are likely to be owned by the user who mounted the volume, and everything will have generic 0644/0755 or similar permissions.

Remember that restoring file ownership usually requires root privileges; a backup restored by a non-root user will have the right permissions but won't be able to update the ownership of the restored files, resulting in all of them being owned by the user.

2
  • Thanks for your helpful answer! I wish I could upvote it, but I'm new here and it says "You need at least 15 reputation to cast a vote". If you believe lack of journaling to be a serious problem, is there another file system that you'd recommend for this use case?
    – Stacker
    Apr 23 at 8:33
  • Well, it's not necessarily serious – USB pendrives do survive a long time with FAT32, and many Linux systems did survive with ext2, etc. – the point was that the risk doesn't automatically disappear, and about where the risk comes from. In practice, it'll be fine if you do not have many power outages in the area (and the disk is internal). Apr 23 at 9:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .