Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-29-2013, 05:20 AM   #1
LQ Newbie
Registered: Jun 2013
Posts: 4

Rep: Reputation: Disabled
Missing space on empty partition

I have a partition that I'm intending to use for general data storage. The partition size is 110 Gb. It previously had some files on, which I've now deleted - and yet nautilus and gparted are both showing 60 Gb as still used!
However, df correctly reports the partition as almost empty:
/dev/sda5             52373796     15032  52358764   1% /media/data
I've tried restarting, unmounting and remounting the partition, but no change and I'm not sure where to go now - any help appreciated.

Output from fdisk -l (the partition in question is sda5):
Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb5edc124

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         392     3148708+  82  Linux swap / Solaris
/dev/sda3             393       30023   238009924+   5  Extended
/dev/sda5           15673       30023   115272259+  83  Linux
/dev/sda6             393        3917    28311552   83  Linux
/dev/sda7            3917       15673    94424064   83  Linux

Partition table entries are not in disk order
Old 06-29-2013, 06:37 AM   #2
LQ Newbie
Registered: Jun 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
Actually, df doesn't report correctly either. df shows the partition as being about 50 Gb in size; Gparted shows it as being 110 Gb, with 50 Gb free (natilus also shows 50 Gb free). Any ideas as to what's going on?
Old 06-29-2013, 06:45 AM   #3
LQ Newbie
Registered: Jun 2013
Location: NL
Distribution: Kali-Linux, Debian
Posts: 20

Rep: Reputation: 15
If you're sure you don't need anything on the partition: delete it and create a new one of the same size.
That should clear things up

Without physical access to the HD and not knowing its history I have no idea what's going on ..

Last edited by jazz5150; 06-29-2013 at 06:49 AM.
Old 06-29-2013, 08:23 AM   #4
Registered: Mar 2013
Distribution: Redhat, Ubuntu
Posts: 525

Rep: Reputation: 141Reputation: 141
Originally Posted by AlligatorDundee View Post
Partition table entries are not in disk order
Try this first:
# fdisk /dev/sda

Command (m for help): x

Expert command (m for help): f

Expert command (m for help): r

Command (m for help): w
And then, boot in rescue mode, and run fsck -y on all partitions.

Hope it will fix the problem.
Old 06-29-2013, 02:15 PM   #5
LQ Newbie
Registered: Jun 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
I decided to delete it and recreate the partition, as I thought that would be faster than running fsck on the whole drive. Reading a little, it seems like the problem may have been that I expanded the partition a while ago, but for some reason the file system didn't get expanded into the empty space. So the problem's probably been there for a while, but I only noticed it when I deleted everything. There seems to be a bug in GParted which makes it think the file system always fill the entire partition, so it was reporting 60 Gb used (= partition size of 110 Gb - free space of 50 GB).

Anyway - all sorted now, the new partition is properly empty (apart from the space for the inodes etc) so all is good, thanks!
Old 06-29-2013, 07:28 PM   #6
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,987

Rep: Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217
You were misunderstanding what you were seeing.
df is only concerned with filesystems - if it was less than the partition size as you say, then df sees the total size and "free" only as it pertains to the filesystems. The partition-level tools (parted included) see unallocated space within the partition as free.

Unfortunate overloading of the terminology.
Old 06-30-2013, 05:44 AM   #7
LQ Newbie
Registered: Jun 2013
Posts: 4

Original Poster
Rep: Reputation: Disabled
You're correct about df, but I still think there's a bug in GParted: it was reporting 60 Gb within the partition as used, when it was not. There was 110 Gb of free space in the partition, of which 50 Gb was free space in the filesystem, and 60 Gb was space not allocated to the filesystem at all. GParted showed the latter as used - it would be much better if it showed it as it really is, ie. with the filesystem filling less than the whole partition.

I'm not sure how easy that would be to change, I've read on another thread that GParted calculates the used space by calling df to get the free space and then doing (partition size - free space) to get the used space. I can understand why it might do that (it's probably a lot faster than working out how much space is actually used by all the files?) but it can lead to confusion - as it did for me.


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
df shows Missing Space on partition duryodhan Slackware 5 04-15-2008 09:21 AM
Missing Space on Root Partition newtommy Linux - General 2 11-27-2005 11:17 AM
Parted won't partition empty space phillywize Linux - Newbie 4 01-04-2005 11:42 AM
Missing HD Space (?), partition questions funaroma Linux - General 2 12-02-2004 10:09 AM
Restore a partition from empty space Rotwang Linux - Software 4 03-16-2004 10:26 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:03 AM.

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