LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2006, 05:30 PM   #1
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
What size is my disk/data really?


I have a 200GB SATA drive divided into 2 equal partitions.
According to GParted, both partitions are 93,1GB. HOWEVER, according to the System Monitor (I'm using Gnome 2.14.3) the first partition is only 50.4GB

On the first of the partitions I store my music files. According to DU I have 42GB of files on the drive.

When I right-click on the mountpoint for the partition in Nautilus and look at the properties I also get that information, BUT it also informs me that I have 6.2GB of free space. 93.1GB - 42GB = 6.2GB??? That doesn't add up. What is going wrong (or what am I missing? Where did the other +40GB go?
 
Old 08-25-2006, 06:09 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,561

Rep: Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108
Done a filesystem check on them ???.
What about the inode usage ???.
 
Old 08-25-2006, 06:22 PM   #3
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
I think there are two main factors. The first is that to an engineer, one kilobyte = 1,024 bytes, but to a marketing person, one kilobyte = 1000 bytes, and guess who decides how to label the box. Scale that up to a meg or a gig, and all those 24 byte differences start to add up. Your 200G drive does contain 200G of writable space, but it's equal to the scientific definition of 200G. Secondly, root reserves part of the space for its own use, just in case. (IIRC, it's about 4%-5%) The idea behind the reserved space is to act as a buffer against any possible runaway "write" processes that could fill up the drive. If there literally was no space on drive, then the computer couldn't boot because it would not be able to write anything to the disk.
 
Old 08-25-2006, 09:27 PM   #4
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
Actually the prefixes "kilo", "giga", "mega" etc. are very well established in math and science circles as orders of 10. To say that a kilo is 1024 is incorrect - the proper term is "kibi" as proposed by the International Electrotechnical Commission (IEC) (likewise "gibi", "mebi"). The marketing people actually got it right this time.

Anyway, I would recommend opening up a terminal and running the "df" command. Also I don't know about Nautilus but Konqueror has excellent disk usage view modes - you might consider checking it out as well.
 
Old 08-25-2006, 10:09 PM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 85
Quote:
Originally Posted by ciotog
Actually the prefixes "kilo", "giga", "mega" etc. are very well established in math and science circles as orders of 10. To say that a kilo is 1024 is incorrect
Yes, but No. While the prefix "kilo" means "thousand", in this context I believe my response remains accurate. Computers are binary systems, and in the context of a binary system, "kilobyte" means 1024, or more specifically, 2^10 bytes. The "kibi" term you mention perhaps is helpful in distinguishing between the two definitions, but I think its weakness is that it's only a proposed standard, and it's not widely used. Assuming that the Wikipedia entry is considered valid and factual, readers can form their own opinions.
 
Old 08-25-2006, 10:50 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,561

Rep: Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108
This bickering isn't going to help the OP - how about you leave it folks, it's been done to death enough times.
Nor does it explain a better than 40% discrepancy observed - regardless of the base used to derive the math.
 
Old 08-26-2006, 01:06 AM   #7
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
Who's bickering? The different reporting mechanisms for disk size are certainly relevant to the discussion, as they do play some factor. If the OP happens to learn something more than they asked for then all the better.

As for this discussion being done to death, if you search linuxquestions for "gibi mebi kibi" you'll see how often it's been raised here.

Finally, since I don't take "shush" posts well, here's a link to another wikipedia entry that some may find interesting:
http://en.wikipedia.org/wiki/Binary_prefix
 
Old 08-26-2006, 03:39 AM   #8
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993

Original Poster
Blog Entries: 1

Rep: Reputation: 46
Quote:
Originally Posted by syg00
Done a filesystem check on them ???.
What about the inode usage ???.
I'm looking into fschk (never used it before), but I'm not sure about what exactly you mean by 'inode usage'. I seem to remember that files don't necessarily take up the space they need, but rather the nearest approximate space depending in the ?? of the filesystem (like 32 in fat32). However, that doesn't look like it might be the case, as the average filesize is around 3MB and if I remember correctly what I described would be especially noticeable with very small files.
 
Old 08-26-2006, 03:50 AM   #9
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993

Original Poster
Blog Entries: 1

Rep: Reputation: 46
J.W., Ciotog: I appreciate the explanations - I was aware of the fact and the relatively small difference between the label of the drive (200GB) and the actual partition sizes as reported by GParted (2x93.1GB) was expected.
The problem I described only refers to the first partition, as the second reports its space correctly. It even reports more space than ought to be possible: 90GB used, 11GB free.

The question was not 'where did the 3-4% go, but what happened to the 40% that appears to be missing

