强制重启后系统挂在 /etc/fstab 上

强制重启后系统挂在 /etc/fstab 上

我必须关注

fdisk -l

 Device Boot      Start         End      Blocks   Id  System
/dev/sda1         2000896     3999743      999424   83  Linux
/dev/sda2   *     4194304     5242879      524288   83  Linux
/dev/sda3         5242880   167772159    81264640   83  Linux



blkid -o list

device     fs_type label    mount point    UUID
-------------------------------------------------------------------------------
/dev/sda1  swap    swapname (not mounted)  d4bd9a66-3249-4ee4-b92e-ea1d3c31c113
/dev/loop0 ext2             (in use)       40c4ea95-0ecc-4c51-9f3e-e49d8f62f160
/dev/sda2  ext3             (not mounted)  6f1d654f-151d-4e88-8164-b3a318753971
/dev/sda3  ext4             (not mounted)  c930ecd2-929b-4eef-90d3-60a9ee420f95

我的/etc/fstab是空的,当我重新启动时它挂了,我需要添加到uuidetc/fstab

答案1

是的,您需要在 /etc/fstab 中指定 UUID。。。它应该如下所示,具有通用设置、单个分区、挂载点“/”和非加密交换。

# /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/sda3 during installation
UUID=c930ecd2-929b-4eef-90d3-60a9ee420f95 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda1 during installation
UUID=d4bd9a66-3249-4ee4-b92e-ea1d3c31c113 none            swap    sw              0       0

确保您的 /etc/fstab 文件为空。您可能只需要更改 /etc/fstab 条目的 UUID(如果它们由于某种原因而发生了变化,尽管这种情况不太可能发生)。

还,如果您使用加密文件系统,该文件会略有不同。

相关内容