Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to know this, as in many websites I found only Max. filesystem size, but not minimum size. I have to choose between Ext4 and Btrfs for some system, and this is one of the parameters.
I also created filesystem of various sizes, but couldn't come to any conclusion.
Hope I have answered your question "why"
So--take EXT4 for example. If the minimum block size is 1024 bytes---I assume that means the space available to store data. There is then some overhead required---if the EXT4 spec. does not describe this, then you have a minimum of 2 options:
1. Dig thru a working partition and see how much space is being used for overhead.
2. Try smaller and smaller sizes until you find the limit. This will be tedious---at least using fdisk, I can't create a new partition and install a file system without rebooting
Quote:
I have to choose between Ext4 and Btrfs for some system, and this is one of the parameters.
Let's take a wild guess that EXT4 requires 20 blocks of overhead---add one block for data, and you have a minimum partition size of 21 blocks, but you can only store 1Kbyte. Is this useful? Probably not-----but tell us exactly what the system is supposed to be doing, and maybe there will be a better answer.
I need to know the minimum partition size one can create using Ext4 and minimum partition size one can create using Btrfs.
*shrug* you don't need us to test that: just 'dd bs=1 count=1024' (or less) some /dev/random to a file, loop-mount it, create your file system, check and if it is accessible create smaller ones.
By invoking "mkfs.btrfs" I get message that 256MB is required at least. For ext4 you can use "resize2fs -P /dev/sd??" to get approximated minimum size (it depends on journal, inode size, etc., with 1MB nad 1kB blocks it prints 2353 blocks in my system).
2. Try smaller and smaller sizes until you find the limit. This will be tedious---at least using fdisk, I can't create a new partition and install a file system without rebooting
It would be quick to create a virtual filesystem in a file, e.g.
Code:
$ dd if=/dev/zero of=disk-image count=4096
4096+0 records in
4096+0 records out
2097152 bytes (2.1 MB) copied, 0.0406892 s, 51.5 MB/s
$ ls -l disk-image
-rw-r--r--. 1 colucix users 2097152 May 24 12:04 disk-image
$ /sbin/mkfs -t ext4 -q disk-image
disk-image is not a block special device.
Proceed anyway? (y,n) y
$ file disk-image
disk-image: Linux rev 1.0 ext4 filesystem data (extents) (huge files)
The limit of an ext4 filesystem should be 4096 blocks of 512 bytes, that is about 2 Mb. It depends on the minimum size to store the filesystem journal, other than inode and superblock sizes that are smaller. This is from a theoretical point of view, since - as already pointed out - a physically minimum filesystem is not usable.
Maybe a partition issue. I didn't ponder on that at all.
Red Hat docs say that / needs to be 250M but that doesn't mean that you can't create a partition with less space. Indeed I have has some old systems that only had a 4M hard drive and multiple partitions.
Maybe if you don't trust encrypted flash drives and you don't want to monthly force yourself to remember a 20 digis /#*numbers_capital_etters_small_letters_numbers password, you can think to a micro encrypted volume for a backup on unsafe google or ms drive...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.