What is the best partition file system for photography

I have 2 disk drives
1 SSD - 128GB
1 HDD - 1TB

16GB of ram
and 1TB backup drive

PProcessor Intel i5 2500k

I would like to use SSD as system disk and HDD as pictures and data drive.
Swap if needed is going to be swapfile probably on HDD

Pictures - RAW + JPG + XML file from photo editing software so:
around 30MB file + 12MB file + very little file
I have over dozen thousand of pictures

Everything I want is (order counts)

  1. files (pictures) safety
  2. performance

I will use darktable (moving slowly from lightroom) and if needed affinity photo in virtual machine with Windows 7

I want a possibility to backup my system. Like to use timeshift for emergency like problem with system update. I have a little knowledge of btrfs snapshots and I'm not sure how timeshift handle them.
Pictures backup is going to be on separate drive (best file system?)

Any POSIX filesystem will do, but one of the nice things about btrfs is that it has built-in compression. This increases performance, because decompressing the file in RAM takes less time than reading the uncompressed file from the drive ─ especially if the drive is a HDD ─ and it also increases the available free storage space.

However, do make sure that it is a POSIX filesystem ─ i.e. any of the natively supported filesystems in GNU/Linux ─ and not ntfs, because ntfs does not store POSIX file ownerships and permissions.

Likewise, for Timeshift, you would want to use a POSIX filesystem as the target, because Timeshift uses hard links for files that haven't changed since the last backup.

Lastly, while the Linux kernel supports swap files, you are always going to be better off with a dedicated swap partition. If the kernel has to use a swap file, then the filesystem this file resides on cannot use any of its optimizations, because the kernel has to be able to read and write the raw blocks. With the amount of drive space you have on the HDDs, you could easily create a swap partition of about 20 GiB and keep the rest for data and/or backups, and not bother with a swap file.

So for example

