Tomb icon indicating copy to clipboard operation
Tomb copied to clipboard

Documentation for minimum resize amount

Open ultimatespirit opened this issue 1 year ago • 1 comments

Looking at the source, and attempting a resize directly, it appears that tomb restricts resizing a tomb to 150MiB increments: https://github.com/dyne/tomb/blob/ff692999de9fdec625ffab60c57f3cc6cf1ccd16/tomb#L2849

This is not reflected in the documentation, and is also a really odd limit. Is there any documentation for why we have such a limit?

Looking at the git blame: https://github.com/dyne/tomb/commit/48c08c00863ddc0558b9be6ece6fe23904547d05

It seems to somehow be related to btrfs, but I am not familiar with any restriction on btrfs's ability to resize arbitrarily that would lend itself to needing a 150MiB minimum. Certainly not finding that at all in its documentation.

Actionable items to consider:

  • At least document the limit and why it exists.
  • Ideally, why not have these cases fall back on creating a new volume encrypted with the same key file of the requested size and copying contents over?
  • If the reason is somehow related to btrfs, detect the filesystem and enforce the limit only for btrfs
  • If there's no hard technical reason from filesystems, consider not having the limit.

P.S. It's very odd that btrfs resizing involves creating a directory under $HOME instead of /run/media/$USER/, which is where tomb open normally seems to go: https://github.com/dyne/tomb/blob/ff692999de9fdec625ffab60c57f3cc6cf1ccd16/tomb#L2894

ultimatespirit avatar Oct 03 '24 11:10 ultimatespirit

The limit comes from empirical tests: I've tried all values manually until I've found the minimum one that works, all other values keep failing on my installation.

p.s. good catch!

jaromil avatar Dec 30 '24 23:12 jaromil