我无法通过 /etc/fstab 挂载分区,出现错误

我无法通过 /etc/fstab 挂载分区,出现错误

我尝试通过编辑 /etc/fstab 来挂载新分区,但出现错误。当我尝试这样做时命令,一切正常,我可以安装它们。怎么了?

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation
/dev/disk/by-id/dm-uuid-LVM-XVpMjvfuIwUMG9eeZN2E09sODMkxF3I8j6u3WkZegGllXAx08ZPZROjo66HKfnG8 / ext4 defaults 0 1
# /boot was on /dev/sda2 during curtin installation
/dev/disk/by-uuid/2d747eec-1c31-4c12-849c-efe362e3245e /boot ext4 defaults 0 1
/swap.img       none    swap    sw      0       0
UUID=a6c59d0e-37a7-4532-b843-6025dabef69f /mnt/sdb1 ext4 default 0 2
UUID=b12d193a-6d04-4cbb-a8da-d8405b38dae0 /mnt/sdb2 btrfs default 0 2
UUID=55165d2b-f3b5-46b2-af04-7366861c82b6 /mnt/sdb3 xfs default 0 2
UUID=1B74-0C7D /mnt/sdb4 vfat default 0 2


user@ubuntu2:~$ sudo mount -a

mount: /mnt/sdb1: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error.
mount: /mnt/sdb2: wrong fs type, bad option, bad superblock on /dev/sdb2, missing codepage or helper program, or other error.
mount: /mnt/sdb3: wrong fs type, bad option, bad superblock on /dev/sdb3, missing codepage or helper program, or other error.
mount: /mnt/sdb4: wrong fs type, bad option, bad superblock on /dev/sdb4, missing codepage or helper program, or other error.

user@ubuntu2:~$ sudo lsblk -f
  sdb
├─sdb1                    ext4               a6c59d0e-37a7-4532-b843-6025dabef69f
├─sdb2                    btrfs              b12d193a-6d04-4cbb-a8da-d8405b38dae0
├─sdb3                    xfs                55165d2b-f3b5-46b2-af04-7366861c82b6
└─sdb4                    vfat               1B74-0C7D

答案1

您在选项中有拼写错误,它是defaults默认的安装选项集,而不是default。没有这样的选项default,因此安装失败。

请注意,如果您将来在挂载时看到类似的错误,您应该始终检查日志,内核将打印附加信息,在这种情况下您应该看到类似以下内容:

xfs:未知参数“默认”

相关内容