LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 05-26-2002, 03:32 PM   #1
mdscudder
LQ Newbie
 
Registered: Mar 2002
Location: Johnson City, NY
Distribution: Slackware 8
Posts: 9

Rep: Reputation: 0
10GB of files take up 16GB of space?


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?

Thanks,
-Mark
 
Old 05-26-2002, 07:57 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
By default 5% of disk space is reserved for root. You can change this setting using -m option of mke2fs.
 
Old 05-26-2002, 11:58 PM   #3
mdscudder
LQ Newbie
 
Registered: Mar 2002
Location: Johnson City, NY
Distribution: Slackware 8
Posts: 9

Original Poster
Rep: Reputation: 0
5% of 40GB is 2GB.

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.

-Mark
 
Old 05-27-2002, 12:54 AM   #4
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
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.

Regards
 
Old 05-27-2002, 02:19 AM   #5
DeadPuddle
Member
 
Registered: Mar 2002
Location: Asheville, NC
Distribution: Debian
Posts: 257

Rep: Reputation: 30
Interesting.
 
Old 05-27-2002, 02:28 AM   #6
mdscudder
LQ Newbie
 
Registered: Mar 2002
Location: Johnson City, NY
Distribution: Slackware 8
Posts: 9

Original Poster
Rep: Reputation: 0
Isn't it?

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.
 
Old 05-27-2002, 02:31 AM   #7
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
128k nodes means that a 1k file takes 128k, and a 129kb file would use 256k.

No wonder you have so much wastage

Regards
 
Old 05-27-2002, 02:57 AM   #8
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
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.
 
Old 05-27-2002, 10:08 AM   #9
jkcunningham
Member
 
Registered: May 2002
Location: Seattle, WA, USA
Distribution: Gentoo
Posts: 136

Rep: Reputation: 15
How do you tell what the inode size is for your file system?

-jeff
 
Old 05-27-2002, 10:47 PM   #10
shoot2kill
Member
 
Registered: Jan 2002
Location: California
Distribution: Red Hat
Posts: 402

Rep: Reputation: 30
df -i
 
Old 05-28-2002, 10:42 PM   #11
nicslinux2
LQ Newbie
 
Registered: May 2002
Distribution: red hat 7.3
Posts: 6

Rep: Reputation: 0
i have a question, if you do want to change your node setting, how is it that it is done? thank you
 
Old 05-29-2002, 06:33 AM   #12
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Copy the data elsewhere and reformat with appropriate parameters.

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
16GB RAM -Kerbel support niranjan_mr Linux - Hardware 7 09-05-2005 05:14 AM
16GB RAM -Kernel support niranjan_mr Linux - Hardware 1 09-01-2005 01:21 AM
What to do with spare 10GB? mikieboy Linux - Software 3 03-11-2005 03:30 PM
cannot transfer (FTP) 10GB file, also scp dont work freebies Linux - Software 2 02-25-2005 12:38 AM
[B]Free Limited 10GB in DVDs/CDs Linux Technical Resource Kit[/B] aherm Linux - Distributions 1 07-08-2004 09:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration