无法使用 fstab 进行文件夹挂载

无法使用 fstab 进行文件夹挂载

我正在尝试将我的 G 驱动器(在 WSL 中)安装在/code.但是,它失败并显示以下配置和消息:

LABEL=cloudimg-rootfs   /         ext4  defaults        0 0

/mnt/g                /code   none  defaults,bind 0 0
[ 5159.133867] init: (1) ERROR: UtilCreateProcessAndWait:655: /bin/mount failed with status 0x
[ 5159.133870] 2000
[ 5159.133876] init: (1) ERROR: ConfigMountFsTab:2152: Processing fstab with mount -a failed.
[ 5159.143122] FS-Cache: Duplicate cookie detected
[ 5159.143124] FS-Cache: O-cookie c=0000000092644cce [p=000000007ba11936 fl=222 nc=0 na=1]
[ 5159.143125] FS-Cache: O-cookie d=00000000f69d3d22 n=000000004319b7e9
[ 5159.143125] FS-Cache: O-key=[10] '34323935343533313833'
[ 5159.143128] FS-Cache: N-cookie c=000000000be0e99c [p=000000007ba11936 fl=2 nc=0 na=1]
[ 5159.143129] FS-Cache: N-cookie d=00000000f69d3d22 n=000000005622393b
[ 5159.143129] FS-Cache: N-key=[10] '34323935343533313833'
[ 5159.146589] FS-Cache: Duplicate cookie detected
[ 5159.146592] FS-Cache: O-cookie c=0000000092644cce [p=000000007ba11936 fl=222 nc=0 na=1]
[ 5159.146592] FS-Cache: O-cookie d=00000000f69d3d22 n=000000004319b7e9
[ 5159.146593] FS-Cache: O-key=[10] '34323935343533313833'
[ 5159.146595] FS-Cache: N-cookie c=0000000095f81e84 [p=000000007ba11936 fl=2 nc=0 na=1]
[ 5159.146595] FS-Cache: N-cookie d=00000000f69d3d22 n=0000000024b2120e
[ 5159.146596] FS-Cache: N-key=[10] '34323935343533313833'

安装是在/mnt其他地方完成的吗?

答案1

基本上,您只能将驱动器分区安装到目录中。分区在目录
中可用。/dev/您可以使用命令列出所有它们lsblk

fstab 中的第二行包含:/mnt/g /code。为什么?

也许您只想创建一个从/mnt/g到 的符号链接/code

如果是这样的话,那就是:ln -s /mnt/g /code

相关内容