can’t move an extended partition

Is there any way to move an extended Linux partition? GParted promises to, but insists on claiming that the thing is mounted although it isn’t (because it has the same UUID as another on a different disk). parted doesn’t mind that, but returns an error message “Error: can’t move an extended partition”. It also doesn’t like doing moves with ext4 filesystems around.

5 Comments on "can’t move an extended partition"


  1. As I mentioned on twitter, the standard way to copy a filesystem is to use dd. I.e. if the extended partition is 5 on disk 1 and you want to move it to disk 2, partition 1 you can do: “dd if=/dev/sda5 of=/dev/sdb1”. You will need to create the target partition first, of course. You can size it a bit (or a lot) larger than actually required and grow the filesystem to fit after, if you like.

    However, I would strongly recommend using lvm to manage your storage. Basically, unless it is going to be your boot or root partition, you should just create one partition over the whole disk (or even better, none at all), then add it as a physical volume using “pvcreate”, create a volume group, then create logical volumes as needed. Then next time you want to move things around or shrink/grow a FS it will all be much simpler.

    Reply

    1. Yes, I dd’d if=/dev/sda of=/dev/sdb. My problem is that the new disk is 256GB compared to 160GB, and I want to share the additional space equally between the Windows and Linux partitions. I have already added space to the /, I now want to move it right so as to make the remaining space available for the Windows partition.

      Reply

  2. Ah, if you just used sda and sdb (note the lack of any numbers!) then you copied the entire disk, rather than individual partitions. Not a problem as such, but perhaps not the easiest way to do it.

    If you have been using the new disk then that’s fine, you’ll just need to grow the partitions, and we can discuss ways to do that.

    If you haven’t (i.e. the old data is still valid) then I’d suggest creating the desired partitions on the new disk and copying them across partition by partition from the old disk. Then you will just need to grow the filesystem to fill the partition, not resize the partition itself, which will simplify matters.

    Reply

Leave a Reply to yorksranter Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.