P.S.
Quote:
$ sudo /sbin/fdisk -l /dev/sda

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 12159 97667136 83 Linux
/dev/sda2 12160 24321 97691265 83 Linux
The number of blocks would (almost) add up to 200GB using a 1000 base (instead of 1024) and part of the missing 3% would have been lost creating partitions. Also there is the MBR...
 
Old 08-26-2006, 04:01 AM   #10
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Surely it's just a plot to reserve just enough space to install MS Windows Vista on your harddisk in the dark hours of the night when you're not aware and those creepy MS engineers crawl from under your bed to poison the computer...

..or not Anyway, is it possible that you took the harddisk and inserted it onto another computer as a slave, with another OS than yours on board, and see if that counts the space the same way? Maybe too big a trick to do, but if you're out of ideas, it doesn't harm to try..
 
Old 08-26-2006, 04:51 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,561

Rep: Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108
"df -i" - chack there aren't any suspect numbers.
 
Old 08-26-2006, 06:23 AM   #12
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993

Original Poster
Blog Entries: 1

Rep: Reputation: 46
I ran e2fsck (output below) but there's no change in the free space / used space nautilus sees

Quote:
# /sbin/e2fsck /dev/sda1
e2fsck 1.38 (30-Jun-2005)
/dev/sda1 has gone 228 days without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
/lost+found not found. Create<y>? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda1: 7756/6717440 files (16.1% non-contiguous), 11086804/13430332 blocks

P.S After reading man fsck I found out I should unmount the partition before running e2fsck. THat makes it a littel difficult to make it an automated task... or does it?
 
Old 08-26-2006, 10:45 AM   #13
ciotog
Member
 
Registered: Mar 2004
Location: Canada
Distribution: Slackware current
Posts: 728
Blog Entries: 2

Rep: Reputation: 43
fsck for ext2/ext3 filesystems usually runs automatically on mount, every 20 mounts or so (this can be changed using the tune2fs program). If you wanted to force a fsck on every mount, you would run "tune2fs -c 0 /dev/sda1".

To see the number of blocks marked bad, you should run "dumpe2fs -b /dev/sda1"

Also as has already been suggested twice, you might wish to see the output of "df" or "df -i" (note that df has an option -si so that it follows the correct standard of using powers of 10 ). Also try running Konqueror, and browse the filesystem using the view -> "View Mode" -> "File Size Mode" to see if there are any unusually large directories (like tmp) that are somehow consuming lots of space but aren't being reported correctly.
 
Old 08-26-2006, 01:15 PM   #14
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993

Original Poster
Blog Entries: 1

Rep: Reputation: 46
Quote:
$ df
Filesystem 1K-blocks Used Available Use% Mounted on
[snip]
/dev/sda1 52878108 43957064 6234980 88% /mnt/files1
Why would df think the partition is only 50GB when fsdisk reports 93GB?

Suddenly all sorts of alarms are going off in the back of my head! The partition used to be 50BG and I used QTparted from knoppix to stretch it to 50% of the HDD. I suppose somehow the ext3 file system wasn't extended properly to cover all of the new partition size. That means I need to recreate the ext3 file system, but without destroying the data that's already on the disk, or making it inaccessible by overwriting the 'index' (is thet the inode table? - I appear to remember something like that.)

How would I go about doing that?

Quote:
# /sbin/fdisk /dev/sda1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.


The number of cylinders for this disk is set to 12158.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
That doesn't appear to be a valid option....

mkfs appears to be destructive (with respect to the existing data)...
 
Old 08-26-2006, 05:08 PM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,561

Rep: Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108Reputation: 3108
Quote:
Originally Posted by linmix
Suddenly all sorts of alarms are going off in the back of my head! The partition used to be 50BG and I used QTparted from knoppix to stretch it to 50% of the HDD. I suppose somehow the ext3 file system wasn't extended properly to cover all of the new partition size.
Arrrrhhhh !!!!
I hate it when people with-hold important information. This is hardly "oh, by the way ..."
You're the one wanting help here - are we all expected to be bloody mind-readers ???.

Look up ext2resize on sourceforge.
Take note of my signature.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
floppy only reads first disk, if new disk is inserted data from first disk is shown. lakosked Debian 3 02-18-2006 08:44 PM
how to get the data of a disk anywhere? nice007 Linux - Newbie 1 03-24-2005 05:42 AM
Data buffer size MarcReing Programming 7 10-21-2004 12:51 PM
Why should you give the size of the swap disk as twice the size of RAM vmniza Linux - Newbie 3 09-17-2004 02:13 AM
Large disk size Shaddell Linux - General 1 01-07-2003 09:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration