All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: Phillip Susi <phill@thesusis.net>
Cc: Borden <borden_c@tutanota.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Connection lost during BTRFS move + resize
Date: Fri, 3 Dec 2021 13:31:20 -0500	[thread overview]
Message-ID: <CAJCQCtRPnbjM+Uu=j2Ti=Gw4WKh6dzjnCg6uMcg0Qcr2nzLUiQ@mail.gmail.com> (raw)
In-Reply-To: <87r1azashl.fsf@vps.thesusis.net>

On Mon, Nov 29, 2021 at 10:33 AM Phillip Susi <phill@thesusis.net> wrote:
>
>
> Borden <borden_c@tutanota.com> writes:
>
> > 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

      parent reply	other threads:[~2021-12-03 18:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29  8:48 Connection lost during BTRFS move + resize Borden
2021-11-29 15:26 ` Phillip Susi
2021-11-29 15:50   ` Borden
2021-11-29 16:12     ` Graham Cobb
2021-12-01 18:42       ` Matthew Warren
2021-11-29 16:20     ` Phillip Susi
2021-11-29 17:20       ` Borden
2021-12-03 18:47     ` Chris Murphy
2021-12-03 18:31   ` Chris Murphy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJCQCtRPnbjM+Uu=j2Ti=Gw4WKh6dzjnCg6uMcg0Qcr2nzLUiQ@mail.gmail.com' \
    --to=lists@colorremedies.com \
    --cc=borden_c@tutanota.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=phill@thesusis.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.