为什么我的驱动器没有在 /dev/disk/by-uuid 和 by-label 下列出?

为什么我的驱动器没有在 /dev/disk/by-uuid 和 by-label 下列出?

从 Ubuntu 16.04.2 升级到 16.04.3(内核 4.4.0-64 到 4.4.0-112)后,我的一个驱动器在启动后无法挂载。

我尝试使用旧内核重新启动,但问题仍然存在 - 所以也许不是由于升级,而是由于重新启动(已经有一段时间了)。

症状
/dev/sdg1 启动后在 /dev/disk/by-uuid、/dev/disk/by-label 中没有条目。

控制台输出

Timed out waiting for device dev-disk-by ....
Dependency failed for File System Check on /dev/disk/by-label/data_raid1_05

系统日志

Jan 31 16:52:15 srv009 systemd[1]: dev-disk-by\x2dlabel-data_raid1_05.device: Job dev-disk-by\x2dlabel-data_raid1_05.device/start timed out.
Jan 31 16:52:15 srv009 systemd[1]: Timed out waiting for device dev-disk-by\x2dlabel-data_raid1_05.device.
Jan 31 16:52:15 srv009 systemd[1]: Dependency failed for /mnt/data_raid1_05.
Jan 31 16:52:15 srv009 systemd[1]: mnt-data_raid1_05.mount: Job mnt-data_raid1_05.mount/start failed with result 'dependency'.
Jan 31 16:52:15 srv009 systemd[1]: Dependency failed for File System Check on /dev/disk/by-label/data_raid1_05.
Jan 31 16:52:15 srv009 systemd[1]: systemd-fsck@dev-disk-by\x2dlabel-data_raid1_05.service: Job systemd-fsck@dev-disk-by\x2dlabel-data_raid1_05.service/start failed with result 'dependency'.
Jan 31 16:52:15 srv009 systemd[1]: dev-disk-by\x2dlabel-data_raid1_05.device: Job dev-disk-by\x2dlabel-data_raid1_05.device/start failed with result 'timeout'.
Jan 31 16:56:28 srv009 systemd[1]: dev-disk-by\x2dlabel-data_raid1_05.device: Job dev-disk-by\x2dlabel-data_raid1_05.device/start timed out.
Jan 31 16:56:28 srv009 systemd[1]: Timed out waiting for device dev-disk-by\x2dlabel-data_raid1_05.device.
Jan 31 16:56:28 srv009 systemd[1]: Dependency failed for /mnt/data_raid1_05.
Jan 31 16:56:28 srv009 systemd[1]: mnt-data_raid1_05.mount: Job mnt-data_raid1_05.mount/start failed with result 'dependency'.
Jan 31 16:56:28 srv009 systemd[1]: Dependency failed for File System Check on /dev/disk/by-label/data_raid1_05.
Jan 31 16:56:28 srv009 systemd[1]: systemd-fsck@dev-disk-by\x2dlabel-data_raid1_05.service: Job systemd-fsck@dev-disk-by\x2dlabel-data_raid1_05.service/start failed with result 'dependency'.
Jan 31 16:56:28 srv009 systemd[1]: dev-disk-by\x2dlabel-data_raid1_05.device: Job dev-disk-by\x2dlabel-data_raid1_05.device/start failed with result 'timeout'.

该驱动器出现在 /dev/ 下:

$ ls -la /dev/sd*
brw-rw---- 1 root disk 8,   0 Feb  1 15:58 /dev/sda
brw-rw---- 1 root disk 8,   1 Feb  1 15:58 /dev/sda1
brw-rw---- 1 root disk 8,   2 Feb  1 15:58 /dev/sda2
brw-rw---- 1 root disk 8,   3 Feb  1 15:58 /dev/sda3
brw-rw---- 1 root disk 8,  16 Feb  1 15:58 /dev/sdb
brw-rw---- 1 root disk 8,  17 Feb  1 15:58 /dev/sdb1
brw-rw---- 1 root disk 8,  32 Feb  1 15:58 /dev/sdc
brw-rw---- 1 root disk 8,  33 Feb  1 15:58 /dev/sdc1
brw-rw---- 1 root disk 8,  48 Feb  1 15:58 /dev/sdd
brw-rw---- 1 root disk 8,  49 Feb  1 15:58 /dev/sdd1
brw-rw---- 1 root disk 8,  64 Feb  1 15:58 /dev/sde
brw-rw---- 1 root disk 8,  65 Feb  1 15:58 /dev/sde1
brw-rw---- 1 root disk 8,  80 Feb  1 15:58 /dev/sdf
brw-rw---- 1 root disk 8,  81 Feb  1 15:58 /dev/sdf1
brw-rw---- 1 root disk 8,  96 Feb  1 15:58 /dev/sdg   <<<<
brw-rw---- 1 root disk 8,  97 Feb  1 15:58 /dev/sdg1  <<<<
brw-rw---- 1 root disk 8, 112 Feb  1 15:58 /dev/sdh
brw-rw---- 1 root disk 8, 113 Feb  1 15:58 /dev/sdh1
brw-rw---- 1 root disk 8, 128 Feb  1 15:58 /dev/sdi
brw-rw---- 1 root disk 8, 129 Feb  1 15:58 /dev/sdi1

