我的 apt 由於 grub 配置失敗而損壞。
看起來 grub 正在嘗試在我的 zfs 快照中發現 linux 映像:
Setting up linux-image-5.3.0-23-generic (5.3.0-23.25) ...
Processing triggers for man-db (2.8.7-3) ...
Processing triggers for linux-image-5.3.0-23-generic (5.3.0-23.25) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.3.0-23-generic
cryptsetup: ERROR: Couldn't resolve device rpool/ROOT/ubuntu_q9qi62
cryptsetup: WARNING: Couldn't determine root device
I: The initramfs will attempt to resume from /dev/sda5
I: (UUID=a9d90fb7-5154-4897-9a2e-90c040c8ee90)
I: Set the RESUME variable to override this.
/etc/kernel/postinst.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: vmlinuz-5.3.0-18-generic in rpool/ROOT/ubuntu_q9qi62
Found initrd image: initrd.img-5.3.0-18-generic in rpool/ROOT/ubuntu_q9qi62
Found linux image: vmlinuz-5.3.0-19-generic in rpool/ROOT/ubuntu_q9qi62
Found initrd image: initrd.img-5.3.0-19-generic in rpool/ROOT/ubuntu_q9qi62
Found linux image: vmlinuz-5.3.0-23-generic in rpool/ROOT/ubuntu_q9qi62
Found initrd image: initrd.img-5.3.0-23-generic in rpool/ROOT/ubuntu_q9qi62
/etc/grub.d/10_linux_zfs: 338: .: Can't open /tmp/zfsmnt.rcbjOa/etc/.zfs/snapshot/autobackup-sd25sfd-2019-10-23--17-41-11/os-release
umount: /tmp/zfsmnt.rcbjOa: target is busy.
rmdir: failed to remove '/tmp/zfsmnt.rcbjOa': Device or resource busy
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.3.0-23-generic (--configure):
installed linux-image-5.3.0-23-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-5.3.0-23-generic
我使用安裝程式預設的 ubuntu19.10 zfs 配置。
答案1
年紀大了,但毫無生氣,所以…
我剛剛遇到這個問題。原來是sophos AV掃描器自動掃描/tmp下的新掛載點。這導致檔案系統鎖定。因此,在運行更新時禁用 sophos 可以解決該問題。
添加以下鉤子還應該解決未來的問題
root@:/etc/grub.d# ls -tlr *sophos*
-rwxr-xr-x 1 root root 45 Feb 9 13:16 01_sophos
-rwxr-xr-x 1 root root 46 Feb 9 13:16 999_sophos
root@:/etc/grub.d# cat *sophos*
#!/bin/sh
systemctl stop sophos-spl.service
#!/bin/sh
systemctl start sophos-spl.service
root@abl-nonprod-agent-02:/etc/grub.d#