Missing space on empty partition
Hi,
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: Code:
/dev/sda5 52373796 15032 52358764 1% /media/data Output from fdisk -l (the partition in question is sda5): Code:
Disk /dev/sda: 250.1 GB, 250059350016 bytes |
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?
|
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 edit: Without physical access to the HD and not knowing its history I have no idea what's going on .. |
Quote:
Code:
# fdisk /dev/sda Hope it will fix the problem. |
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! |
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. |
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. |
All times are GMT -5. The time now is 06:39 AM. |