From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 870B2158089 for ; Wed, 20 Sep 2023 21:37:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 51CFC2BC0C3; Wed, 20 Sep 2023 21:37:23 +0000 (UTC) Received: from smtp.hosts.co.uk (smtp.hosts.co.uk [85.233.160.19]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 144722BC014 for ; Wed, 20 Sep 2023 21:37:22 +0000 (UTC) Received: from host86-155-223-197.range86-155.btcentralplus.com ([86.155.223.197] helo=[192.168.1.65]) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1qj4sr-0009sl-Dt for gentoo-user@lists.gentoo.org; Wed, 20 Sep 2023 22:37:21 +0100 Message-ID: Date: Wed, 20 Sep 2023 22:37:20 +0100 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [gentoo-user] How to move ext4 partition Content-Language: en-GB To: gentoo-user@lists.gentoo.org References: <20230920221647.5e3f00e7@digimed.co.uk> From: Wol In-Reply-To: <20230920221647.5e3f00e7@digimed.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: af0db751-eda5-47bd-92c4-b9baa23f1311 X-Archives-Hash: ddba9c678bd4c8131d9f4d66feecdc52 On 20/09/2023 22:16, Neil Bothwick wrote: > On Wed, 20 Sep 2023 20:24:17 -0000 (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