Packages update failed: failed to copy kernel

rty

Member
Feb 3, 2023
12
3
8
Tried to apt upgrade my primary PVE node but failed. Was installed with blood, sweat and tears from PVE ISO 7.3 in February.

Configuration fails because /etc/initramfs/post-update.d//proxmox-boot-sync is unable to copy the kernel (src and dst "are the same file" / "ln: failed to create hard link"). Now I feel a bit uneasy, fearing that the next reboot might fail.

My setup might be a bit weird. My PVE is installed on a HP MicroServer G8 on a M.2 SDD installed to PCIx extension card. Since the server cannot boot from this disk, my /boot is a USB thumb drive. Took me a weekend to get this setup booting straight, thus I hesitate to reinstall PVE.

Any advice?

Facts:
Code:
root@pve-1:~# dpkg --configure -a
Setting up initramfs-tools (0.140) ...
update-initramfs: deferring update (trigger activated)
Setting up pve-kernel-5.15.102-1-pve (5.15.102-1) ...
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.15.102-1-pve /boot/vmlinuz-5.15.102-1-pve
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.15.102-1-pve /boot/vmlinuz-5.15.102-1-pve
update-initramfs: Generating /boot/initrd.img-5.15.102-1-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/cmdline found - falling back to /proc/cmdline
Copying and configuring kernels on /dev/disk/by-uuid/D39E-88C2
Copying kernel 5.15.102-1-pve
cp: '/boot/vmlinuz-5.15.102-1-pve' and '/var/tmp/espmounts/D39E-88C2/vmlinuz-5.15.102-1-pve' are the same file
run-parts: /etc/initramfs/post-update.d//proxmox-boot-sync exited with return code 1
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/pve-kernel-5.15.102-1-pve.postinst line 19.
dpkg: error processing package pve-kernel-5.15.102-1-pve (--configure):
installed pve-kernel-5.15.102-1-pve package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of pve-kernel-5.15:
pve-kernel-5.15 depends on pve-kernel-5.15.102-1-pve; however:
Package pve-kernel-5.15.102-1-pve is not configured yet.

dpkg: error processing package pve-kernel-5.15 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of proxmox-ve:
proxmox-ve depends on pve-kernel-5.15; however:
Package pve-kernel-5.15 is not configured yet.

dpkg: error processing package proxmox-ve (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.140) ...
ln: failed to create hard link '/boot/initrd.img-5.15.102-1-pve.dpkg-bak' => '/boot/initrd.img-5.15.102-1-pve': Operation not permitted
update-initramfs: Generating /boot/initrd.img-5.15.102-1-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/cmdline found - falling back to /proc/cmdline
Copying and configuring kernels on /dev/disk/by-uuid/D39E-88C2
Copying kernel 5.15.102-1-pve
cp: '/boot/vmlinuz-5.15.102-1-pve' and '/var/tmp/espmounts/D39E-88C2/vmlinuz-5.15.102-1-pve' are the same file
run-parts: /etc/initramfs/post-update.d//proxmox-boot-sync exited with return code 1
dpkg: error processing package initramfs-tools (--configure):
installed initramfs-tools package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
pve-kernel-5.15.102-1-pve
pve-kernel-5.15
proxmox-ve
initramfs-tools
Code:
root@pve-1:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
udev                  7.8G     0  7.8G   0% /dev
tmpfs                 1.6G  1.1M  1.6G   1% /run
/dev/mapper/pve-root   32G   26G  4.3G  86% /
tmpfs                 7.8G   60M  7.8G   1% /dev/shm
tmpfs                 5.0M     0  5.0M   0% /run/lock
/dev/sdf3             1.5G  216M  1.3G  15% /boot
/dev/fuse             128M   28K  128M   1% /etc/pve
tmpfs                 1.6G  4.0K  1.6G   1% /run/user/0
Code:
root@pve-1:~# fdisk -l /dev/sdf
Disk /dev/sdf: 3.72 GiB, 3997171712 bytes, 7806976 sectors
Disk model: FIash Disk      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 171CF352-E642-4D3D-B45C-D25CA30AA07E

