Is there a way to mount loop device without sudo? Some kind of FUSE option?<p>It's useful as a workaround for 32-bit applications which aren't built with LFS (Large File Support) enabled, and because of that fail on large XFS partitions. It's a very common bug in games which come out in 32-bit only. Making a loop device is a workaround, but using sudo for it all the time is annoying.<p>Also, there is probably no need to explicitly create a loop device, unless you already used up all existing ones (see man mount):<p><pre><code> if no explicit loop device is mentioned (but just an
option `-o loop' is given), then mount will try to find
some unused loop device and use that, for example
mount /tmp/disk.img /mnt -o loop
</code></pre>
I.e. in such case I simply create an empty file of certain size, then format it with some filesystem, and then mount it as a loop.<p>For example:<p><pre><code> dd if=/dev/zero of="$image" bs=1024K count="$img_size"
mkfs.xfs "$image"
sudo mount -o loop "$image" "$mount_path"
sudo chown $USER:$USER "$mount_path"</code></pre>
Note that it's not recommended to use journalled filesystems on file-backed loopback devices: <a href="http://loop-aes.sourceforge.net/loop-AES.README" rel="nofollow">http://loop-aes.sourceforge.net/loop-AES.README</a><p>This approach is not a useful path to lower overall disk usage IMO because you need to thick provision the directory up front, with an estimate of overall compressed disk usage. That's a recipe for usability pain. Thin provisioning with sparse files won't work well with a COW tree structured backing store like btrfs either.
What about data safety? Say, a hard drive got a bad sector, then a whole file is broken. This always stopped me from using system-wide compression. But maybe it's not as bad as I suppose.
With ZFS and LZ4 or LZ4HC you might get better compression, BTRFS is more lightweight though, so it's a great solution. I wonder if encryption would be possible in a similar way.
From <a href="https://news.ycombinator.com/showhn.html" rel="nofollow">https://news.ycombinator.com/showhn.html</a> :<p><i>Show HN is for something you've made that other people can play with. HN users can try it out, give you feedback, and ask questions in the thread.</i><p>This blog post is not a "Show HN" meterial.<p>Plase change the title to "Using BTRFS with loopback for compressed directories".
How is this different than a chattr +c on the directory? I suppose the compress option doesn't force compression (so it will try to recompress compressed files).