Is there a way to make ext-filesystems use less space for themselves in Linux? - Super User most recent 30 from superuser.com 2019-03-26T20:54:30Z http://asianhospital.com/?id=feeds/question/1346350 http://www.creativecommons.org/licenses/by-sa/3.0/rdf http://asianhospital.com/?id=q/1346350 48 Is there a way to make ext-filesystems use less space for themselves in Linux? confetti http://asianhospital.com/?id=users/926024 2018-08-05T18:36:58Z 2018-08-07T15:44:07Z <p>I have a bunch of external and internal HDDs that I use on a Linux system. I only have Linux systems, so using a Linux file-system would only make sense, right? However I'm currently using NTFS everywhere, because it gives me the most usable space out of HDDs.</p> <p>I would like to switch to Linux file-systems now though, mostly because of permissions and compability (e.g. I can't get my LUKS encrypted NTFS partition to resize under Linux, keeps telling me to chkdsk under Windows).</p> <p>However when I formatted those HDDs I tried out a bunch of different filesystems and every Linux filesystem, even ext2 which as far as I know has no journaling, used a lot of space for itself. I don't recall exact values, but it was over 100GB that NTFS got me more on a 2TB HDD, which is a lot.</p> <p>So my question is: Is there a way to make ext-filesystems use less space for themselves? Or is there another filesystem (I've tried ext2, ext3, ext4, NTFS and vfat - None of them came even close to the usable space NTFS offered me) with perfect Linux support and great usable space?</p> <p>I'd love to hear about how and why filesystems (especially ext2 which has no journaling) use that much more space than NTFS and I don't know where else to ask. I'd mostly prefer a way to use ext4 without journaling and anything else that uses up this much space, if that's possible.</p> http://asianhospital.com/?id=questions/1346350/-/1346351#1346351 94 Answer by harrymc for Is there a way to make ext-filesystems use less space for themselves in Linux? harrymc http://asianhospital.com/?id=users/8672 2018-08-05T18:44:57Z 2018-08-05T19:07:24Z <p>By default, ext2 and its successors reserve 5% of the filesystem for use by the root user. This reduces fragmentation, and makes it less likely that the administrator or any root-owned daemons will be left with no space to work in.</p> <p>These reserved blocks prevent programs not running as root from filling your disk. Whether these considerations justify the loss of capacity depends on what the filesystem is used for.</p> <p>The 5% amount was set in the 1980s when disks were much smaller, but was just left as-is. Nowadays 1% is probably enough for system stability.</p> <p>The reservation can be changed using the <code>-m</code> option of the <code>tune2fs</code> command:</p> <pre><code>tune2fs -m 0 /dev/sda1 </code></pre> <p>This will set the reserved blocks percentage to 0% (0 blocks).</p> <p>To get the current value (among others), use the command :</p> <pre><code>tune2fs -l &lt;device&gt; </code></pre> http://asianhospital.com/?id=questions/1346350/-/1346459#1346459 3 Answer by hanshenrik for Is there a way to make ext-filesystems use less space for themselves in Linux? hanshenrik http://asianhospital.com/?id=users/519577 2018-08-06T07:57:07Z 2018-08-06T08:08:25Z <p>if the data you intend to store on it is compressible, btrfs mounted with <code>compress=zstd</code> (or <code>compress-force=zstd</code>) would probbaly use significantly less disk space than ext*</p> <ul> <li>this will make btrfs transparently compress your data before writing it to disk, and transparently decompress it when reading it back. also, ext4 pre-allocate all inodes at filesystem creation, btrfs creates them as needed, i guess that might save some space too.</li> </ul> http://asianhospital.com/?id=questions/1346350/-/1346883#1346883 3 Answer by glglgl for Is there a way to make ext-filesystems use less space for themselves in Linux? glglgl http://asianhospital.com/?id=users/92891 2018-08-07T15:44:07Z 2018-08-07T15:44:07Z <p>Another point which has not been talked about yet is the number of inodes you reserve on your file system.</p> <p>Per default, mkfs creates a number of inodes which should make it possible to put a whole lot of very small files into your file system. If you know that the files will be very big and you will only put a small number of files on the FS, you can reduce the number of inodes.</p> <p>Take care! This number (resp. the ratio between space and number of inodes) can only be set at the file system creation time. Even when extending the FS, the ratio remains the same.</p>