SSD - whole btrfs with timeshift in btrfs mode (there is rsync for other file systems if I'm correct). Any subvolumes?
For example like in this post?:

HDD - 20BG swap + everything else in btrfs for pictures and other data?

Some time ago btrfs had some stability issues. All gone? I'm thinking about my number 1 in first post and that is files safety.

That's entirely up to you. You could make a separate subvolume for /home. Personally I use separate partitions instead of subvolumes, but that's a matter of personal taste.

Sounds good. :wink:

Yes, it should be pretty stable, unless you use the built-in RAID support of btrfs ─ there are better and more stable ways of implementing RAID ─ but I use btrfs too, and I wouldn't be doing that if it were unreliable.

I will however add that it's not the fastest filesystem around. You won't notice the difference on an SSD, but for a HDD, xfs is probably still the fastest, followed by ext4.

Thank you for your help but if you (or anyone) could clarify something for me.
You said that because of compression btrfs can achieve better performance
But in last post you mentioned that btrfs is going to be slower than for example ext4
Assume that it is because of cow.
Is there a hudge difference?
I have found some file system comparisons but not current .
I've tried btrfs sometime ago but only for system partition and on ssd. No problems with performance.

Have no idea what to expect from hdd with a large number of quite small files

Right now my photos are on ntfs

1 Like

as a long time opensuse user, it's worth noting that a btrfs partition is used for the system partition because it also allows for the fantastic snapper program for system snap shots and restores down to the file level of the base OS. And as Aragorn says, xfs is better for the personal data (and is the default for /home or /data partitions). With timeshift, i find rsync more flexible than btrfs as the former allows backups at the partition level, but btrfs only at the drive level and needs to be saved on a btrfs partiition.

ps. I'm a darktable user (and rawtherapee) and have over 10,000 pics on a secondary drive, which i really should clean up a bit!

1 Like

The simplest option (and in 99% of cases good enough) is to use ext4 on both drives, have the root on the ssd, and home on the hdd. That's how I'd do it.

Unless you're on a laptop and want it to hibernate when you close the lid, the swap partition can be tiny (you can even get away without any). Most modern computers with a reasonable amount of RAM don't need to swap. You can also make a swap file later if you need it, which is more flexible than a swap partition.

For system backup Timeshift is great, but wouldn't recommend it for home directory. I typically just manually copy everything to a network drive (also formatted as ext4) or I use rsync.

Regarding photography, Darktable is fantastic. I do miss having Photoshop on Linux, though (but after several years of using Linux, I got used to not having it). GIMP is great (in some aspects even more powerful than Photoshop) but still not there yet overall. Once GIMP devs implement non-destructive editing (stuff like adjustment layers) I expect it will quickly surpass Photoshop, and might even become the industry standard (like Blender did with 3D graphics). It is just taking ages and I'm impatient...


I want timeshift only for root for the situations like system crash (for example after update or my mistake in something)
For photos I already use rsync (backup from internal hdd to external memory.

I use affinity photo instead of photoshop. I'm waiting for gimp but... more now :slight_smile:

I don't do a lot of photoshop/affinity editing so virtual machine with windows should be enough.

If you are going to have swap you should definitely put it on the ssd. Swap to hdd will incur a significant performance penalty. In most workloads you will get better performance with a smaller swap on an ssd than a large swap on the hdd.

Editing raw files in darktable is io intensive. I would use ext4 on your hdd. Unless you need some specific feature from btrfs it isn't worth the performance penalty for photo editing from an hdd. If your photos were on an ssd, that would be different.

Only for the benchmark junkies. :stuck_out_tongue:

That's a horrible filesystem. :wink:

1 Like

To conclude
SSD for system
I want backup only for system crashes not for hardware failures.
I want to use timeshift or something similar
btrfs with @ subvolume
Btrfs without subvolumes
Simply go with ext4 ?

HDD for images
Btrfs without subvolumes

I'm pretty sure that ext4 will work for both partitions. I have it now on my laptop.
I've tried btrfs with subvolumes for root and var/cache but without of a real understanding.

I don't want deep file system configuration. Looking for best for my needs out of the box.

But if it's worth I don't mind to learn something new

btrfs always has at least one subvolume, being the btrfs root ─ not to be confused with the term "root filesystem", because that's something else.

All things considered, you're probably best off just going with ext4 for everything (except for the swap partition, of course). Put the entire system on the SSD, like so...

  1. Your EFI System Partition
  2. Your root filesystem, mounted at /
  3. Your user-owned files, mounted at /home

Create three partitions on the HDD...:

  • A swap partition of about 30 GiB;

  • One partition for your photos, which you will mount under your $HOME, e.g. at $HOME/Pictures; and...

  • One partition for backups made with Timeshift. This partition needs not being mounted anywhere, because Timeshift will automatically mount it at /mnt when you make backups and unmount it again after the backup process has finished.

1 Like

:point_up: As usual, what @Aragorn said is all good advice.

In addition, I would recommend looking into making a swap file instead of a swap partition, especially if you're on a desktop computer. If your computer has plenty of RAM, here is a good chance you won't need to swap at all and in that case there is no point in wasting much space on it (you can make a "tiny" swap file just in case, say 512 MiB). However, if it turns out that you do need to swap, it's much easier and safer to change the size of a swap file than to repartition an already set up system. You can have a swap file on either a exp4 or btrfs file system (though it seems to a bit more tricky with btrfs, see the link above), but ideally you should put it on the SSD (e.g. in your root directory), for the sake of performance.

If you're using a laptop and want it to hibernate when the lid is closed, the swap partition will probably be faster and better than a swap file. To be safe, make it 1.5x the size of your RAM, though you can probably get away with a much smaller one if space is a concern.

1 Like

I suggest either XFS or ext4 with a higher bytes-per-inode ratio (mkfs.ext4 -i), as your photo partition will probably hold mostly larger files > 1MB.
Btrfs, not so much for that specific purpose.

1 Like

I know how to create swap file on ext4 and btrfs
So no problem here.
It's standalone pc with 16GB of ram so it's probably enough

Raw or jpg are > than 10 MB
Darktable creates XML files smaller than 1MB

To be honest I don't understand -i
I usually create partitions with gparted

The default is 16 KB per inode, meaning that each file will at least occupy 16 KB even if it is smaller. ---EDIT: that's just wrong, apologies
On partitions that only hold large files, you will waste a lot of inodes with the defaults, hence the suggestion to increase it to e.g. 512K or more.
You can of course just stay with the defaults and be done with it.

It's a switch for mkfs.ext4 - the tool that formats ext4 filesystems.

I might be a newbie but I understand this :slight_smile:
Inode is the thing new for me.

I thought that it's block size description

The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block location(s) of the object's data.[1] File-system object attributes may include metadata (times of last change,[2] access, modification), as well as owner and permission data.[3]

Directories are lists of names assigned to inodes. A directory contains an entry for itself, its parent, and each of its children.
(Source: Wikipedia)

You cannot change the ratio after formatting.
XFS doesn't need this is, as (AFAIK) it has dynamic inode allocation.

Blocksize cannot be higher than 4K with ext4/xfs on Linux, and 4K is also the default - it equals the page size.

1 Like

I would strongly recommend against that for kernel 5.3 and later, because the paging algorithm was completely revised for 5.3, and once it starts swapping, it will do so aggressively and erratically, with hundreds of MiB being paged out and back in all the time.

At that rate of swapping, 5.3 and later kernels are certifiable SSD killers. You can trust me on that. :thinking:

1 Like

Not questioning your info, just curious if you had some good links. That is rather bad news for SSD owners if true.

Luckily I stick to the older LTS kernels so not an issue for me.

1 Like

Forum kindly sponsored by