Btrfs filesystem won't expand to partition size

Hello Garuda people :wave:

I installed my Garuda system on a 512GB SSD.
I needed more space so I cloned my 512GB SSD to a 1TB SSD using a POP!_OS live usb.

I successfully booted into the system with the bigger SSD but I have one problem.
The partitions remained exactly the same, so my main filesystem partition remains at about 480GB and I got about 512GB of unallocated space.

I proceeded to extend the btrfs partition to fully max out the empty unallocated space on the SSD. I did that using GParted on a POP!_OS live system again. Worked without issues.

But there is an issue: btrfs doesn't want to accept that. My file system stays at the same old size and I tried everything to tell btrfs to expand the filesystem. Nothing worked.
I tried commands like

btrfs filesystem resize max /

and

btrfs filesystem balance start /

but whatever I do, btrfs still tells me the same device size:

# btrfs device usage /

/dev/disk/by-uuid/fcfdfbec-fbc2-4e48-892c-4e04e2a0d9d4, ID: 1
Device size:           476.64GiB
Device slack:            2.00KiB
Data,single:           421.00GiB
Metadata,DUP:            7.60GiB
System,DUP:             64.00MiB
Unallocated:            47.97GiB

I already looked into Resizing Garuda partition using unallocated space from windows in dual boot and Extending partition in Garuda and other articles on the internet.

Whatever I try, btrfs simply doesn't want to accept that (I get no errors)

