Simple in-place dynamic resize of btrfs file systems with sub volumes


jimbo45

Well-known member
Pro User
VIP
Local time
5:14 AM
Posts
5,862
Location
Hafnarfjörður IS
OS
Windows XP,11 Linux Fedora Rawhide pre-release 45
Hi folks
If you use btrfs file systems having subvolumes with Linux VM's or physical machines they can be re-sized dynamically both ways (i.e bigger / smaller) without needing re-boot re-power on with a simple command,

e,g in this example I installed an ArchLinux system to originally a 256 GB SSD. I copied (via DD) the disk to 2TB Nvme2.

layout :

Screenshot_20231230_093738.png
now I simply wanted to use the whole disk rather than the 256GB allocated after the copy.
simply as follows as root (su)

btrfs filesystem resize +nng /<partition> where partition in this case is /home /root etc nng size in gb and + for increase. To shrink just replace the + with a -.

simple -- no reboot needed. C'mon Windows make partitioning dynamic and easy too -- ntfs has been around for ages now -- while it still works OK - but surely time for a better more dynamic file system - especially with larger HDD's and SSD's / NVME's.


cheers
jimbo
 

My Computer My Computer

At a glance

Windows XP,11 Linux Fedora Rawhide pre-releas...2 X Intel i7
OS
Windows XP,11 Linux Fedora Rawhide pre-release 45
Computer type
PC/Desktop
CPU
2 X Intel i7
Screen Resolution
4KUHD X 2
Back
Top Bottom