1

Topic: Partition resizing fails

Whenever I try to resize a partition on my hard drive using gparted in ubuntu live, it fails. It returns the error "please run e2fsck -f /dev/sda6" first. No matter how many times I fsck the drive it still gives this error.

Does anyone know of any way to have gparted force resizing or to get rid of this e2fsck error?

Thanks in advance.

2

Re: Partition resizing fails

It is safer to be sure that the file system is clean before resizing.
One way is to right-click the partition in GParted and select "Check" from the context menu. Then click "Apply" in the icon bar above the partition list - and let GParted do its job. Once you've run the file system check, the resize operation should work well.

Sometimes there are severe errors that can't be fixed by e2fsck, or hardware problems.

There is no way to "force" GParted to do the operation despite the check error result, because it could be unsafe for use by non experienced users. You can do resizing manually from the command line, from the terminal window.
Look at the man page for parted.

However I would suggest to try the latest stable version of the Gparted livecd first. Ubuntu always contains an older version, and we don't know if the dependencies are up to date.

(Moved to the Live Media section)

*** It is highly recommended to backup any important files before doing resize/move operations. ***

3

Re: Partition resizing fails

I'll give it a try, but it seems like the error is coming from the resize2fs command. I tried running a check via gparted, but the error still resides.

4

Re: Partition resizing fails

Hey dude,
had the same trouble, because of my swap partition.
In fact I have an extended partition, which includes swap, / and /home.
When my ubuntu live CD ran, it asked me if I would like him to use my swap partition. I said ok and so my swap was locked, BUT my swap is a part of extended partition which includes my /home partition.
So I unlocked my swap and my extended partition, and everything went well.

Hope helped someone.

5

Re: Partition resizing fails

Hello,

eldar.musin wrote:

In fact I have an extended partition, which includes swap, / and /home.
...
So I unlocked my swap and my extended partition, and everything went well.

This is a very plausible explanation ! A mounted or busy (swap) partition can NOT be resized by "GParted" and its co-working programs.

So this is the best solution :

class413 wrote:

However I would suggest to try the latest stable version of the Gparted livecd first. Ubuntu always contains an older version, and we don't know if the dependencies are up to date.

Regards
cmdr

6

Re: Partition resizing fails

Thanks  for the reply, but that's not the problem. It's not a problem with gparted, but an underlying problem with the partition or partition tools not marking the filesystem as "fscked" after doing so, thus causing the following step, resizing, to fail with the error 'needs to be fscked.' I was just curious if there was a way to implement a "force" option into the resize command in gparted.

If anyone else is wondering, it looks like you can edit the source code file containing the resize2fs command and add "-f " after it and recompile. I'm not much of a programmer (at all), but this would cause it to always force, regardless if there is an actual problem and is probably not a good idea. If anyone knows of a way to enable a checkbox or something to enable force when it fails, that would be great.

Thanks.