Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories.
GNU General Public License v2.0
897
stars
79
forks
source link
Fix func is_btrfs to cover <path|device> correctly #111
Closed
develroo closed 1 year ago
Currently, in the functions
is_btrfs
,stat -f
will incorrectly report device paths because/dev/
is a virtual filesystem and classified as tmpfs.Eg.
This is correct behaviour for
stat
as according to the coreutils info docs:As the BTRFS documentation specifies
<path|device>
in all the commands, this is obviously undesirable behaviour for theis_btrfs
function.This patch uses df to work around the virtual nature of devices in Linux, while still retaining compatibility with paths.
Hope this helps.