All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Christoph Anton Mitterer <calestyo@scientia.org>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: exactly shrinking btrfs on a device?
Date: Sat, 6 Apr 2024 03:37:00 +0500	[thread overview]
Message-ID: <20240406033700.2c2404c1@nvm> (raw)
In-Reply-To: <896a5d36071a30605c38779dd03103b6429ebcae.camel@scientia.org>

On Sat, 06 Apr 2024 00:22:52 +0200
Christoph Anton Mitterer <calestyo@scientia.org> wrote:

> If that btrfs on some given device was placed within some other
> container (e.g. a partition, LUKS, LVM, etc.) one likely wants to next
> shrink that outer container.
> 
> How does one do that? I mean, how do I find out the exact last by that
> btrfs uses on a particular device?

I do it like this:

Shrink it with a large headroom left to spare, e.g. by 50-100 GB more than
necessary (or say by 10%, if it is small). Then shrink the outer container.
Then grow the FS using the "max" keyword, to occupy the entire new size of the
container.

-- 
With respect,
Roman

  reply	other threads:[~2024-04-05 22:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 22:22 exactly shrinking btrfs on a device? Christoph Anton Mitterer
2024-04-05 22:37 ` Roman Mamedov [this message]
2024-04-05 22:41   ` Christoph Anton Mitterer
2024-04-06  5:03     ` Andrei Borzenkov
2024-04-07  2:52       ` Christoph Anton Mitterer
2024-04-07 14:29         ` Roman Mamedov
2024-04-08  2:00           ` Christoph Anton Mitterer

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=20240406033700.2c2404c1@nvm \
    --to=rm@romanrm.net \
    --cc=calestyo@scientia.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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.