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


jimbo45

Well-known member
Pro User
VIP
Local time
9:19 PM
Posts
3,981
Location
Hafnarfjörður IS
OS
Windows XP,7,10,11 Linux Arch Linux
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

System One

  • OS
    Windows XP,7,10,11 Linux Arch Linux
    Computer type
    PC/Desktop
    CPU
    2 X Intel i7
Back
Top Bottom