All my GUI programs started showing 16TB total space and 8TB free space available, while it should be 8TB total and 4TB available. Any ideas what went wrong and how to fix it?
My btrfs
RAID 1 configuration started to show twice as much disk space and free space available, as if my configuration changed to RAID0, but it did not.
I have two identical 8TB disks, I recently upgraded to 5.3.0-46-generic #38~18.04.1-Ubuntu
My /etc/fstab entry looks like this, where UUID is blkid's UUID of /dev/sda & /dev/sdb:
UUID=1b962b21-3130-498b-9543-e84c90f12fdf /mountpoint btrfs defaults 0 0
$ sudo btrfs fi df /mountpoint (this seems OK)
Data, RAID1: total=6.43TiB, used=3.58TiB
Data, single: total=1.00GiB, used=0.00B
System, RAID1: total=64.00MiB, used=1.12MiB
Metadata, RAID1: total=9.03GiB, used=5.19GiB
GlobalReserve, single: total=512.00MiB, used=0.00B
$ sudo btrfs fi usage /mountpoint
Overall:
Device size: 14.55TiB
Device allocated: 12.89TiB
Device unallocated: 1.66TiB
Device missing: 0.00B
Used: 7.17TiB
Free (estimated): 3.69TiB (min: 3.69TiB)
Data ratio: 2.00
Metadata ratio: 2.00
Global reserve: 512.00MiB (used: 0.00B)
Data,single: Size:1.00GiB, Used:0.00B
/dev/sdb 1.00GiB
Data,RAID1: Size:6.43TiB, Used:3.58TiB
/dev/sda 6.43TiB
/dev/sdb 6.43TiB
Metadata,RAID1: Size:9.03GiB, Used:5.19GiB
/dev/sda 9.03GiB
/dev/sdb 9.03GiB
System,RAID1: Size:64.00MiB, Used:1.12MiB
/dev/sda 64.00MiB
/dev/sdb 64.00MiB
Unallocated:
/dev/sda 852.97GiB
/dev/sdb 851.97GiB
$ sudo btrfs device stats
shows no errors for both devices and I just finished full scrub, did not solve my problem. All files are accessible, they don't seem corrupt.
When I go to Nautilus, select all the files on the volume and right-click properties, Contents: totaling shows correct numbers, same as $ du -h /mountpoint
Update
Output of $ blkid /dev/sda
/dev/sda: LABEL="B1" UUID="1b962b21-3130-498b-9543-e84c90f12fce" UUID_SUB="58408830-2442-416f-8e6a-e55bfb430764" TYPE="btrfs" PTTYPE="dos"
Output of $ blkid /dev/sdb
/dev/sdb: LABEL="B1" UUID="1b962b21-3130-498b-9543-e84c90f12fce" UUID_SUB="65bd227f-d2c2-4b5b-a73b-a540989c7d41" TYPE="btrfs"
Output of /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/nvme0n1p2 during installation
UUID=d65dd525-0111-4c6e-a865-b9a912e59e51 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=D7F2-12D3 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
# mount BTRFS 2 x 8TB RAID1
UUID=1b962b21-3130-498b-9543-e84c90f12fce /media/user/B1 btrfs defaults 0 0
# mount old test disks
/dev/disk/by-uuid/1b40a350-7573-4f29-aef6-8be2f34cd111 /mnt/1b40a350-7573-4f29-aef6-8be2f34cd111 auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=TEST2 0 0
/dev/disk/by-uuid/56effa28-df91-4b70-b73e-7665856e829e /mnt/56effa28-df91-4b70-b73e-7665856e829e auto nosuid,nodev,nofail,x-gvfs-show,x-gvfs-name=TEST1 0 0
About the UUID, I formated both disks few years ago with this command:
$ sudo mkfs.btrfs -m raid1 -d raid1 /dev/sda /dev/sdb
And output of $sudo btrfs fi show
is:
Label: 'B1' uuid: 1b962b21-3130-498b-9543-e84c90f12fce
Total devices 2 FS bytes used 3.59TiB
devid 1 size 7.28TiB used 6.44TiB path /dev/sda
devid 2 size 7.28TiB used 6.45TiB path /dev/sdb
So I don't know why, but they have the same uuid.
According to https://btrfs.wiki.kernel.org/index.php/Balance_Filters and thanks to comments to my questions,
btrfs balance
function was the right answer.$sudo btrfs balance start -v -dusage=0 /mountpoint
fixed my problem.Output:
After that, free space is again displayed correctly.