1 (edited by josh_elbarto 2009-02-28 20:18:01)

Topic: Too much space used after format 500GB HDD with ext3 file system

I tried to format my new 500GB hdd with the ext3 fs, but when gparted finish and rescan the hdd, appears that 3% of disk was used (almost 15GB) and when I see the disk properties the space used is the double.

I think that is too much space only for manage the file system.

Finally I opted for reiserfs because after the format the disk usage was only a few MBs

I want to try the new ext4 fs, but in a virtual machine with ubuntu 9.04 alpha 5 I have the same problem with a 10GB independent virtual drive, after the format is used 350MB (again 3%) and the double size in the disk properties

I have a big doubt: This is normal? And if the response is affirmative... Why?

Thanks a lot for the help and responses big_smile

PD: Sorry if my english is not good, I need more practice tongue

2

Re: Too much space used after format 500GB HDD with ext3 file system

There is always a part of the disk space that is reserved for root. There is a default % for this reserved space. We can reserve less or more space by using the manual formatting from the command line, with the appropriate parameters. However, we can't make it 0%.

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3

Re: Too much space used after format 500GB HDD with ext3 file system

Hi!

As far as I know, ext2/3 (and maybe ext4 as well) use fixed-size management data structures that are written once during creating the file system - and never extended afterwards (unless you don't resize the file system). As a result, the management structures do always consume the same amount of space on your partition, no matter how much data you have stored there.
In contrast to this, some other file systems - ReiserFS is one of this kind, I think - allocate space for their management structures dynamically - that is, management structures start off consuming very little space ruight after creating the file system, but grow as you put more data on the drive. In the end, this approach can lead to the same amount of storage space used for management as in a file system that has fixed-size management structures - so don't let yourself be fooled by the amount of "used" space on your freshly-formatted ext3 partition!

However, there are some options that can be passed to the mkfs.ext2 command which influence the size of the management structures. Most important of these options are the -i option (this one defines the ratio of inodes per storage space - that is, you can influence how many bytes of storage space one inode should "take care of") as well as the -I option (which defines the amount of storage space occupied by one inode). Please note that these values can not be changed once the file system is created - you have to re-format the partition if you want to change one of them. And since the first of these options indirectly defines the total number of inodes on your partition, and since each inode can represent only one single file or directory, it also limits the number of files that can be stored on your partition! As a result, you can tune the number of inodes to your current needs (like, e.g., one inode per 128 MBytes - this could minimize the overhead occupied by the inodes on a file system that is reserved for storing movies, CD-ROM ISO images or other large files of several 100 MBytes each - but if you want to put your photo collection there, you won't be able to get the partition only halfway filled since you'd run out of inodes far before this point).

In addiotion to this, there's in fact some storage space reserved for the root user. However, this percentage can easily be changed once the file system is created - using the tune2fs command:

tune2fs -m 1 /dev/sda1

would reserve 1% of the stprage space on /dev/sda1 for the root user. Note that this value can be changed only while the file system is not mounted!

4

Re: Too much space used after format 500GB HDD with ext3 file system

Ohh!! yikes

Thank you very much for the explanation! I didn't know about of the dynamic management

Actually, I'm practically new in the linux world and I have many things to learn yet.

Then I'll wait for the release of ubuntu 9.04 to migrate my hdds to ext4, and while I'll do a backup

And  thank you again for the help big_smile