每次启动时强制 fsck 检查多个挂载点?

每次启动时强制 fsck 检查多个挂载点?

我想强制fsck在我的 2 个挂载点上每次启动之前运行(文件系统持续存在问题):

  • /dev/nvme0n1p2
  • /dev/nvme0n1p4
> mount | grep nvme0
/dev/nvme0n1p2 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/nvme0n1p1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/nvme0n1p4 on /home type ext4 (rw,relatime)

我的 fstab 如下所示:

> more /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
#
# / was on /dev/nvme0n1p2 during installation
UUID=c8da3896-602b-48a0-969f-d17e2d78ebcb /               ext4    errors=remount-ro 0       1
#
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=02B5-2A18  /boot/efi       vfat    umask=0077      0       1
#
# /home was on /dev/nvme0n1p4 during installation
UUID=4fb469d5-6a3c-4153-9d27-8257d862bb99 /home           ext4    defaults        0       2
#
# swap was on /dev/nvme0n1p3 during installation
UUID=1b1bb9f3-084a-4951-93ac-2c12dc9f15e3 none            swap    sw              0       0

注意 PASS 列,对于 nvme0n1p2,它设置为 1,对于 nvme0n1p4,它设置为 2。

  • 0 – 已禁用
  • 1 – 优先级较高,首先检查
  • 2 – 最后检查

为了在每次系统重新启动后强制fsck执行以下操作:

  • sudo tune2fs -c 1 /dev/nvme0n1p2
  • sudo tune2fs -c 1 /dev/nvme0n1p4

确认命令已应用sudo tune2fs -l /dev/nvme0n1p4

Maximum mount count: 1

但是,每次启动时,我只看到nvme0n1p2正在检查。

为什么nvme0n1p4没有检查第二个挂载点?

请注意,blkid由于某种原因,没有给出任何内容nvme0n1p4

> blkid /dev/nvme0n1p4
> 

因为nvme0n1p2它给出了通常的输出:

> blkid /dev/nvme0n1p2
/dev/nvme0n1p2: UUID="c8da3896-602b-48a0-969f-d17e2d78ebcb" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="ee3e65c7-d35e-4d6e-a856-55cda225dda3"

相关内容