大网数据广告活动
服务器运维问答

See btrfs subvolume df (used & free space)

· 52CE 我爱测

While installing Fedora 33, I chose btrfs, with 32gb for / and the rest for /home I see these are used as 'subvolumes': # cat /etc/fstab # # /etc/fstab # Created by anaconda on Mon Oct 19 13:43:25 2020 # UUID=f1483466-114c-4ef4-b…

问题原文

原帖链接 · Marius · CC BY-SA 4.0

While installing Fedora 33, I chose btrfs, with 32gb for / and the rest for /home

I see these are used as 'subvolumes':

# cat /etc/fstab 

#
# /etc/fstab
# Created by anaconda on Mon Oct 19 13:43:25 2020
#
UUID=f1483466-114c-4ef4-b268-85095d4c4aa8 /                       btrfs   subvol=root,x-systemd.device-timeout=0 0 0
UUID=ef7bc629-cb70-458a-9463-2666c2c233a7 /boot                   ext4    defaults        1 2
UUID=F206-0546          /boot/efi               vfat    umask=0077,shortname=winnt 0 2
UUID=f1483466-114c-4ef4-b268-85095d4c4aa8 /home                   btrfs   subvol=home,x-systemd.device-timeout=0 0 0

I'd like to see how much space is used & free for each partition, but df shows only the total:

Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-0       924G   27G  895G   3% /
tmpfs           3.9G   12K  3.9G   1% /tmp
/dev/dm-0       924G   27G  895G   3% /home

Tried these:

# btrfs device usage /
/dev/mapper/luks-662fb4fb-75b3-4888-a617-0c039f575d3a, ID: 1
   Device size:           923.00GiB
   Device slack:              0.00B
   Data,single:            27.01GiB
   Metadata,DUP:            2.00GiB
   System,DUP:             16.00MiB
   Unallocated:           893.98GiB

# btrfs subvolume list /
ID 256 gen 7177 top level 5 path home
ID 258 gen 7176 top level 5 path root
ID 265 gen 30 top level 258 path var/lib/machines

# btrfs filesystem df /root
Data, single: total=27.01GiB, used=26.17GiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=1.00GiB, used=386.67MiB
GlobalReserve, single: total=45.22MiB, used=0.00B

# btrfs filesystem df /home
Data, single: total=27.01GiB, used=26.17GiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=1.00GiB, used=386.67MiB
GlobalReserve, single: total=45.22MiB, used=0.00B

How can I see / total size of 32gb and how much is used, and same for /home?

已采纳解答

原帖链接 · Ginnungagap · CC BY-SA 4.0

It looks like there is a single partition, split into multiple subvolumes. Subvolumes share the underlying filesystem so the filesystem size and usage for both is indeed the same.

I don't use Fedora but if the installer honored the 32GB restriction on /, it is likely through a qgroup that limits the maximum usage of a given subvolume.

Try btrfs qgroup show / and btrfs qgroup show /home.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-10-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。