4

I want to move a LUKS-encrypted btrfs volume to the right. GParted is telling me it knows how to move the LUKS layer to the right, but it doesn’t know how to move the btrfs layer to the right. Can I just move the LUKS layer to the right and btrfs will still work, or does btrfs have location-dependent data in it?

1
  • 2
    It might benefit you if you provided a screenshot
    – Ramhound
    Commented May 4 at 20:05

1 Answer 1

6

There is literally nothing special about moving a partition, whether it has LUKS or Btrfs or anything else.

The way partitions work is that the filesystem is completely unaware of the "real" addresses; if Btrfs told to use the /dev/sdb3 partition, then sector 0 as seen by Btrfs is the beginning of that partition only, and it remains that way even if the partition is physically moved elsewhere.

Because of that, all location-dependent data within a partition is relative to the start of the partition and never to the whole disk. So GParted only has special support for resizing partitions, but moving is the same for all of them.

(And for that matter, if the filesystem is told to use a LUKS mapper device, then it isn't even aware of the partition underneath – the data is actually offset to make space for the LUKS header at the beginning, but that too is hidden from the filesystem.)

This is also why resizing to the left is much slower than resizing to the right; it moves the reference point so all data has to be moved together with it.

1
  • 3
    "GParted only has special support for resizing partitions, but moving is the same for all of them" – Resizing a partition is as easy and generic as moving it. Resizing a filesystem needs special support. Commented May 4 at 20:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .