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.
This seems like a simple problem, but I need some advice so I'm not doing trial-and-error stuff on a live server.
I installed a 40GB hard drive in my Linux box and copied 10GB of files to it. Now it says there's only 24GB available. There weren't many small files (it is a web root directory, but there are mostly large files, (legal) mp3's actually, I used to do a radio show and I'm preparing an online archive). The mp3's range in size from 9MB to 45MB, and as far as small files for webpages and stuff there really aren't that many.
I formatted the drive by using mke2fs with no options (mke2fs /dev/hdc1). Here's the output of df for this drive:
/dev/hdc1 38464340 10567280 25943156 29% /wwwroot
...and the output of df -i:
/dev/hdc1 4889248 2272 4886976 1% /wwwroot
I think this is an inode problem but most of my technical knowledge is on the DOS/Windows side. I am really in need of 40GB of space here, not 30 or 25. And it's also a very expensive waste of space. Can somebody explain what's going on, or what inodes are and how they work, and how to get out of this pickle?
10GB of files + 2GB reserved for root is 12. 40 minus 12 is 28. I think 4GB of slack space is a little unreasonable. I still think there's something wrong.
Regardless of a file's size, the amount of space it takes up on a partition is a minimum of 4k and then a mulitple of 4k up to the filesize.
For example, a file of 128 bytes will occupy 4k of diskspace, the minimum blocksize, but will be reported as only taking up 128 bytes of space.
A file that's 4.5k in size, will take up 8k of physical space on the disk.
This is a filesystem limitation. Some filesystems offer ways of using this space more efficiently. For example, reiserfs uses a technique called "clustered tails" to reduce this wastage.
Anyway I figured out by myself that apparently I have 128k inodes on this partition and I guess I need to reformat it and specify that I want 4k inodes. Thanks anyway.
According to the output of your df command you have 38464340 1k blocks. Which is 39387484160 bytes but would be 36.68 GB. If you add on the size of the inode tables and the rest of the disk administration you would get to about 40 billion bytes. For a lot of older disks they used to like to calculate in 1000's instead of 1024's leaving you with a lot less disk space. I don't know if they still do that, but you might want to find out if your disk is actually capable of containing 40GB's.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.