[BACKING DEVICE] Resize

From
Giuseppe Della Bianca <hidden>
Date
2021-05-01 15:02:14
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

Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help