July 4, 20188 yr 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. 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?
July 4, 20188 yr 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.
July 4, 20188 yr 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
July 4, 20188 yr 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:~#
July 4, 20188 yr 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.00KiBGlobalReserve, 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
July 4, 20188 yr 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 chunksroot@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.
Archived
This topic is now archived and is closed to further replies.