Essential filesystem structures are addressed relatively to the start of the filesystem, which happens to be the same as the start of the block device. Since your filesystem is implicitly expected to start on the first block of the block device, it tolerates no offset at any time between the first block of the block device and the first block of the filesystem.
Your filesystem's end can be changed (grown and shrank) relatively to the starting point, but there's no easy way to extend beyond the first block (or to shrink a filesystem 'backwards'), as you'd introduce an offset between the block device and the start of file system on it. Theoretically this would of course be possible, however the current toolset and the Linux kernel is not prepared for this type of operation.
In the comment to this answer you stated that you only interested relocating your filesystem on a new partition covering only the second half of the current parititon.
Is a filesystem depends on which block device it uses? No. Relocation of the filesystem with different tools, such as dd
is possible.
The procedure would look like this:
- make a backup, it never hurts
- shrink the existing filesystem down (or under) the size of the new partition
- calculate the filesystem's current starting position on the disk (not on the partition)
- repartition your disk
- dd the amount of data on the disk to it's right place (since you know the old starting point, the new starting point and the lenght)
- extend your filesystem (in case in step 2 you made it smaller)
I would like to highlight that this procedure will not work, if your shrinked-down filesystem (point 2) and it's desired new place (the new partition, in point 4) overlaps on the disk.
Consider using LVM
to mitigate these issues like this and many others. With LVM
, you could simply:
- shrink your filesystem
- shrink your logical volume (and let LVM handle all this mess)