Device       Start     End Sectors  Size Type
/dev/sdf1     2048   67583   65536   32M BIOS boot
/dev/sdf2    67584 1116159 1048576  512M EFI System
/dev/sdf3  1116160 4188159 3072000  1.5G EFI System
Code:
root@pve-1:~# pveversion -v
proxmox-ve: 7.3-1 (running kernel: 5.15.74-1-pve)
pve-manager: 7.4-3 (running version: 7.4-3/9002ab8a)
pve-kernel-helper: 7.2-14
pve-kernel-5.15.74-1-pve: 5.15.74-1
ceph-fuse: 15.2.17-pve1
corosync: 3.1.7-pve1
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.24-pve2
libproxmox-acme-perl: 1.4.4
libproxmox-backup-qemu0: 1.3.1-1
libproxmox-rs-perl: 0.2.1
libpve-access-control: 7.4-2
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.3-4
libpve-guest-common-perl: 4.2-4
libpve-http-server-perl: 4.2-1
libpve-rs-perl: 0.7.5
libpve-storage-perl: 7.4-2
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 5.0.2-2
lxcfs: 5.0.3-pve1
novnc-pve: 1.4.0-1
proxmox-backup-client: 2.4.1-1
proxmox-backup-file-restore: 2.4.1-1
proxmox-mail-forward: 0.1.1-1
proxmox-mini-journalreader: 1.3-1
proxmox-widget-toolkit: 3.6.5
pve-cluster: 7.3-3
pve-container: 4.4-3
pve-docs: 7.4-2
pve-edk2-firmware: 3.20230228-1
pve-firewall: 4.3-1
pve-firmware: 3.6-4
pve-ha-manager: 3.6.0
pve-i18n: 2.12-1
pve-qemu-kvm: 7.2.0-8
pve-xtermjs: 4.16.0-1
qemu-server: 7.4-3
smartmontools: 7.2-pve3
spiceterm: 3.2-2
swtpm: 0.8.0~bpo11+3
vncterm: 1.7-1
zfsutils-linux: 2.1.9-pve1
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/000_proxmox_boot_header ###
#
# This system is booted via proxmox-boot-tool! The grub-config used when
# booting from the disks configured with proxmox-boot-tool resides on the vfat
# partitions with UUIDs listed in /etc/kernel/proxmox-boot-uuids.
# /boot/grub/grub.cfg is NOT read when booting from those disk!
### END /etc/grub.d/000_proxmox_boot_header ###

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/4cOWPJ-pXNq-ZlSr-oUuY-t6e4-zSjs-EMV26y/8Lj2Yq-50Xp-apks-QReI-3I8S-dqZc-jsOm45'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='lvmid/4cOWPJ-pXNq-ZlSr-oUuY-t6e4-zSjs-EMV26y/8Lj2Yq-50Xp-apks-QReI-3I8S-dqZc-jsOm45'
 d397a3fd-796b-46f5-a96e-34f57b632903
else
  search --no-floppy --fs-uuid --set=root d397a3fd-796b-46f5-a96e-34f57b632903
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=30
else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=menu
    set timeout=5
  # Fallback normal timeout code in case the timeout_style feature is
  # unavailable.
  else
    set timeout=5
  fi
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
        set gfxpayload="${1}"
}
set linux_gfx_mode=
export linux_gfx_mode
menuentry 'Proxmox VE GNU/Linux' --class proxmox --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-d397a3f
d-796b-46f5-a96e-34f57b632903' {
        load_video
        insmod gzio
        if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
        insmod part_gpt
        insmod fat
        set root='hd3,gpt3'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt3 --hint-efi=hd3,gpt3 --hint-baremetal=ahci3,gpt3  D39E-88C2
        else
          search --no-floppy --fs-uuid --set=root D39E-88C2
        fi
        echo    'Loading Linux 5.15.74-1-pve ...'
        linux   /vmlinuz-5.15.74-1-pve root=/dev/mapper/pve-root ro  quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initrd.img-5.15.74-1-pve
}
submenu 'Advanced options for Proxmox VE GNU/Linux' $menuentry_id_option 'gnulinux-advanced-d397a3fd-796b-46f5-a96e-34f57b632903' {
        menuentry 'Proxmox VE GNU/Linux, with Linux 5.15.74-1-pve' --class proxmox --class gnu-linux --class gnu --class os $menuentry_
id_option 'gnulinux-5.15.74-1-pve-advanced-d397a3fd-796b-46f5-a96e-34f57b632903' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod fat
                set root='hd3,gpt3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt3 --hint-efi=hd3,gpt3 --hint-baremetal=ahci3,gpt3  D39E-88
C2
                else
                  search --no-floppy --fs-uuid --set=root D39E-88C2
                fi
                echo    'Loading Linux 5.15.74-1-pve ...'
                linux   /vmlinuz-5.15.74-1-pve root=/dev/mapper/pve-root ro  quiet
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-5.15.74-1-pve
        }
        menuentry 'Proxmox VE GNU/Linux, with Linux 5.15.74-1-pve (recovery mode)' --class proxmox --class gnu-linux --class gnu --clas
s os $menuentry_id_option 'gnulinux-5.15.74-1-pve-recovery-d397a3fd-796b-46f5-a96e-34f57b632903' {
                load_video
                insmod gzio
                if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
                insmod part_gpt
                insmod fat
                set root='hd3,gpt3'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd3,gpt3 --hint-efi=hd3,gpt3 --hint-baremetal=ahci3,gpt3  D39E-88
C2
                else
                  search --no-floppy --fs-uuid --set=root D39E-88C2
                fi
                echo    'Loading Linux 5.15.74-1-pve ...'
                linux   /vmlinuz-5.15.74-1-pve root=/dev/mapper/pve-root ro single  
                echo    'Loading initial ramdisk ...'
                initrd  /initrd.img-5.15.74-1-pve
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg
fi
### END /etc/grub.d/41_custom ###
 
Solved the problem by placing Proxmox on /dev/sda which is not the PCIx M2 disk but a "normal" SSD.