TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Compressed directories on Linux

70 点作者 jamesbowman大约 8 年前

12 条评论

shmerl大约 8 年前
Is there a way to mount loop device without sudo? Some kind of FUSE option?<p>It&#x27;s useful as a workaround for 32-bit applications which aren&#x27;t built with LFS (Large File Support) enabled, and because of that fail on large XFS partitions. It&#x27;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&#x27; is given), then mount will try to find some unused loop device and use that, for example mount &#x2F;tmp&#x2F;disk.img &#x2F;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=&#x2F;dev&#x2F;zero of=&quot;$image&quot; bs=1024K count=&quot;$img_size&quot; mkfs.xfs &quot;$image&quot; sudo mount -o loop &quot;$image&quot; &quot;$mount_path&quot; sudo chown $USER:$USER &quot;$mount_path&quot;</code></pre>
评论 #14288711 未加载
barrkel大约 8 年前
Note that it&#x27;s not recommended to use journalled filesystems on file-backed loopback devices: <a href="http:&#x2F;&#x2F;loop-aes.sourceforge.net&#x2F;loop-AES.README" rel="nofollow">http:&#x2F;&#x2F;loop-aes.sourceforge.net&#x2F;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&#x27;s a recipe for usability pain. Thin provisioning with sparse files won&#x27;t work well with a COW tree structured backing store like btrfs either.
评论 #14290622 未加载
wmu大约 8 年前
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&#x27;s not as bad as I suppose.
评论 #14290403 未加载
评论 #14290165 未加载
评论 #14289434 未加载
评论 #14289846 未加载
crypto5大约 8 年前
Will this cause double-buffering (one buffer for host FS and another for BTRFS) with doubled RAM consumption?
评论 #14289023 未加载
doomrobo大约 8 年前
I like this article style a lot. A very cool result, presented clearly and step-by-step, in less than a full screen of text.
评论 #14288713 未加载
Zardoz84大约 8 年前
Or you can simply use directly BTRFS with LZO compression enabled.
Filligree大约 8 年前
Or you could use a base filesystem that supports compression, such as ZFS. <i>shrug</i>
评论 #14289760 未加载
评论 #14288363 未加载
评论 #14289191 未加载
fsiefken大约 8 年前
With ZFS and LZ4 or LZ4HC you might get better compression, BTRFS is more lightweight though, so it&#x27;s a great solution. I wonder if encryption would be possible in a similar way.
评论 #14290486 未加载
jwilk大约 8 年前
From <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;showhn.html" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;showhn.html</a> :<p><i>Show HN is for something you&#x27;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 &quot;Show HN&quot; meterial.<p>Plase change the title to &quot;Using BTRFS with loopback for compressed directories&quot;.
pmlnr大约 8 年前
Use ZFS, create a dataset for the dir and turn compression on per dataset.
aeroevan大约 8 年前
How is this different than a chattr +c on the directory? I suppose the compress option doesn&#x27;t force compression (so it will try to recompress compressed files).
fuzzyfizz大约 8 年前
I don&#x27;t get it. How does this produce 1TB of storage with a 50GB backing store?
评论 #14297952 未加载
评论 #14293873 未加载