它没有显示在 /dev/disk/by-uuid 下:

$ ls -la /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 280 Feb  1 15:58 .
drwxr-xr-x 8 root root 160 Feb  1 15:58 ..
lrwxrwxrwx 1 root root  10 Feb  1 15:58 087a0805-e19e-45bc-af9e-4b8d3dadb1a2 -> ../../sdc1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 097efec2-0b12-4ebb-b49b-a34ed546c3ec -> ../../sda2
lrwxrwxrwx 1 root root  10 Feb  1 15:58 144116a4-d06a-4010-bd0d-73939d84ae6b -> ../../dm-0
lrwxrwxrwx 1 root root  10 Feb  1 15:58 243c2f71-cef9-4c11-84bf-bcc83369fab3 -> ../../sdi1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 507C-B536 -> ../../sda1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 7007bc1b-2788-4ace-b384-450c507ee936 -> ../../dm-2
lrwxrwxrwx 1 root root  10 Feb  1 15:58 7ce16b35-f9fd-45af-a85b-b23460c354c2 -> ../../sdd1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 91c7d5cf-a80d-43be-aa13-501196699e4b -> ../../sdb1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 cb8b9186-f6f2-4d89-be91-dc2c255c22bd -> ../../sde1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 d6933c89-7856-4c7c-996b-7213f36e3f43 -> ../../sdf1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 da290498-e8bc-4566-aca3-35c45098799e -> ../../dm-1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 f36ada4a-188a-4810-88f7-c66cc244552a -> ../../sdh1

它也没有在 /dev/disk/by-label 中列出:

$ ls -la /dev/disk/by-label/
total 0
drwxr-xr-x 2 root root 180 Feb  1 15:58 .
drwxr-xr-x 8 root root 160 Feb  1 15:58 ..
lrwxrwxrwx 1 root root  10 Feb  1 15:58 data_raid1_00 -> ../../sdb1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 data_raid1_01 -> ../../sdc1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 data_raid1_02 -> ../../sdd1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 data_raid1_03 -> ../../sde1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 data_raid1_04 -> ../../sdf1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 data_raid1_06 -> ../../sdh1
lrwxrwxrwx 1 root root  10 Feb  1 15:58 data_raid1_07 -> ../../sdi1

lsblk 确实显示了驱动器,但没有 FSTYPE、LABEL 和 UUID:

lsblk -f
NAME                  FSTYPE      LABEL         UUID                                   MOUNTPOINT
sda
|-sda1                vfat                      507C-B536                              /boot/efi
|-sda2                ext2                      097efec2-0b12-4ebb-b49b-a34ed546c3ec   /boot
`-sda3                LVM2_member               rfdnUU-fUHx-IkTG-0MYA-UiiP-826T-rae5L3
  |-srv009--vg-root   ext4                      144116a4-d06a-4010-bd0d-73939d84ae6b   /
  |-srv009--vg-swap_1 swap                      da290498-e8bc-4566-aca3-35c45098799e   [SWAP]
  `-srv009--vg-home   ext4                      7007bc1b-2788-4ace-b384-450c507ee936   /home