System:
Kernel: 6.4.12-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
clocksource: tsc available: hpet,acpi_pm
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=fcfdfbec-fbc2-4e48-892c-4e04e2a0d9d4 rw rootflags=subvol=@
quiet quiet rd.udev.log_priority=3 vt.global_cursor_default=0
amd_iommu=on iommu=pt pci-stub.ids=10de:13c2,10de:0fbb
vfio-pci.ids=10de:13c2,10de:0fbb rd.driver.pre=vfio-pci loglevel=3
ibt=off
Desktop: KDE Plasma v: 5.27.7 tk: Qt v: 5.15.10 wm: kwin_x11 vt: 2
dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Desktop System: ASUS product: N/A v: N/A serial: <superuser required>
Mobo: ASUSTeK model: ROG STRIX B550-F GAMING v: Rev X.0x
serial: <superuser required> UEFI: American Megatrends v: 3002
date: 02/23/2023
CPU:
Info: model: AMD Ryzen 5 5600X bits: 64 type: MT MCP arch: Zen 3+ gen: 4
level: v3 note: check built: 2022 process: TSMC n6 (7nm) family: 0x19 (25)
model-id: 0x21 (33) stepping: 0 microcode: 0xA201025
Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 3 MiB desc: 6x512 KiB
L3: 32 MiB desc: 1x32 MiB
Speed (MHz): avg: 3710 high: 4085 min/max: 2200/4650 boost: enabled
scaling: driver: acpi-cpufreq governor: performance cores: 1: 3598 2: 3599
3: 4085 4: 3742 5: 3700 6: 3831 7: 3658 8: 3600 9: 3727 10: 3692 11: 3693
12: 3596 bogomips: 88802
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
Vulnerabilities: <filter>
Graphics:
Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
vendor: Sapphire Nitro+ driver: amdgpu v: kernel arch: GCN-4
code: Arctic Islands process: GF 14nm built: 2016-20 pcie: gen: 3
speed: 8 GT/s lanes: 4 link-max: lanes: 16 ports: active: DP-1, DP-2,
HDMI-A-1, HDMI-A-2 empty: DVI-D-1 bus-ID: 04:00.0 chip-ID: 1002:67df
class-ID: 0300
Device-2: NVIDIA GM204 [GeForce GTX 970] vendor: ASUSTeK driver: pci-stub
v: N/A alternate: nouveau non-free: 535.xx+ status: current (as of 2023-08)
arch: Maxwell code: GMxxx process: TSMC 28nm built: 2014-19 pcie: gen: 3
speed: 8 GT/s lanes: 16 bus-ID: 08:00.0 chip-ID: 10de:13c2 class-ID: 0300
Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.2.0
compositor: kwin_x11 driver: X: loaded: modesetting alternate: fbdev,vesa
dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
Screen-1: 0 s-res: 4720x2414 s-dpi: 96 s-size: 1245x637mm (49.02x25.08")
s-diag: 1398mm (55.06")
Monitor-1: DP-1 pos: primary,4-2 model: LG (GoldStar) ULTRAWIDE
serial: <filter> built: 2017 res: 2560x1080 hz: 75 dpi: 96 gamma: 1.2
size: 677x290mm (26.65x11.42") diag: 730mm (28.8") modes: max: 2560x1080
min: 720x400
Monitor-2: DP-2 pos: 1-3 model: Samsung built: 2009 res: 1920x1080 hz: 60
dpi: 55 gamma: 1.2 size: 886x498mm (34.88x19.61") diag: 1012mm (39.8")
ratio: 16:9 modes: max: 1920x1080 min: 720x400
Monitor-3: HDMI-A-1 mapped: HDMI-1 pos: 3-1 model: Samsung S24R35x
serial: <filter> built: 2019 res: 1080x1920 hz: 75 dpi: 93 gamma: 1.2
size: 296x527mm (11.65x20.75") diag: 604mm (23.8") ratio: 16:9 modes:
max: 1920x1080 min: 720x400
Monitor-4: HDMI-A-2 mapped: HDMI-2 pos: 2-4 model: Samsung S24R35x
serial: <filter> built: 2020 res: 1080x1920 dpi: 93 gamma: 1.2
size: 296x527mm (11.65x20.75") diag: 604mm (23.8") ratio: 16:9 modes:
max: 1920x1080 min: 720x400
API: OpenGL v: 4.6 Mesa 23.1.6-arch1.4 renderer: AMD Radeon RX 590 Series
(polaris10 LLVM 16.0.6 DRM 3.52 6.4.12-zen1-1-zen) direct-render: Yes
Audio:
Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590]
vendor: Sapphire driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s
lanes: 4 link-max: lanes: 16 bus-ID: 04:00.1 chip-ID: 1002:aaf0
class-ID: 0403
Device-2: NVIDIA GM204 High Definition Audio vendor: ASUSTeK
driver: pci-stub alternate: snd_hda_intel pcie: gen: 3 speed: 8 GT/s
lanes: 16 bus-ID: 08:00.1 chip-ID: 10de:0fbb class-ID: 0403
Device-3: AMD Starship/Matisse HD Audio vendor: ASUSTeK
driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
bus-ID: 0a:00.4 chip-ID: 1022:1487 class-ID: 0403
Device-4: Corsair ST100 Headset Output
driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 1.1 speed: 12 Mb/s
lanes: 1 mode: 1.1 bus-ID: 3-4.3.1:7 chip-ID: 1b1c:0a32 class-ID: 0300
serial: <filter>
Device-5: Corsair VOID ELITE Wireless Gaming Dongle
driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 1.1 speed: 12 Mb/s
lanes: 1 mode: 1.1 bus-ID: 3-4.3.4:9 chip-ID: 1b1c:0a51 class-ID: 0300
API: ALSA v: k6.4.12-zen1-1-zen status: kernel-api tools: N/A
Server-1: PipeWire v: 0.3.79 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Ethernet I225-V vendor: ASUSTeK driver: igc v: kernel pcie:
gen: 2 speed: 5 GT/s lanes: 1 port: N/A bus-ID: 07:00.0 chip-ID: 8086:15f3
class-ID: 0200
IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
IF-ID-1: virbr0 state: down mac: <filter>
Bluetooth:
Device-1: Cambridge Silicon Radio Bluetooth Dongle (HCI mode) driver: btusb
v: 0.8 type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-4.4:6
chip-ID: 0a12:0001 class-ID: e001
Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 4.0
lmp-v: 6 status: discoverable: no pairing: no class-ID: 7c0104
Drives:
Local Storage: total: 3.36 TiB used: 2.05 TiB (61.1%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:3 vendor: Western Digital
model: WD BLACK SN750 SE 1TB size: 931.51 GiB block-size: physical: 512 B
logical: 512 B speed: 63.2 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 711250WD temp: 42.9 C scheme: GPT
ID-2: /dev/nvme1n1 maj-min: 259:0 vendor: Western Digital model: PC SN720
SDAPNTW-512G-1006 size: 476.94 GiB block-size: physical: 512 B
logical: 512 B speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter>
fw-rev: 10112006 temp: 45.9 C scheme: GPT
ID-3: /dev/sda maj-min: 8:0 vendor: Kingston model: SV300S37A120G
size: 111.79 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: BBF1 scheme: GPT
ID-4: /dev/sdb maj-min: 8:16 vendor: Toshiba model: DT01ACA100
size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
tech: HDD rpm: 7200 serial: <filter> fw-rev: A750 scheme: MBR
ID-5: /dev/sdc maj-min: 8:32 vendor: Crucial model: CT500MX500SSD1
size: 465.76 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
tech: SSD serial: <filter> fw-rev: 023 scheme: GPT
ID-6: /dev/sdd maj-min: 8:48 vendor: Western Digital
model: WD5000AAKX-00ERMA0 size: 465.76 GiB block-size: physical: 512 B
logical: 512 B speed: 6.0 Gb/s tech: HDD rpm: 7200 serial: <filter>
fw-rev: 1H15 scheme: MBR
ID-7: /dev/sdf maj-min: 8:80 vendor: SanDisk model: Ultra USB 3.0
size: 57.3 GiB block-size: physical: 512 B logical: 512 B type: USB rev: 2.1
spd: 480 Mb/s lanes: 1 mode: 2.0 tech: N/A serial: <filter> fw-rev: 1.00
scheme: MBR
SMART Message: Unknown USB bridge. Flash drive/Unsupported enclosure?
Partition:
ID-1: / raw-size: 476.64 GiB size: 476.64 GiB (100.00%)
used: 411.74 GiB (86.4%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 580 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:4
ID-3: /home raw-size: 476.64 GiB size: 476.64 GiB (100.00%)
used: 411.74 GiB (86.4%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 476.64 GiB size: 476.64 GiB (100.00%)
used: 411.74 GiB (86.4%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 476.64 GiB size: 476.64 GiB (100.00%)
used: 411.74 GiB (86.4%) fs: btrfs dev: /dev/nvme1n1p2 maj-min: 259:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
ID-1: swap-1 type: zram size: 31.25 GiB used: 5.28 GiB (16.9%)
priority: 100 comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 12
dev: /dev/zram0
Sensors:
System Temperatures: cpu: 48.8 C mobo: N/A gpu: amdgpu temp: 57.0 C
Fan Speeds (rpm): fan-2: 1411 fan-3: 1436 fan-4: 1505 gpu: amdgpu fan: 976
Info:
Processes: 430 Uptime: 1h 9m wakeups: 0 Memory: total: 32 GiB
available: 31.25 GiB used: 15.6 GiB (49.9%) Init: systemd v: 254
default: graphical tool: systemctl Compilers: gcc: 13.2.1 clang: 16.0.6
Packages: pm: pacman pkgs: 1878 libs: 483 tools: octopi,paru Shell: fish
v: 3.6.1 default: Bash v: 5.1.16 running-in: konsole inxi: 3.3.29
Garuda (2.6.16-1):
System install date:     2023-07-08
Last full system update: 2023-09-02
Is partially upgraded:   No
Relevant software:       snapper NetworkManager dracut(custom) mkinitcpio
Windows dual boot:       No/Undetected
Failed units:

I’m not so sure it worked. It looks like the partition is only 476.64 GiB, and the filesystem is occupying 100% of the partition already.

Please show this output:

sudo parted -l
1 Like

Hi BluishHumility,

thank you for taking a look at my Problem!

Here is the output of: sudo parted -l:

Model: ATA KINGSTON SV300S3 (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name                  Flags
1      2097kB  275MB  273MB  fat32                              boot, esp
2      275MB   120GB  120GB  ntfs         Basic data partition  msftdata


Model: ATA TOSHIBA DT01ACA1 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number  Start  End     Size    Type     File system  Flags
1      106MB  1000GB  1000GB  primary  ntfs


Model: ATA CT500MX500SSD1 (scsi)
Disk /dev/sdc: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                          Flags
1      17,4kB  16,8MB  16,8MB               Microsoft reserved partition  msftres
2      16,8MB  500GB   500GB   ntfs         Basic data partition          msftdata


Model: ATA WDC WD5000AAKX-0 (scsi)
Disk /dev/sdd: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End    Size   Type     File system  Flags
1      32,3kB  500GB  500GB  primary


Model: SanDisk Ultra USB 3.0 (scsi)
Disk /dev/sdf: 61,5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
2      250kB   4444kB  4194kB  primary               esp
3      3167MB  61,5GB  58,4GB  primary  ext4


Model: WD_BLACK SN750 SE 1TB (nvme)
Disk /dev/nvme0n1: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
1      2097kB  317MB   315MB   fat32              boot, esp
2      317MB   1000GB  1000GB  btrfs        root


Model: WDC PC SN720 SDAPNTW-512G-1006 (nvme)
Disk /dev/nvme1n1: 512GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name  Flags
1      2097kB  317MB  315MB  fat32              boot, esp
2      317MB   512GB  512GB  btrfs        root


Model: Unknown (unknown)
Disk /dev/zram0: 33,6GB
Sector size (logical/physical): 4096B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system     Flags
1      0,00B  33,6GB  33,6GB  linux-swap(v1)


( /dev/nvme0n1 is the new SSD)

I also made a screenshot of KDE Partition Manager, that's why I thought I successfully extended the partition

I think I see the source of the confusion.

nvme0n1 has been resized correctly, it’s showing 1 TB.

However, these commands are not targeting nvme0n1:

It looks like nvme1n1p2 is mounted at /–not nvme0n1. See here:

The EFI partition is on nvme0n1, but the root partition is on nvme1n1.

To resize the filesystem on nvme0n1, you will have to use its mount point as the argument of the command instead of /. I can’t see the full mount point in the picture (it’s cut off), but it starts with /run/media....

sudo btrfs filesystem resize max /run/media/blah_blah_blah
5 Likes

Thank you!!!! :smile:

Now I can enjoy my 1TB SSD​:muscle:

I initially made a fatal mistake while cloning my SSD.
Every BTRFS filesystem (or so) has a unique UUID. Because I cloned my SSD 1 to 1 I cloned that UUID too. I kept both my SSDs connected to my system. That means I have two BTRFS filesystems with the same UUID. Initially as I did that Garuda didn't want to boot, I looked up the error and gave the new SSD a different UUID. That is the problem. Because I gave the new filesystem a different UUID the UEFI partition on the same drive thought that it had to use the filesystem from the old SSD. The new filesystem on the new SSD hasn't been touched. That means I extended the filesystem on the new SSD but never used it.

Thanks to @BluishHumility I catched that hint.

I cloned my old SSD again to my new SSD. Now I kept the UUID on the new SSD and simply deleted the old one. I got into a live usb and extended the partition on the new SSD. After that I mounted the new extended partition at /mnt and simply ran

sudo btrfs filesystem resize max /mnt

Now everything works :muscle:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.