-
Notifications
You must be signed in to change notification settings - Fork 21
Update of raspberrypi-kernel fails dpkg-divert: error: unable to change ownership of target file '/boot/...
#244
Comments
Unable to reproduce the issue here. How do I get to the same state starting with a clean official image? The fact that your /boot files are owned by 'pi' indicated that it was mounted in a strange way. |
My assumption is that it has to do with how I moved from SD card to SSD (also for boot), but I don't know what should be wrong about the setup. $ ls -l /
total 84
drwxr-xr-x 2 root root 4096 Dec 20 16:57 bin
drwxr-xr-x 3 pi pi 4096 Jan 1 1970 boot
... Is there some other place that's relevant besides |
What's the output of |
$ mount
/dev/sda2 on / type ext4 (rw,noatime,stripe=8191)
devtmpfs on /dev type devtmpfs (rw,relatime,size=1776440k,nr_inodes=444110,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,size=776884k,nr_inodes=819200,mode=755)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
/var/lib/snapd/snaps/certbot_2616.snap on /snap/certbot/2616 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core18_2657.snap on /snap/core18/2657 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/certbot_2580.snap on /snap/certbot/2580 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core_14402.snap on /snap/core/14402 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core20_1739.snap on /snap/core20/1739 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core22_446.snap on /snap/core22/446 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core18_2670.snap on /snap/core18/2670 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/nvim_2785.snap on /snap/nvim/2785 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/dev/sda2 on /media/usb0 type ext4 (rw,nodev,noexec,noatime,nodiratime,stripe=8191)
/dev/sda1 on /media/usb1 type vfat (rw,nodev,noexec,noatime,nodiratime,sync,uid=1000,gid=1000,fmask=0111,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=388440k,nr_inodes=97110,mode=700,uid=1000,gid=1000)
nsfs on /run/docker/netns/default type nsfs (rw)
/var/lib/snapd/snaps/core22_472.snap on /snap/core22/472 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core20_1781.snap on /snap/core20/1781 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/nvim_2794.snap on /snap/nvim/2794 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core_14449.snap on /snap/core/14449 type squashfs (ro,nodev,relatime,errors=continue,x-gdu.hide)
/dev/sda1 on /boot type vfat (rw,relatime,sync,uid=1000,gid=1000,fmask=0111,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro) |
I believe the |
Is it "expected" for these to appear multiple times? |
I don't need the additional /media mounts and don't know where they're coming from, but I guess it shouldn't be a problem since there's no problem with sda2 being mounted twice. |
I found that the $ cat /etc/usbmount/usbmount.conf
# Configuration file for the usbmount package, which mounts removable
# storage devices when they are plugged in and unmounts them when they
# are removed.
# Change to zero to disable usbmount
ENABLED=1
# Mountpoints: These directories are eligible as mointpoints for
# removable storage devices. A newly plugged in device is mounted on
# the first directory in this list that exists and on which nothing is
# mounted yet.
MOUNTPOINTS="/media/usb0 /media/usb1 /media/usb2 /media/usb3
/media/usb4 /media/usb5 /media/usb6 /media/usb7"
...
FS_MOUNTOPTIONS="-fstype=vfat,gid=pi,uid=pi,dmask=0022,fmask=0111" I compared with my RPi3 where Seems like I'll wait for another update involving |
Great detective work |
@XECDesign Based on the description above, would this problem affect everyone booting from a USB device, e.g. a USB3 SSD? (although if it does, it seems like this problem should have cropped up before??) Aha, seems to be a known problem? rbrito/usbmount#35 |
If they also installed usbmount, no? I don't have it on my RPi3, but also don't remember installing it on my RPi4. I know nothing about the internals, but I found it very weird that usbmount's options also apply to the mount defined in |
Not out of the box, no. This will be resolved when we move to different packaging for the firmware that doesn't rely on the dpkg-divert mechanism. |
Updates of raspberrypi-kernel and raspberrypi-bootloader on my RPi4 fail every time and leave me with a broken
/boot
.I have no problems on my RPi3 (both running Raspbian 11). The only difference is that my RPi4 uses a 64bit kernel and boots from an SSD instead of an SD card.
Here's the log of an update:
Afterwards,
/boot
is broken:sudo umount /boot
before the update, there are no problems during the update and I can afterwardscopy -a
the new files from sda2 to sda1 and mount sda1 as /boot again.sudo umount /boot
before the update, Icp -a /usr/share/rpikernelhack/* /boot/
but then still need tosudo umount /boot
for the update to go through.Further info:
https://raspberrypi.stackexchange.com/questions/51410/what-is-rpikernelhack
The text was updated successfully, but these errors were encountered: