Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What is wrong with this picture?

Can somebody suggest the best (non-destructive) way to correct this?

Top is output from "df -h", bottom is gparted. I suspect I'm missing a lot of free space. No problems other than that (yet). Can somebody suggest the best (non-destructive) way to correct this?

sudo dumpe2fs -h /dev/sda3: (source http://pastebin.com/nAvrdT4E)

Filesystem volume name:   <none>
Last mounted on:          /
Filesystem UUID:          9f6eff64-60d7-4eec-81d5-1e8acd818b38
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash 
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              1602496
Block count:              6406144
Reserved block count:     320306
Free blocks:              4842284
Free inodes:              1361222
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1022
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8176
Inode blocks per group:   511
RAID stride:              32692
Flex block group size:    16
Filesystem created:       Sun Nov  8 18:18:13 2009
Last mount time:          Tue Mar  1 01:04:27 2011
Last write time:          Mon Feb 28 04:27:34 2011
Mount count:              16
Maximum mount count:      28
Last checked:             Thu Feb 24 06:23:39 2011
Check interval:           15552000 (6 months)
Next check after:         Tue Aug 23 07:23:39 2011
Lifetime writes:          227 GB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
First orphan inode:       268015
Default directory hash:   half_md4
Directory Hash Seed:      cc101517-e617-482b-a883-a72919419c84
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x001d3000
Journal start:            7787

fdisk and parted output per requests: http://pastebin.com/EGVH7Ken

SOLUTION: (thanks Hamish Downer) Boot to a liveCD and run "sudo e2fsck -f /dev/sda3" followed by "sudo resize2fs -p /dev/sda3"

share|improve this question
2  
Can you also post the output of sudo dumpe2fs -h /dev/sda3? –  arrange Mar 1 '11 at 20:22
    
Thanks for the interest: pastebin.com/nAvrdT4E –  bumbling fool Mar 1 '11 at 21:11
    
What's wrong exactly? A discrepancy between df -h and gparted? Do you have data loss here? The df command will give seriously wrong (well "different" is maybe a better word) results if you give it an unmounted system as an argument - what exact parameters did you use here? –  Scaine Mar 1 '11 at 21:11
    
Can you try df -h /dev/sda, and also df -h /dev/sda3, just to be sure. Thanks. –  Scaine Mar 1 '11 at 21:21
1  
The dumpe2fs is consistent with the df output, but not the GParted. Can you post sudo fdisk -l and sudo parted -l too? Is it a single disk, is it a RAID array? –  arrange Mar 1 '11 at 21:43

2 Answers 2

up vote 5 down vote accepted

Have you been resizing partitions? Pending the output of sudo fdisk -l /dev/sda I wonder if the partition /dev/sda3 as defined by the disk partition table (which fdisk will tell us) is 70.50 GiB, while the filesystem on the partition is only 25 GB.

If that is correct, then it would appear that GParted has a bug in that it assumes the filesystem is the same size as the disk partition, asks the filesystem how much space is free, and then assumes the rest of the disk partition is used.

Also, if that is correct, then you should be able to resize the filesystem to fill the partition. Backup any valuable data and then boot off a live CD (or live USB stick) and without mounting the partition, run

sudo resize2fs  -p  /dev/sda3

Then leave well alone until it is done and reboot.

share|improve this answer
    
Yes, I did recently "expand" that partition. Thanks, I'll attempt the operation next time I can down the machine. –  bumbling fool Mar 1 '11 at 22:23
    
Indeed! I've just tested it: created a filesystem that filled 50% of a partition. df showed everything correctly, but GParted incorrectly stated that the filesystem was as big as the partition and that 50% was used although it was empty! –  arrange Mar 1 '11 at 22:47
1  
If forced me to run "e2fsck -f /dev/sda3" first which was probably smart. After "sudo resize2fs -p /dev/sda3" all is back to normal, thanks! –  bumbling fool Mar 14 '11 at 15:54

This happened to me recently because I incorrectly used dd to copy data from one drive to another. It kept the data safe but all the drive metadata was screwed.

In the answer (that I've edited to show what I did), I found that temporarily rsyncing the data off to another drive, reformatting the disk and recreating the partitions (by running the installer, of all things) and then rsyncing the data back, fixed it.

Whatever you do, if there's any irreplaceable data involved, get a backup.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.