3

What Linux filesystem type can I use to not attempt recovery of inconsistencies on start up, but instead discard them (free the space) and mount quickly?

I have an application which uses a lot of space for caching its results. The cache is not precious; when there are inconsistencies detected on start up, I would rather the kernel quickly free the space and continue mounting the volume.

This is one of the features of a ‘tmpfs’ volume, but the size of the volume is too large to consume RAM for this. Speed (after mounting the volume) is not a primary criterion, so slower and larger storage is preferred.

The cache is currently on the default ‘ext4’ filesystem type. The delay of resolving inconsistencies at mount time is not onerous, but it is needless (the space can simply be freed), so I'd prefer to avoid it.

Rather than exploring why to do this, I'd like to know what filesystem type has these properties so that I know how feasible this option is.

What filesystem type supported by Linux can I use for this?

  • 4
    Should the cache normally be preserved across reboots? Could you just create a separate partition/filesystem for you cache that gets re-created on each reboot? – Zoredache Dec 15 '16 at 0:18
  • How big is this filesystem? What hardware is it running on? How often do you get these inconsistencies? – Andrew Henle Dec 15 '16 at 3:06
  • What filesystem are you already using? Nothing modern should be giving you any significant delays on mounting. – Michael Hampton Dec 15 '16 at 3:09
2

Freeing space due to inconsistencies is making a huge flawed assumption -- that the corruption is to do with files, not the actual structure of the filesystem.

Some corruption simply cannot be fixed by merely freeing the associated space. What if the space it frees is a base directory for all the tree of directories you keep your data?

Just use tmpfs. Create a big swap file or partition.

tmpfs will be swapped out if necessary in favour of other items.

If you do this you'll want to set the vm.swappiness kernel knob to 100 to make cache and anonymous memory values equal to one another.

Edit: I prefer @zordache answer. Just rectreate the filesystem on startup on the associated disk that uses it.

-3

Based on current responses it seems the answer is there is no filesystem type provided with Linux that meets the requirements.

  • Are you just going to ignore the people who asked you for clarification, then? – Michael Hampton Dec 17 '16 at 13:48
  • I've addressed those questions, though they don't appear to affect this answer. – bignose Dec 18 '16 at 2:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.