Article 54J9S btrfs partition resize, it is possible ?

btrfs partition resize, it is possible ?

by
marozsas
from LinuxQuestions.org on (#54J9S)
Hi there,
I have a 4T disk with 3 GPT partitions:
partition 1 is not used anymore
partition 2 and 3 are used.

I would like to delete the partition 1 and extend the partition 2 using all size left by part 1.
Partition 2 has a btrfs.

Details:
Code:kimera:/home/miguel # gdisk /dev/sdc
GPT fdisk (gdisk) version 1.0.5

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdc: 7814037168 sectors, 3.6 TiB
Model: ST4000DM000-2AE1
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 7DBA0FBB-66F5-48EA-AD02-03420153CEB8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 16-sector boundaries
Total free space is 15593 sectors (7.6 MiB)

Number Start (sector) End (sector) Size Code Name
1 2048 1887438847 900.0 GiB 8302 P2P
2 1887444720 5100268004 1.5 TiB 8300 home linux
4 5100275712 7814037134 1.3 TiB 0700 Photos archieveWhat I intend to do:
0) having a working backup of data in partition 2 in case something goes wrong. I already have, it took the entire night and extend to a few hours of this morning. Restoring that backup would take no less than that time and I want to avoid the restore time as much as possible.
1) delete partition 1
2) delete partition 2
3) create a new partition using as begin sector 2048 (the beginning of partition 1) and end sector 5100268004 (the end of partition 2)

My question is about how to proper resize the btree fs now in the "middle-to-end" of the new partition.
It will work ? What is the proper btrfs command in this case ?
Again, I have a backup but I want to avoid the restore time as much as possible.

I appreciate any comments,latest?d=yIl2AUoC8zA latest?i=qNnPVuELKXI:PzOLd4bGQlI:F7zBnMy latest?i=qNnPVuELKXI:PzOLd4bGQlI:V_sGLiP latest?d=qj6IDK7rITs latest?i=qNnPVuELKXI:PzOLd4bGQlI:gIN9vFwqNnPVuELKXI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments