我的 fstab 有什么问题?

我的 fstab 有什么问题?

尝试将第二个驱动器安装到 /media/media 文件夹中:

/dev/sda /media/media ext4 auto,exec,rw,user,async 0 0

但它失败了,导致我跳过。

使用 12.04。

这是完整的 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>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sdb1 during installation
UUID=72e34f04-a84f-41b5-931c-8e1a08b0315e /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb5 during installation
UUID=d2a7845a-01cc-4a55-93a6-f86b694804de none            swap    sw              0       0
/dev/sda /media/media ext4 auto,exec,rw,user,async 0 0  

这是我的错误:

fsck.ext4: Bad magic number in super-block while trying to open /dev/sda
/dev/sda: 
The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device&gt;

mountall: fsck /media/media [708] terminated with status 8
mountall: Unrecoverable fsck error: /media/media
/dev/sdb1: clean, 197231/7331840 files, 1544679/29305088 blocks
Ignoring errors with /media/media at user request
mount: wrong fs type, bad option, bad superblock on /dev/sda,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

mountall: mount /media/media [808] terminated with status 32
mountall: Filesystem could not be mounted: /media/media
Skipping /media/media at user request

答案1

我认为问题可能是您尝试启动的是设备而不是驱动器。这些说明可能会有所帮助。

尝试运行sudo blkid。这将给出驱动器及其唯一标识符 (UUID) 的列表。输出将类似于...(可能还有更多)

/dev/sdb3: LABEL="extras" UUID="94b47b57-1f66-4e1f-8280-4b016c6c055e" TYPE="ext4" 
/dev/sdb5: LABEL="backup" UUID="4b55b1c7-7219-48b4-a82f-b4affb4896df" TYPE="ext4"

找到您尝试自动启动的驱动器/分区的 UUID,并在 /etc/fstab 文件中使用此 UUID。还可以尝试使用默认选项进行安装。该行看起来类似于.....

UUID=<UUID> /media/media    <TYPE>    defaults      2 2

用 blkid 列出的选项替换<UUID>和。<TYPE>

重要的: 确保/媒体/媒体存在

祝你好运

相关内容