SUSE Support

Here When You Need Us

Resize a BTRFS lvm partition

This document (000021867) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15 (all Service Packs)


Situation

The btrfs root file system is easy to fill.  It's not a problem in general, just because there are too many files, caches or snapshots, but removing snapshots manually is not a good idea. Also, files need to be reserved sometimes. The best way is to enlarge or resize the partition. The following steps introduce the details about how to resize a btrfs lvm partition.

Resolution

NOTICE: To resize a btrfs partition,  the partition must remain mounted.

1. Check disk info:

localhost:~ # lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda               8:0    0   20G  0 disk 
├─sda1            8:1    0    8M  0 part 
└─sda2            8:2    0   20G  0 part 
  ├─system-root 254:0    0 12.3G  0 lvm  /var
  │                                      /root
  │                                      /usr/local
  │                                      /boot/grub2/i386-pc
  │                                      /srv
  │                                      /boot/grub2/x86_64-efi
  │                                      /tmp
  │                                      /opt
  │                                      /home
  │                                      /.snapshots
  │                                      /
  └─system-swap 254:1    0  7.7G  0 lvm  [SWAP]
sdb               8:16   0    5G  0 disk 

/dev/system-root  is the root filesystem device, which is 12.3GB in this example. /dev/sdb is the new disk that we plan to add.

2. Create physical volume with new disk:

localhost:~ # pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.

3. Scan the current volume group that root filesystem is using:

localhost:~ # vgscan 
  Found volume group "system" using metadata type lvm2

4. Extend volume group with the new disk:

localhost:~ # vgextend system /dev/sdb
  Volume group "system" successfully extended

5. Extend logical volume with the extended volume group:

localhost:~ # lvextend -l +100%FREE /dev/system/root
  Size of logical volume system/root changed from 12.29 GiB (3147 extents) to 17.29 GiB (4426 extents).
  Logical volume system/root successfully resized.

6. Resize the btrfs root filesystem:

localhost:~ # btrfs filesystem resize max /
Resize device id 1 (/dev/mapper/system-root) from 12.29GiB to max

7. Check the result, see the system's root filesystem is resized to 17.3GB:

localhost:~ # lsblk
NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda               8:0    0   20G  0 disk 
├─sda1            8:1    0    8M  0 part 
└─sda2            8:2    0   20G  0 part 
  ├─system-root 254:0    0 17.3G  0 lvm  /var
  │                                      /root
  │                                      /usr/local
  │                                      /boot/grub2/i386-pc
  │                                      /srv
  │                                      /boot/grub2/x86_64-efi
  │                                      /tmp
  │                                      /opt
  │                                      /home
  │                                      /.snapshots
  │                                      /
  └─system-swap 254:1    0  7.7G  0 lvm  [SWAP]
sdb               8:16   0    5G  0 disk 
└─system-root   254:0    0 17.3G  0 lvm  /var
                                         /root
                                         /usr/local
                                         /boot/grub2/i386-pc
                                         /srv
                                         /boot/grub2/x86_64-efi
                                         /tmp
                                         /opt
                                         /home
                                         /.snapshots
                                         /

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021867
  • Creation Date: 10-Jun-2025
  • Modified Date:11-Jun-2025
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.