Open develroo opened 1 year ago
I tried this patch on my system which uses RAID5.
Unfortunately this only works for the first device in the array, since df
only sees the first disk.
I think we can change is_btrfs()
to this.
is_btrfs() {
btrfs device stats $1 &>/dev/null
}
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 the is_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.