Re: Connection lost during BTRFS move + resize
From: Chris Murphy <hidden>
Date: 2021-12-03 18:31:40
On Mon, Nov 29, 2021 at 10:33 AM Phillip Susi [off-list ref] wrote:
Borden [off-list ref] writes:quoted
Good morning, I couldn't find any definitive guidance on the list archives or Internet, so I want to double-check before giving up. I tried to left-move and resize a btrfs partition on a USB-attached hard drive. My intention was to expand the partition from 2 TB to 3 TB on a 4TB drive. During the move, the USB cable came loose and the process failed.The only tool I know of that can do this is gparted, so I assume you are using that. In this case, it has to umount the filesystem and manually copy data from the old start of the partition to the new start. Being interrupted in the middle leaves part of the filesystem in the wrong place ( and which parts is unknowable ), and so it is toast. This is one area where LVM has a significant advantage as its moves are interruption safe and automatically resumed on the next activation of the volume.
Whether LVM or Btrfs, you can just add the earlier partition to the storage pool. No need to move extents around, and near as I can tell no advantage of doing so. i.e. if the btrfs is on vda2 and it's now desired to expand the file system "forward" into the space defined by vda1, just add it btrfs device add /dev/vda1 /mnt The command implies an abbreviated mkfs on vda1, and resizes the btrfs file system to encompass both devices. And it's also an interrupt safe operation unlike gparted move/resize which should come with dire warnings about the consequence for any interruption. -- Chris Murphy