在查看我的每日logwatch报告时,我df今天早上注意到一个新错误。我注意到df列表顶部的异常错误...
~$ df (when run manually from my own account)
df: /run/user/1000/doc: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
或者
(when run via root in the daily logwatch report)
df: /root/.cache/doc: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
该doc目录出现在根/root/.cache/文件夹(我已经删除)和我自己的用户帐户/run/user/1000/文件夹中(或登录后的任何 /run/user/* 目录中)。
我怎样才能找出为什么会df出现这个错误?
更新 #1:
请注意,当我这样做时,ls -al /run/user/1000我得到以下信息,需要注意的一点是该doc目录有一个奇怪的日期。这个目录可能来自哪里?
drwx------ 13 xxxxxxxxxxx xxxxxxxxxxx 380 Apr 16 10:07 .
drwxr-xr-x 4 root root 80 Apr 16 09:56 ..
srw-rw-rw- 1 xxxxxxxxxxx xxxxxxxxxxx 0 …Run Code Online (Sandbox Code Playgroud) 所以我们不小心导致我们的服务器在没有完全关闭的情况下停机,现在df报告外部 USB (exfat) 的错误统计信息。
root@srv1:/backup/usbdisk# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb2 3.6T 2.8T 646G 82% /
...
/dev/sde1 7.3T 241M 7.3T 1% /backup/usbdisk
Run Code Online (Sandbox Code Playgroud)
du 说:
root@srv1:/backup/usbdisk# du -sh
2.6T .
Run Code Online (Sandbox Code Playgroud)
exfatfsck /dev/sde1 说:
exfatfsck 1.1.0
WARN: volume was not unmounted cleanly.
Checking file system on /dev/sde1.
File system version 1.0
Sector size 512 bytes
Cluster size 128 KB
Volume size 7452 GB
Used space 241 MB
Available space 7452 GB
ERROR: cluster 0x3f of …Run Code Online (Sandbox Code Playgroud) 我在单个 8GB 驱动器上安装了 Ubuntu 20.04 服务器。默认安装还安装了一些“快照”。因此,该df命令还报告了一些“squashfs”文件系统:
# df -mT
Filesystem Type 1M-blocks Used Available Use% Mounted on
/dev/root ext4 7877 1837 6025 24% /
devtmpfs devtmpfs 465 0 465 0% /dev
tmpfs tmpfs 477 0 477 0% /dev/shm
tmpfs tmpfs 96 1 95 1% /run
tmpfs tmpfs 5 0 5 0% /run/lock
tmpfs tmpfs 477 0 477 0% /sys/fs/cgroup
/dev/loop0 squashfs 18 18 0 100% /snap/amazon-ssm-agent/1566
/dev/loop1 squashfs 94 94 0 100% /snap/core/9066
/dev/loop2 squashfs 55 55 0 …Run Code Online (Sandbox Code Playgroud) 不知何故,我的系统陷入困境。
$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.2.0-29 linux-headers-3.2.0-29-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-headers-3.2.0-80
The following NEW packages will be installed
linux-headers-3.2.0-80
0 to upgrade, 1 to newly install, 0 to remove and 251 not to upgrade.
3 not fully installed or removed.
Need to get 0 …Run Code Online (Sandbox Code Playgroud) 我正在使用df -h我的磁盘空间,结果是:
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 4.0K 2.0G 1% /dev
tmpfs 396M 436K 395M 1% /run
/dev/vda1 59G 3.6G 53G 7% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 12K 2.0G 1% /run/shm
none 100M 12K 100M 1% /run/user
Run Code Online (Sandbox Code Playgroud)
当我使用时sudo fdisk -l | grep Disk,我得到:
Disk /dev/vda: 64.4 GB, 64424509440 bytes
Disk /dev/sda: 107.4 GB, 107374182400 bytes
Run Code Online (Sandbox Code Playgroud)
为什么不df -h显示空间/dev/sda?如何查看我的总磁盘空间?
$ ls -lh file1.tar
-rw-r--r-- 1 wnice wnice 40K Aug 6 20:41 file1.tar
$ du -sh file1.tar
80K file1.tar
Run Code Online (Sandbox Code Playgroud)
为什么它显示相同文件的不同大小?请帮我理解
我运行命令df -h,它显示udev大小为 471M,其他 5tmpfs个估计大小为 1.1G。我该怎么对他们?
下面是 df 命令的输出
# df /boot
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda2 122835 26732 89550 23% /boot
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚“可用”列是如何计算的。它不等于:
1K-blocks - Used
Run Code Online (Sandbox Code Playgroud)
似乎差不多:
(1K-blocks - Used) - ((1K-blocks) * 5 / 100)
Run Code Online (Sandbox Code Playgroud)
我的问题是,“可用”列是如何计算的?