why does my 8.05GiB ubuntu partition appear to be 6.7 GB

Asked by Daniel Thomas

In the spring I installed ubuntu edgy on my laptop and got slightly confused when partioning the drive. I ended up with two partitions one ntfs 29.21 GiB for windows and one 8.05 GiB partition for ubuntu. I know I should have a third for swap and in trying to do this I made my mistake.
I resized the 8.05 partion to have 1.something GB for swap, however something went wrong and after hitting errors a couple of times and going round through the install wizard a couple of times I ended up with two partitions the ext3 one was slightly weird but it installed so I forgot about it.
now I am using feisty fawn and I installed gparted so I could look at what had happened and try and find the problem.
because system monitor says the total amount of space on my ubuntu partition is 6.7 GB even when run as root.
I enclose a screenshot of gparted and system monitor so you can see the problem.
http://max.randor.googlepages.com/partions.png
I would like to recover the missing 1.5 GB that does not appear to be available to ubuntu, as when I upgraded from edgy to feisty I very nearly ran out of disk space and so I had to frantically delete stuff and move and link folders to the ntfs partition to stop it exploding in my face (I didn't know if that is what would happen but did not want to risk it). now soonish Gusty will be coming out and I don't want to have the same problems as I did last time.
Thank You.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
XioNoX (xionox) said :
#1

I've had the same problem.
I've solve it by re-repartitioning the partition.

Revision history for this message
Jim Hutchinson (jphutch) said :
#2

Two possible reasons.

1. there are two ways drive sizes tend to be measured: 1GB = 1000MB and 1GB = 1024MB

There is no constancy that I can see between which method is used. Drive manufactures seem to prefer the 1000MB version as it allows them to say the drive is larger than with the 1024MB option. Ubuntu also seems to use one or the other depending on the program in question.

2. I have not been able to confirm this, but I've heard that when installing Ubuntu sets up about 5% of the drive as reserve space to prevent you from filling it up and getting locked out. 8.05GB * 1000 = 8050 MB - 5% = 7647 MB or about 7.6 GB.

One of those (or a combination of the two) is probably what accounts for the discrepancy.

Revision history for this message
Bhavani Shankar (bhavi) said :
#3

yes.. what jim told is right... Ext2/3 uses about 5% of user space for the super user and system gets really murky if you completely run out of room on root...Programs won't start, errors will pop up, that sort of thing. With some room reserved for root, you can at least be sure to be able to run the really important programs (like sudo and so on).(another reason for this will be small swap size.. In which case also programs wont run and errors occur)
You can refer:
http://ubuntuforums.org/showthread.php?t=215177
Cheers,
Bhavani Shankar.

Revision history for this message
Daniel Thomas (drt24) said :
#4

The total available space is 6.7GB which is less than 7.6GB, and it is 6.7GB even when system monitor is run as root with sudo, which should? make it able to detect the bit that is hidden.
re partitioning the partition would result in the loss of all data on it? :-(.
the GiB/GB difference cannot account for the problem as GiB are bigger than GB and gparted is saying there are 8.05 GiB which means that system monitor should say ~8.25GB.
I think there is 1.something of space that is partialy partitioned or formatted as swap or something, I would be satisfied if all I could do was turn it into proper swap as I currently have 712mb of swap files on the ubuntu partition as well.

Revision history for this message
Bhavani Shankar (bhavi) said :
#5

Please go through the above thread and my explaination slowly...

Revision history for this message
Daniel Thomas (drt24) said :
#6

The partition is 8.05GiB in size the GiB GB difference would tend to make the GB value larger and the reverse is happening.
5% of 8.05 GiB is 0.4025
8.05 - 0.4025 is 7.6475 as Jim said
system monitor says that the size is 6.7GB
which means that ~0.9475GB is not accounted for by this method
which is ~1GB which is how much I tried to partition into swap when installing all that time ago.
Therefore The problem is not root space or GiB / GB (as this would go the other way)
Therefore it is something more complicated and interesting.
Therefore it is more fun.
:-)

Revision history for this message
Jim Hutchinson (jphutch) said :
#7

Hmmm, you are right. I can't get to 6.7 GB. Swap is a separate partition so it would not be included in the size of the installation partition. I believe the installer uses the 1000MB = 1GB version so if you set the partition to be 8.05 GB (at 1000MB/GB) then you have 8050 MB partition. If the system monitor uses 1024 MB = 1 GB (and I don't know if it does) then system monitor will report 8050 MB / 1024 = 7.86 GB. Now take out the 400 MB for the reserve and you have about 7.4 GB. I don't see how to get 6.7. I suppose there could be some accounting issues elsewhere but I'm not sure what. I've noticed mine never reports what I think it should either.

Open a terminal and type

df -h

or just

df

It will tell you your space usage as well. It may or may not be more accurate than the system monitor. The -h (or was it -H) will report the numbers in human readable form rather than bits or bytes. Of course you could do the math with the bits or bytes and see what that tells you.

Revision history for this message
Daniel Thomas (drt24) said :
#8

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 6.8G 5.6G 904M 87% /
varrun 244M 224K 244M 1% /var/run
varlock 244M 0 244M 0% /var/lock
procbususb 244M 120K 244M 1% /proc/bus/usb
udev 244M 120K 244M 1% /dev
devshm 244M 0 244M 0% /dev/shm
lrm 244M 33M 211M 14% /lib/modules/2.6.20-16-generic/volatile
/dev/disk/by-uuid/5CB8C476B8C45066
                       30G 24G 5.9G 81% /media/hda1
however as you can see from the screenshot posted earlier gparted says the partition is 8.05 GiB in size.

 sudo fdisk -s /dev/sda2
8442157
sudo fdisk -l

Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 3813 30627891 7 HPFS/NTFS
/dev/sda2 3814 4864 8442157+ 83 Linux

df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 7060308 5772972 928688 87% /
varrun 249800 232 249568 1% /var/run
varlock 249800 0 249800 0% /var/lock
procbususb 249800 120 249680 1% /proc/bus/usb
udev 249800 120 249680 1% /dev
devshm 249800 0 249800 0% /dev/shm
lrm 249800 33788 216012 14% /lib/modules/2.6.20-16-generic/volatile
/dev/disk/by-uuid/5CB8C476B8C45066
                      30627884 24569504 6058380 81% /media/hda1

Revision history for this message
Bhavani Shankar (bhavi) said :
#9

This is what jim and I said earlier.. Ubuntu reserves some amount of space to prevent your system going murky.. Here most of the missing space as you reported is used by the Kernel to load its modules and libraries.... 1% is used by usb bus for mounting and unmounting operation..

Can you help with this problem?

Provide an answer of your own, or ask Daniel Thomas for more information if necessary.

To post a message you must log in.