1 (edited by steveybaby2 2011-11-10 22:08:07)

Topic: [SOLVED][Bug report filed]Problem copying XFS to new smaller partition

I've been trying to simulate shrinking of an XFS partition by using the copy functionality in gparted (i.e copying /dev/sda3 to a smaller XFS partition /dev/sdb2, then removing /dev/sda3 and copying it back). However, I always get the error:

"the destination is smaller than the source partition"

From the features page (http://gparted.sourceforge.net/features.php) it mentions that this should be possible: "Although it's not possible to shrink an xfs file system directly, you can shrink it using GParted's copy functionality." so I'm not sure whether I'm doing something wrong. I know that xfsdump expects the filesystem to be mounted but I can't copy once its mounted as it wont let me.

I'm selecting the source and clicking copy, then selecting the unallocated space and clicking paste. Clicking Apply I then see the error.

Any help appreciated!
Thanks
steveybaby2


GParted 0.9.1 --enable-libparted-dmraid

Libparted 2.3

Copy /dev/sda3 to /dev/sdb (start at 670.68GiB)  00:00:00 (ERROR)
    calibrate /dev/sda3  00:00:00 (SUCCESS)
        path: /dev/sda3
        start: 8675100
        end: 2930272064
        size: 2921596965 (1.36 TiB)
    the destination is smaller than the source partition (ERROR)

2

Re: [SOLVED][Bug report filed]Problem copying XFS to new smaller partition

Thank you for bringing this to my attention.

It is entirely possible that this functionality is no longer available.

The message "the destination is smaller than the source partition" originates at the beginning of the copy operation.  The logic prevents all copies of larger partitions into smaller destination partitions.  The relevant section of code is GParted_Core::copy().

I am unsure of what point this functionality stopped working.  Most likely when this safeguard was added.

Have you tried performing this action directly from the command line?

The copy steps can be found in the xfs::copy() method.

3

Re: [SOLVED][Bug report filed]Problem copying XFS to new smaller partition

No problem - thanks for the quick response!

Yes, shortly after my post I delved into the code and noticed the check you've mentioned in GParted_Core::copy().  I did kick start the process manually (it was good to confirm the exact parameters for xfsdump/xfsrestore using xfs::copy() ) so hopefully this will allow me to complete step 1 of the XFS shrink.

The second hdd I'm transferring to is USB 2.0 so it'll take a while....

4

Re: [SOLVED][Bug report filed]Problem copying XFS to new smaller partition

Thanks for the update.  I am interested to learn the outcome.

5 (edited by steveybaby2 2011-11-10 22:05:49)

Re: [SOLVED][Bug report filed]Problem copying XFS to new smaller partition

Just to update on this one, manually executing the steps in xfs::copy() worked and copied to a smaller XFS partition. So these commands are still valid with the latest xfsprogs package.

Then the second step of copying the smaller partition back to the original drive worked a treat - the net result is a smaller XFS partition!  big_smile

I've filled a bug under: https://bugzilla.gnome.org/show_bug.cgi?id=663806

6

Re: [SOLVED][Bug report filed]Problem copying XFS to new smaller partition

Thanks for following up and creating a bug report.

A fix has been committed to the git gnome repository if you are able to perform some testing.
Details are in the bug report.