Ubuntu 22.04添加Thunderbolt外置SSD到fstab后无法启动的问题求助
各位好,我遇到个头疼的问题:在2018款Intel Mac Mini上装了Ubuntu 22.04,因为内置存储只有128GB,就加了个SanDisk PRO-G40 1TB的Thunderbolt外置SSD,把它挂载到/opt目录,手动挂载一切正常,但重启系统就直接卡启动失败,想请教大家怎么解决。
先说说我的操作过程和现状:
Thunderbolt设备授权:
因为是Thunderbolt设备,我先用boltctl authorize <uuid>授权,但重启后授权失效,后来用boltctl enroll <uuid>搞定了持久化授权,现在boltctl输出如下:● SanDisk Professional PRO-G40 ├─ type: peripheral ├─ name: PRO-G40 ├─ vendor: SanDisk Professional ├─ uuid: cc030000-0062-6c0e-8342-bf90cef33103 ├─ generation: Thunderbolt 3 ├─ status: authorized │ ├─ domain: c7010000-0062-640e-03fc-9a92ccf13003 │ ├─ rx speed: 40 Gb/s = 2 lanes * 20 Gb/s │ ├─ tx speed: 40 Gb/s = 2 lanes * 20 Gb/s │ └─ authflags: none ├─ authorized: Sun 20 Aug 2023 02:02:26 AM UTC ├─ connected: Sun 20 Aug 2023 02:02:23 AM UTC └─ stored: Fri 18 Aug 2023 09:14:53 PM UTC ├─ policy: auto └─ key: no分区调整:
原SSD自带200M EFI分区和930G APFS分区,我保留了EFI分区,把APFS分区删除后改成了ext4格式,现在lsblk -o NAME,LABEL,FSTYPE,SIZE,UUID,MOUNTPOINTS的输出为:NAME LABEL FSTYPE SIZE UUID MOUNTPOINTS loop0 squashfs 4K /snap/bare/5 loop1 squashfs 63.4M /snap/core20/1974 loop2 squashfs 63.5M /snap/core20/2015 loop3 squashfs 73.9M /snap/core22/858 loop4 squashfs 237.2M /snap/firefox/2987 loop5 squashfs 237.2M /snap/firefox/3026 loop6 squashfs 349.7M /snap/gnome-3-38-2004/143 loop7 squashfs 485.5M /snap/gnome-42-2204/120 loop8 squashfs 485.5M /snap/gnome-42-2204/126 loop9 squashfs 91.7M /snap/gtk-common-themes/1535 loop10 squashfs 12.3M /snap/snap-store/959 loop11 squashfs 53.3M /snap/snapd/19457 loop12 squashfs 452K /snap/snapd-desktop-integration/83 nvme0n1 113G ├─nvme0n1p1 EFI vfat 300M 5F66-17ED /boot/efi ├─nvme0n1p2 apfs 33.5G 416419fe-742b-4653-b709-42e0ff78f4ec ├─nvme0n1p3 swap 4.7G f7bac42d-0730-40da-be0d-f6de7f4788f2 [SWAP] ├─nvme0n1p4 vfat 954M 32B6-990F └─nvme0n1p5 ext4 73.6G 2532f568-b33b-4583-abd6-2f6e41bb8e28 / nvme1n1 931.5G ├─nvme1n1p1 EFI vfat 200M 67E3-17ED └─nvme1n1p2 ext4 931.3G cb9940d0-5b0b-4273-97d7-b4dd29768926fstab配置与问题出现:
我把外置SSD的ext4分区添加到了/etc/fstab的最后一行:# / was on /dev/nvme0n1p5 during installation UUID=2532f568-b33b-4583-abd6-2f6e41bb8e28 / ext4 errors=remount-ro 0 1 # /boot/efi was on /dev/nvme0n1p1 during installation UUID=5F66-17ED /boot/efi vfat umask=0077 0 1 # swap was on /dev/nvme0n1p3 during installation UUID=f7bac42d-0730-40da-be0d-f6de7f4788f2 none swap sw 0 0 # external SSD mounted to /opt UUID=cb9940d0-5b0b-4273-97d7-b4dd29768926 /opt ext4 rw,relatime 0 2执行
mount -a后挂载成功,mount | grep opt和df -h /opt都显示正常,但重启系统就直接报错:[ TIME ] Timed out waiting for device /dev/disk/by-uuid/cb9940d0-5b0b-4273-97d7-b4dd29768926.
[DEPEND] Dependency failed for /opt.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for File System Check on /dev/disk/by-uuid/cb9940d0-5b0b-4273-97d7-b4dd29768926.
...
[FAILED] Failed to start Set Up Additional Binary Formats.
See 'systemctl status systemd-binfmt.service' for details.进入维护模式后,
lsblk看不到外置SSD,运行boltctl直接卡死,只能强制重启。尝试过的解决方法:
- 我猜测是systemd尝试挂载时,boltd还没启动完成,导致Thunderbolt设备还没被识别,但不知道怎么验证这个猜想。
- 了解到boltd是由systemd/udev启动的,所以修改了fstab的挂载选项,添加
x-systemd.requires=systemd-udevd.service,后来也试过x-systemd.after,但都没有效果。 - 看到过Ask Ubuntu上类似VirtualBox共享文件夹的问题帖子,但没找到适配Thunderbolt设备的解决方案。
想请教大家:
- 怎么验证是不是boltd启动顺序导致的挂载超时?
- 有没有办法让systemd等Thunderbolt设备就绪后再执行挂载?
- 还有其他可能的原因和解决方向吗?
备注:内容来源于stack exchange,提问作者Michael Muller