sdb
`-sdb1                ext4        data_raid1_00 91c7d5cf-a80d-43be-aa13-501196699e4b   /mnt/data_raid1_00
sdc
`-sdc1                ext4        data_raid1_01 087a0805-e19e-45bc-af9e-4b8d3dadb1a2   /mnt/data_raid1_01
sdd
`-sdd1                ext4        data_raid1_02 7ce16b35-f9fd-45af-a85b-b23460c354c2   /mnt/data_raid1_02
sde
`-sde1                ext4        data_raid1_03 cb8b9186-f6f2-4d89-be91-dc2c255c22bd   /mnt/data_raid1_03
sdf
`-sdf1                ext4        data_raid1_04 d6933c89-7856-4c7c-996b-7213f36e3f43   /mnt/data_raid1_04
sdg
`-sdg1                                                                                 /mnt/data_raid1_05   <<<<<< STRANGE !!!!!
sdh
`-sdh1                ext4        data_raid1_06 f36ada4a-188a-4810-88f7-c66cc244552a   /mnt/data_raid1_06
sdi
`-sdi1                ext4        data_raid1_07 243c2f71-cef9-4c11-84bf-bcc83369fab3   /mnt/data_raid1_07

tune2fs 看起来还好吗?

$ sudo tune2fs -l /dev/sdg1
tune2fs 1.42.13 (17-May-2015)
Filesystem volume name:   data_raid1_05
Last mounted on:          /mnt/data_raid1_05
Filesystem UUID:          27ace7e6-be7b-4b1d-b184-52434b2aefff
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nl  ink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              244154368
Block count:              976616960
Reserved block count:     9766169
Free blocks:              507536809
Free inodes:              244149728
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      791
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Wed Oct  7 16:57:16 2015
Last mount time:          Thu Feb  1 10:09:43 2018
Last write time:          Thu Feb  1 10:21:37 2018
Mount count:              4
Maximum mount count:      -1
Last checked:             Wed Jan 31 21:43:21 2018
Check interval:           0 (<none>)
Lifetime writes:          122 TB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      8782519a-3180-4f81-bf6d-1bb4a0d0d66a
Journal backup:           inode blocks

systemd 版本:

systemd --version
systemd 229
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN

服务器:

Dell R730xd
Drives sdb to sdi are similar - RAID-1 with 2 drives in each.

我在其他地方找不到解决方案。我根据其他类似的问题尝试了以下方法 - 但都没有成功:

  1. sudo udevadm 触发器
  2. sudo 更新-initramfs -u
  3. 完全关闭电源而不是重置

手动挂载不会显示错误,但 systemd 会卡住并再次卸载它:

$ sudo mount -L data_raid1_05
$
$ tail -f /var/log/syslog
Feb  1 16:40:51 srv009 prometheus_scollector[4074]: t=2018-02-01T16:40:51+0100 lvl=info msg=processed messages=110 samples=111 types=0 caller=main.go:239
Feb  1 16:40:59 srv009 systemd[1]: Starting Stop ureadahead data collection...
Feb  1 16:40:59 srv009 systemd[1]: Stopped Read required files in advance.
Feb  1 16:40:59 srv009 systemd[1]: Started Stop ureadahead data collection.
Feb  1 16:41:06 srv009 prometheus_scollector[4074]: t=2018-02-01T16:41:06+0100 lvl=info msg=processed messages=110 samples=111 types=0 caller=main.go:239
Feb  1 16:41:07 srv009 kernel: [   90.164170] EXT4-fs (sdg1): mounted filesystem with ordered data mode. Opts: errors=remount-ro
Feb  1 16:41:16 srv009 systemd[1]: dev-disk-by\x2dlabel-data_raid1_05.device: Job dev-disk-by\x2dlabel-data_raid1_05.device/start timed out.
Feb  1 16:41:16 srv009 systemd[1]: Timed out waiting for device dev-disk-by\x2dlabel-data_raid1_05.device.
Feb  1 16:41:16 srv009 systemd[1]: dev-disk-by\x2dlabel-data_raid1_05.device: Job dev-disk-by\x2dlabel-data_raid1_05.device/start failed with result 'timeout'.
Feb  1 16:41:16 srv009 systemd[1]: Startup finished in 8.034s (kernel) + 1min 30.187s (userspace) = 1min 38.221s.

我也尝试过增加 fstab 中的超时时间:

LABEL=data_raid1_05 /mnt/data_raid1_05 ext4 nofail,errors=remount-ro 0 2
to
LABEL=data_raid1_05 /mnt/data_raid1_05 ext4 nofail,errors=remount-ro,x-systemd.device-timeout=50s,x-systemd.mount-timeout=50s 0 2

什么工作,是这样的:

sudo systemctl daemon-reload
sudo mount -L data_raid1_05

运行上述程序会安装驱动器,我可以正常访问数据,但 /dev/disk/by-uuid 等中仍然没有条目。

我很困惑,希望您能提供一些线索以便进一步调查。

相关内容