无法通过 /etc/fstab 挂载

无法通过 /etc/fstab 挂载

全部:

启动新服务器时,我遇到以下情况。我可以通过以下命令手动将设备挂载在 /dev/sda1:mount /dev/sda1 /owncloud

但是当我在 /etc/fstab 中使用推荐的方法 (UUID) 时,我收到一条错误消息,提示设备不存在。这与 blkid 告诉我的相反,所以我很困惑。(其他地方的一篇文章建议告诉内核重新读取分区表,这就是接下来的第一个命令的全部内容。)

    /etc> sudo blockdev --rereadpt /dev/sda

    /etc> blkid
    /dev/mmcblk0p1: LABEL_FATBOOT="boot" LABEL="boot" UUID="6341-C9E5" TYPE="vfat" PARTUUID="ea7d04d6-01"
    /dev/mmcblk0p2: LABEL="rootfs" UUID="80571af6-21c9-48a0-9df5-cffb60cf79af" TYPE="ext4" 
               PARTUUID="ea7d04d6-02"
    /dev/sda1: LABEL="owncloud" UUID="172715c3-abba-4a4b-b81e-47c9bbe28faf" TYPE="ext4" 
               PARTUUID="27760ec0-01"
    /dev/mmcblk0: PTUUID="ea7d04d6" PTTYPE="dos"

    /etc> mount /owncloud
    mount: /owncloud: special device 172715c3-abba-4a4b-b81e-47c9bbe28faf does not exist.

    /etc> cat /etc/fstab
    proc            /proc           proc    defaults          0       0
    PARTUUID=ea7d04d6-01  /boot           vfat    defaults          0       2
    PARTUUID=ea7d04d6-02  /               ext4    defaults,noatime  0       1
    # a swapfile is not a swap partition, no line here
    #   use  dphys-swapfile swap[on|off]  for that

    172715c3-abba-4a4b-b81e-47c9bbe28faf    /owncloud       ext4 permissions,locale=en_us.utf8 0 1

    /etc> > mount /dev/sda1 /owncloud; mount|grep sda
    /dev/sda1 on /owncloud type ext4 (rw,relatime)

有什么想法为什么这不起作用吗?

感谢您的帮助。

答案1

这里发生了几件事。首先,/etc/fstab 条目在第 1 列中缺少最重要的 UUID=。糟糕。

其次,我在尝试挂​​载时开始收到此信息:

mount: /owncloud: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.

在系统日志中发现错误,例如:

/etc> tail /var/log/syslog
Apr 29 13:50:32 owncloud dhcpcd[393]: unrelated
Apr 29 13:51:39 owncloud systemd[1]: owncloud.mount: Succeeded.
Apr 29 13:51:39 owncloud systemd[622]: owncloud.mount: Succeeded.
Apr 29 13:51:39 owncloud systemd[1260]: owncloud.mount: Succeeded.
Apr 29 13:51:43 owncloud kernel: [ 1872.011604] EXT4-fs (sda1): Unrecognized mount option "permissions" or missing value
Apr 29 13:52:36 owncloud dhcpcd[393]: unrelated
Apr 29 13:52:45 owncloud kernel: [ 1933.657532] EXT4-fs (sda1): Unrecognized mount option "gid=33" or missing value
Apr 29 13:53:51 owncloud dhcpcd[393]: unrelated
Apr 29 13:53:53 owncloud kernel: [ 2002.026605] EXT4-fs (sda1): Unrecognized mount option "permissions" or missing value
Apr 29 13:54:11 owncloud kernel: [ 2019.989320] EXT4-fs (sda1): Unrecognized mount option "locale=en_us.utf8" or missing value

事实证明,我指定的选项均无效。我把权限选项、语言环境等所有内容都改为 nofail - 一切正常。

我希望这个答案能够对某些人有所帮助。

相关内容