Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

(SOLVED) BTRFS Disk Empty in Array, But Showing 538MB Used

Featured Replies

Into my unRaid I have all disks from Array formated as BTRFS. For my expansion with 3 WD Red 4TB (2 for Parity and 1 for array) I started to clean other 3 smaller disks.

At this moment one of the 3 disks is completely empty, there are 2 more to go.

I have noticed that even with no data on Disk1, the disk have 538MB used.

 

image.png.79616d604a66a2ff89d99a78cda2ce1d.png

 

Quote

root@Node804:/# df -h /mnt/disk1
Filesystem      Size  Used Avail Use% Mounted on
/dev/md1        466G  513M  465G   1% /mnt/disk1
 

root@Node804:/# btrfs fi df /mnt/disk1/
Data, single: total=1.00GiB, used=512.00KiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=1.00GiB, used=112.00KiB
GlobalReserve, single: total=512.00MiB, used=0.00B
 

root@Node804:/# du -sh /mnt/disk1
16K     /mnt/disk1
 

root@Node804:/# ls -la /mnt/disk1
total 16
drwxrwxrwx  1 nobody users   0 Jul  4 21:35 ./
drwxr-xr-x 14 root   root  280 Jul  4 12:38 ../

 

root@Node804:/#

 

Can someone explain me why this is happening?

  • Community Expert

It is quite normal for a disk that has no files on it to have a small amount of space used.    Even an empty disk has space used for the control structures that make up the file system.

Hi,

I think you've got what I'll call 'stuck deletes' - typically the OS will sometimes allow you to 'delete' a file but it doesn't actually remove the file(s) until the process that's holding them open exits.

It's easy enough to check:

lsof | grep -i deleted

 

This should show you the files that are marked as 'deleted' but are essentially pending deletion. It'll also show the process that's holding them open - you could try turning that process off and on again to fix it. Failing that - array off then on, or finally a restart should clear this issue up.

While I'd expect to see some disk usage - 500MB is bit higher than one would expect for 'the control structures that make up the file system.'

Del

  • Author
9 minutes ago, Delarius said:

It's easy enough to check:

lsof | grep -i deleted

Quote

root@Node804:~# lsof | grep -i deleted|grep disk1
root@Node804:~#
 

 

That is quite odd, often in similar cases I've seen 'deleted' files cause this space mismatch. Clearly not in this case unless it's got them open under the device /dev/md1 or /dev/sd[a-z]

Another thing you can check - and I'm not at my server right now, but there's a btrfs balance item somewhere in the unraid Web GUI - I seem to recall under disk settings?

I just noted that it's definitely allocating that space as GlobalReserve:

51 minutes ago, FlorinB said:

root@Node804:/# btrfs fi df /mnt/disk1/
Data, single: total=1.00GiB, used=512.00KiB
System, single: total=4.00MiB, used=16.00KiB
Metadata, single: total=1.00GiB, used=112.00KiB
GlobalReserve, single: total=512.00MiB, used=0.00B

I believe the filesystem has reserved that space but clearly it isn't necessary for a blank disk - if you can find that page in the GUI it should allow you to fix it that way, otherwise it's something like:

btrfs balance start -v -dusage=0 /mnt/disk1

  • Author
7 minutes ago, Delarius said:

btrfs balance start -v -dusage=0 /mnt/disk1

Quote

root@Node804:~# btrfs balance start -v -dusage=0 /mnt/disk1
Dumping filters: flags 0x1, state 0x0, force is off
  DATA (flags 0x2): balancing, usage=0
Done, had to relocate 0 out of 3 chunks
root@Node804:~# df -h /mnt/disk1
Filesystem      Size  Used Avail Use% Mounted on
/dev/md1        466G  513M  465G   1% /mnt/disk1
root@Node804:~#

 

10 minutes ago, Delarius said:

I believe the filesystem has reserved that space but clearly it isn't necessary for a blank disk

Looks like you are right, btrfs has reserved that space, even if is not used

Quote

root@Node804:~# btrfs filesystem usage /mnt/disk1
Overall:
    Device size:                       465.76GiB
    Device allocated:              2.00GiB
    Device unallocated:         463.76GiB
    Device missing:                0.00B
    Used:                                  640.00KiB
    Free (estimated):             464.76GiB      (min: 464.76GiB)
    Data ratio:                        1.00
    Metadata ratio:               1.00
    Global reserve:              512.00MiB      (used: 0.00B)

Data,single: Size:1.00GiB, Used:512.00KiB
   /dev/md1        1.00GiB

Metadata,single: Size:1.00GiB, Used:112.00KiB
   /dev/md1        1.00GiB

System,single: Size:4.00MiB, Used:16.00KiB
   /dev/md1        4.00MiB

Unallocated:
   /dev/md1      463.76GiB

Similar info can be found here https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-filesystem

 

Thanks.

  • FlorinB changed the title to (SOLVED) BTRFS Disk Empty in Array, But Showing 538MB Used

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.