Open jadijadi opened 5 months ago
What's the output of df --output=fstype .
and df --output=fstype
?
Edit: I'm able to reproduce it on my machine. It seems to be related to tmpfs
: running df -t ext4 .
on a tmpfs
file system fails with "no file systems processed", whereas with uutils df it doesn't fail.
here you are
df --output=fstype .
Type
ext4
df --output=fstype
Type
ext4
devtmpfs
tmpfs
efivarfs
tmpfs
tmpfs
vfat
ext4
tmpfs
target/debug/coreutils df --output=fstype .
Type
ext4
target/debug/coreutils df --output=fstype
Type
ext4
devtmpfs
tmpfs
efivarfs
tmpfs
tmpfs
vfat
ext4
tmpfs
Edit: I'm able to reproduce it on my machine. It seems to be related to
tmpfs
: runningdf -t ext4 .
on atmpfs
file system fails with "no file systems processed", whereas with uutils df it doesn't fail.
This looks done? Test passes and manuel test is getting the expected result:
# target/release/coreutils df -T /dev/shm
Filesystem Type 1K-blocks Used Available Use% Mounted on
tmpfs tmpfs 1879516 375292 1504224 20% /dev/shm
# target/release/coreutils df -t ext4 /dev/shm
df: no file systems processed
(second try)
# target/release/coreutils df -T /tmp
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/nvme0n1p1 xfs 8376300 4247452 4128848 51% /
# target/release/coreutils df -t ext4 /tmp
df: no file systems processed
@kralo hm, I'm still able to reproduce it on my machine:
$ cargo run df -T /dev/shm
Filesystem Type 1K-blocks Used Available Use% Mounted on
tmpfs tmpfs 4011708 85000 3926708 3% /dev/shm
$ cargo run df -t ext4 /dev/shm
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda8 458020024 415326384 19400868 96% /
I'm still able to reproduce it on my machine:
$ cargo run df -t ext4 /dev/shm Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda8 458020024 415326384 19400868 96% /
This second invocation looks very strange. Why does it report the mountpoint /
when you asked about /dev/shm
?
Might we establish common test procedure? What about
cd /dev/shm
fallocate -l 6M testvol
mkfs.fat testvol
mkdir testmnt
sudo mount testvol testmnt
sudo touch testmnt/testfile
$ cargo run df -T /dev/shm/testmnt/
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/loop6 vfat 6114 0 6114 0% /dev/shm/testmnt
$ cargo run df -t ext4 /dev/shm/testmnt/
df: no file systems processed
could you share complete df -T
?
Sure, here it is:
$ cargo run df -T /dev/shm/testmnt
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/loop0 vfat 6114 0 6114 0% /dev/shm/testmnt
$ cargo run df -t ext4 /dev/shm/testmnt
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda8 458020024 414414544 20312708 96% /
$ df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
dev devtmpfs 3980580 0 3980580 0% /dev
run tmpfs 4011712 1516 4010196 1% /run
efivarfs efivarfs 88 86 0 100% /sys/firmware/efi/efivars
/dev/sda8 ext4 458020024 414414608 20312644 96% /
tmpfs tmpfs 4011712 72968 3938744 2% /dev/shm
tmpfs tmpfs 4011712 16236 3995476 1% /tmp
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-journald.service
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-tmpfiles-setup-dev-early.service
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-udev-load-credentials.service
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-sysctl.service
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-sysusers.service
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-tmpfiles-setup-dev.service
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-vconsole-setup.service
/dev/sda2 vfat 262144 211604 50540 81% /boot
tmpfs tmpfs 1024 0 1024 0% /run/credentials/systemd-tmpfiles-setup.service
tmpfs tmpfs 802340 88 802252 1% /run/user/1000
/dev/loop0 vfat 6114 0 6114 0% /dev/shm/testmnt
aah, I can reproduce, if you choose the filesystem that is your /
, for me, btrfs .
That is a bug
$ cargo run df -t btrfs /dev/shm/testmnt/
Compiling uu_df v0.0.26 (/opt/maxprogs/coreutils/src/uu/df)
Compiling coreutils v0.0.26 (/opt/maxprogs/coreutils)
Finished dev [unoptimized + debuginfo] target(s) in 2.87s
Running `target/debug/coreutils df -t btrfs /dev/shm/testmnt/`
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 234431488 130969240 101320408 57% /
running
cargo test --features "df" --no-default-features
on my machine (Fedora 39) fails with:On command line, running
df -t ext4 .
is successful with the following stdout:but the test expects a failure.