Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I recently backed up an 11GB ext4 partition to a file using dd, repartitioned, and restored the file to a 40GB partition. parted now shows the partition as 40GB, Nautilus reads it as 11GB, and both list the drive as only having 2GB free.

Is this a filesystem issue or partition issue and how can I fix it without repartitioning to 11GB, dd'ing the file, and growing the partition?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

If all is well up to that point then I think you just need to resize2fs the filesystem up to 40Gb:

resize2fs /dev/sdc1

where /dev/sdc1 is the name of your partition.

Took off the size as per womble's excellent comment below.

resize2fs will grow the filesystem when it's mounted. It can also shrink it but needs to be unmounted for that.

share|improve this answer
4  
Don't give resize2fs a size; it'll work out the correct size to expand the filesystem to all by itself, and will get it right, too. –  womble Jan 2 '10 at 10:35
1  
and for anyone coming across this at a later point, but happens to use reiserfs: resise_resierfs :) –  BuildTheRobots Jan 2 '10 at 11:10
1  
Of course anyone using Reiser should move off ASAP, it's a known dangerous filesystem (no not making the obvious joke). XFS and EXT2/3/4 are the (IMHO) only sane options. –  LapTop006 Jan 2 '10 at 14:03
    
Thanks. I'm amazed that resize2fs can even be used on a mounted partition. –  user30569 Jan 2 '10 at 15:50
    
@laptop005 i've been using it happily for years now. care to elaborate please :) –  BuildTheRobots Jan 2 '10 at 18:45

Your Answer

 
discard

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