Re: [gentoo-user] How to move ext4 partition
On 20/09/2023 22:16, Neil Bothwick wrote: On Wed, 20 Sep 2023 20:24:17 - (UTC), Grant Edwards wrote: However, GParted apparently does. Can GParted move an ext4 filesystem to a destination location that overlaps its starting location? For example, I have a 500GB partition containing an ext4 filesystem starting at sector 2048 (1MiB). I want to move that filesystem so that it starts at sector 3*2048 (3MiB). Can that be done in-place? Or should I just back up the filesystem to a second drive and start from scratch? Given that you'd want to backup before such an operation anyway, you may as well then restore from that backup. I'm sure it will be a lot quicker than GParted's moving all the data around. Or, assuming the people who wrote gparted have two brain cells to rub together, I'm pretty sure they use the same technique as memmove. "If the regions overlap, make sure you start from whichever end won't overwrite the source, otherwise start at whichever end you like". Barring screw-ups (a very unsafe assumption :-), I'm pretty certain you don't even need a backup! I suspect the man-page even confirms this behaviour. Cheers, Wol
Re: [gentoo-user] How to move ext4 partition
On Wed, 20 Sep 2023 20:24:17 - (UTC), Grant Edwards wrote: > However, GParted apparently does. Can GParted move an ext4 filesystem > to a destination location that overlaps its starting location? > > For example, I have a 500GB partition containing an ext4 filesystem > starting at sector 2048 (1MiB). I want to move that filesystem so that > it starts at sector 3*2048 (3MiB). > > Can that be done in-place? > > Or should I just back up the filesystem to a second drive and start > from scratch? Given that you'd want to backup before such an operation anyway, you may as well then restore from that backup. I'm sure it will be a lot quicker than GParted's moving all the data around. -- Neil Bothwick He who laughs last thinks slowest! pgpIJFqg5f9uh.pgp Description: OpenPGP digital signature
[gentoo-user] How to move ext4 partition
I've got a Gentoo install using a GPT partition table and Legacy boot using Grub2. There is a single /root parition and a single swap partition on the drive. I did not create a bios-boot partition at the start of the disk, so I had to force grub2 to install using block-lists. I'd like to fix that now. This requires that I move the ext4 root partition towards the end of the drive to create 2MB of free space at the start of the drive for a new bios-boot partition. I see that Gnu parted no longer has a move command. However, GParted apparently does. Can GParted move an ext4 filesystem to a destination location that overlaps its starting location? For example, I have a 500GB partition containing an ext4 filesystem starting at sector 2048 (1MiB). I want to move that filesystem so that it starts at sector 3*2048 (3MiB). Can that be done in-place? Or should I just back up the filesystem to a second drive and start from scratch?