You are not logged in.

#1 2020-06-14 17:37:01

nickgaz
Member
Registered: 2020-06-14
Posts: 2

[SOLVED] btrfs df and du don't match partition size

I just discovered that my root partition seems to be twice as large as the amount of space btrfs thinks I have available.

# lsblk
nvme0n1       259:0    0    477G  0 disk 
├─nvme0n1p1   259:1    0    512G  0 part 
├─nvme0n1p2   259:2    0     64G  0 part /
└─nvme0n1p3   259:3    0  412.4G  0 part /home

# fdisk -l
Disk /dev/nvme0n1p2: 64GB, 68719476736 bytes, 134217728 sectors

# btrfs fi df -h /
Data, single: total=29.74GiB, used=29.27GiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=2.26GiB, used=2.16GiB
GlobalReserve, single: total=96.23MiB, used=0.00B

# btrfs fi du -h -s /
     Total   Exclusive  Set shared  Filename
120.81GiB    18.11GiB     11.07GiB  /

# resize2fs /dev/nvme0n1p2
Device or resource busy while trying to open /dev/nvme0n1p2
Couldn't find valid filesystem superblock

I'm at a loss trying to understand why or how to fix this. Any advice on what to try would be greatly appreciated.

Last edited by nickgaz (2020-06-14 22:32:40)

Offline

#2 2020-06-14 19:45:05

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,653
Website

Re: [SOLVED] btrfs df and du don't match partition size

resize2fs is a ext* command, it won't work on btrfs partitions.

Use 'btrfs filesystem resize' instead.

As for the 'why', well, how did you create the partition and filesystem in the first place?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2020-06-14 20:34:15

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [SOLVED] btrfs df and du don't match partition size

Run one of these commands here, they show a more useful output than "btrfs fi df":

sudo btrfs fi usage /

sudo btrfs fi show /

The "btrfs fi df" output is a bit useless. The "man btrfs-filesystem" documentation says it's more of a debug command.

Offline

#4 2020-06-14 20:57:22

nickgaz
Member
Registered: 2020-06-14
Posts: 2

Re: [SOLVED] btrfs df and du don't match partition size

Thanks, I'm new to btrfs and didn't realize resize2fs didn't work with it. btrfs fi resize max / did the trick.

It's been a while since the install, but I remember originally setting the partition to a smaller number before changing my mind and going with to 64GB. I probably didn't properly resize the filesystem and only now realized because I ran out of space.

Anyway, thanks for the help and thanks for the advice about usage/show

Offline

#5 2020-06-14 22:30:52

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,653
Website

Re: [SOLVED] btrfs df and du don't match partition size

Please remember to mark your topic as solved by editing the first post and amending the topic title.

https://wiki.archlinux.org/index.php/Co … ow_to_post


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB