我有 Ubuntu 20.04 Linux,并且创建了第二个磁盘和第二个文件系统。现在,当我想查看信息时,我的第二个文件系统 df 没有显示。我使用默认安装规范。
df -ah
Filesystem Size Used Avail Use% Mounted on
sysfs 0 0 0 - /sys
proc 0 0 0 - /proc
udev 3.9G 0 3.9G 0% /dev
devpts 0 0 0 - /dev/pts
tmpfs 795M 1.6M 794M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 49G 13G 34G 27% /
securityfs 0 0 0 - /sys/kernel/security
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
cgroup2 0 0 0 - /sys/fs/cgroup/unified
cgroup 0 0 0 - /sys/fs/cgroup/systemd
pstore 0 0 0 - /sys/fs/pstore
none 0 0 0 - /sys/fs/bpf
cgroup 0 0 0 - /sys/fs/cgroup/freezer
cgroup 0 0 0 - /sys/fs/cgroup/hugetlb
cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct
cgroup 0 0 0 - /sys/fs/cgroup/net_cls,net_prio
cgroup 0 0 0 - /sys/fs/cgroup/pids
cgroup 0 0 0 - /sys/fs/cgroup/memory
cgroup 0 0 0 - /sys/fs/cgroup/devices
cgroup 0 0 0 - /sys/fs/cgroup/blkio
cgroup 0 0 0 - /sys/fs/cgroup/cpuset
cgroup 0 0 0 - /sys/fs/cgroup/perf_event
cgroup 0 0 0 - /sys/fs/cgroup/rdma
systemd-1 0 0 0 - /proc/sys/fs/binfmt_misc
hugetlbfs 0 0 0 - /dev/hugepages
mqueue 0 0 0 - /dev/mqueue
tracefs 0 0 0 - /sys/kernel/tracing
debugfs 0 0 0 - /sys/kernel/debug
configfs 0 0 0 - /sys/kernel/config
fusectl 0 0 0 - /sys/fs/fuse/connections
/dev/loop0 71M 71M 0 100% /snap/lxd/21029
/dev/sda2 976M 299M 610M 33% /boot
/dev/loop1 56M 56M 0 100% /snap/core18/2128
tmpfs 795M 1.6M 794M 1% /run/snapd/ns
/dev/loop4 62M 62M 0 100% /snap/core20/1081
/dev/loop5 68M 68M 0 100% /snap/lxd/21545
nsfs 0 0 0 - /run/snapd/ns/lxd.mnt
/dev/mapper/elk--vg-elk--lv - - - - /mnt/elk
/dev/loop6 62M 62M 0 100% /snap/core20/1169
/dev/loop7 33M 33M 0 100% /snap/snapd/13270
/dev/loop2 33M 33M 0 100% /snap/snapd/13640
/dev/loop8 56M 56M 0 100% /snap/core18/2246
tmpfs 795M 0 795M 0% /run/user/1000
/mnt/elk 是我的第二个文件系统,它显示 - - -
UUID=764818a1-03bd-4f7a- /mnt/elk ext4 defaults 0 1
这是我的 fstab 文件行
当我切换用户 root 时,df 显示 /mnt/elk 文件系统信息
df -h
Filesystem Size Used Avail Use% Mounted on
udev 3.9G 0 3.9G 0% /dev
tmpfs 795M 1.6M 794M 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv 49G 13G 34G 27% /
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/loop0 71M 71M 0 100% /snap/lxd/21029
/dev/sda2 976M 299M 610M 33% /boot
/dev/loop1 56M 56M 0 100% /snap/core18/2128
/dev/loop4 62M 62M 0 100% /snap/core20/1081
/dev/loop5 68M 68M 0 100% /snap/lxd/21545
/dev/mapper/elk--vg-elk--lv 196G 13G 174G 7% /mnt/elk
/dev/loop6 62M 62M 0 100% /snap/core20/1169
/dev/loop7 33M 33M 0 100% /snap/snapd/13270
/dev/loop2 33M 33M 0 100% /snap/snapd/13640
/dev/loop8 56M 56M 0 100% /snap/core18/2246
tmpfs 795M 0 795M 0% /run/user/1000
看起来像是相关许可,但没有任何限制
答案1
根据评论中的讨论,在这种情况下应遵循的步骤:
- 首先检查读/写设置
mount
- 还请检查该路径是否可供用户访问,并在必要时进行更正。