public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Giuseppe Della Bianca <giusdbg@gmail.com>
To: linux-bcache@vger.kernel.org
Subject: [BACKING DEVICE] Resize
Date: Sat, 01 May 2021 17:01:54 +0200	[thread overview]
Message-ID: <2068977.irdbgypaU6@exnet.gdb.it> (raw)

Hi.

This is the procedure I used for resize one backing device with btrfs filesystem from 1 to 10 GB.

The technique used is
- Move the start of the partition forward (offset 8192) and set the partition type.
- Perform the resize.
- Move back the beginning of the partition and reset the partition type.


Backup data!!


The backing device /dev/sdc7 is a last logical partition with btrfs filesystem.

Stopping bcacheX device and/or unregister /dev/sdc7 backing device.
With bcache show verify that the device is no longer in use.


parted /dev/sdc unit B print
7		574412029952B	575491014655B   logical 


bd	0	574412029952B	575491014655B   logical
fs	8192	574412038144B	575491014655B   logical   btrfs
		
		
parted /dev/sdc
unit B
print
rm 7
mkpart logical btrfs 574412038144B 575491014655B
quit


reboot


gparted resize partition


parted /dev/sdc unit B print
7      		574412038144B	585151545343B   logical   btrfs


fs	8192	574412038144B	585151545343B   logical   btrfs
bd	0	574412029952B	585151545343B   logical


parted /dev/sdc
unit B
print
rm 7
mkpart logical 574412029952B 585151545343B
quit

gdb



                 reply	other threads:[~2021-05-01 15:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2068977.irdbgypaU6@exnet.gdb.it \
    --to=giusdbg@gmail.com \
    --cc=linux-bcache@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox