0

After upgrading Ubuntu trusty (i386) to xenial (but BEFORE reboot), the update-initramfs operation hangs because of LVM :

$ sudo apt install 
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 
$ sudo dpkg --configure -a
Setting up linux-image-4.4.0-171-generic (4.4.0-171.200) ...
I: /initrd.img is now a symlink to boot/initrd.img-4.4.0-171-generic
Processing triggers for linux-image-4.4.0-171-generic (4.4.0-171.200) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-171-generic
^Cdpkg: error processing package linux-image-4.4.0-171-generic (--configure):
 subprocess installed post-installation script was interrupted
Errors were encountered while processing:
 linux-image-4.4.0-171-generic
$ echo $?
1
$ pgrep -a update-initramfs 
13380 /bin/sh /usr/sbin/update-initramfs -c -t -k 4.4.0-171-generic -b /boot
$ sudo bash -x update-initramfs -c -t -k 4.4.0-171-generic -b /boot
...
+ generate_initramfs
+ echo 'update-initramfs: Generating /boot/initrd.img-4.4.0-171-generic'
+ OPTS=-o
+ '[' 0 = 1 ']'
+ mkinitramfs -o /boot/initrd.img-4.4.0-171-generic.new 4.4.0-171-generic
^C+ mkinitramfs_return=1
+ remove_initramfs_bak
+ '[' -z '' ']'
+ return 0
+ rm -f /boot/initrd.img-4.4.0-171-generic.new
+ echo 'update-initramfs: failed for /boot/initrd.img-4.4.0-171-generic with 1.'
$ sudo bash -x mkinitramfs -o /boot/initrd.img-4.4.0-171-generic.new 4.4.0-171-generic
...
+ for cs_x in '${runlist}'
+ '[' -f /usr/share/initramfs-tools/hooks/cryptroot ']'
+ '[' xy = xoptional ']'
+ '[' n = y ']'
+ /usr/share/initramfs-tools/hooks/cryptroot
^C++ exit 1
+ clean_on_exit
+ '[' n = y ']'
+ for path in '"${DESTDIR}"' '"${__TMPCPIOGZ}"' '"${__TMPEARLYCPIO}"'
+ test -z /var/tmp/mkinitramfs_DWymeG
+ rm -rf /var/tmp/mkinitramfs_DWymeG
+ for path in '"${DESTDIR}"' '"${__TMPCPIOGZ}"' '"${__TMPEARLYCPIO}"'
+ test -z /var/tmp/mkinitramfs-OL_5uPdHK
+ rm -rf /var/tmp/mkinitramfs-OL_5uPdHK
+ for path in '"${DESTDIR}"' '"${__TMPCPIOGZ}"' '"${__TMPEARLYCPIO}"'
+ test -z /var/tmp/mkinitramfs-FW_RNU3Qv
+ rm -rf /var/tmp/mkinitramfs-FW_RNU3Qv
$ sudo bash -x /usr/share/initramfs-tools/hooks/cryptroot
...
+++ get_lvm_deps VG_ALL-root_LV
+++ local node deps maj min depnode
+++ node=VG_ALL-root_LV
+++ '[' -z VG_ALL-root_LV ']'
+++++ cut -d: -f1
+++++ dmsetup --noheadings splitname VG_ALL-root_LV
++++ vgs --noheadings -o pv_name VG_ALL
^C
$ sudo vgs -v -d --noheadings -o pv_name VG_ALL
^C

EDIT 0: vgck hangs on my volume group :

$ sudo vgck VG_ALL
^C

EDIT 1: Changed the lvm log level to 6 in /etc/lvm/lvm.conf and relauched a vgck :

$ tail -f /var/log/lvm2.log
commands/toolcontext.c:361   Logging initialised at Mon Jan 27 01:10:00 2020
commands/toolcontext.c:548   Set umask from 0022 to 0077
config/config.c:1439   Setting log/debug_classes to debug_classes = [ "memory", "devices", "activation", "allocation", "lvmetad", "metadata", "cache", "locking", "lvmpolld" ]
commands/toolcontext.c:361   Logging initialised at Mon Jan 27 01:10:32 2020
libdm-config.c:1010   Setting config/checks to 1
libdm-config.c:1010   Setting config/abort_on_errors to 0
libdm-config.c:1010   Setting config/checks to 1
libdm-config.c:946   Setting global/umask to 63
commands/toolcontext.c:548   Set umask from 0022 to 0077
libdm-config.c:915   Setting devices/dir to /dev
libdm-config.c:915   Setting devices/external_device_info_source to none
libdm-config.c:915   Setting global/proc to /proc
libdm-config.c:1010   Setting global/activation to 1
libdm-config.c:1023   activation/auto_set_activation_skip not found in config: defaulting to 1
libdm-config.c:915   Setting activation/readahead to auto
libdm-config.c:1010   Setting activation/udev_rules to 1
libdm-config.c:1010   Setting activation/udev_sync to 1
libdm-config.c:1010   Setting activation/retry_deactivation to 1
libdm-config.c:1010   Setting activation/checks to 0
libdm-config.c:1010   Setting activation/use_linear_target to 1
libdm-config.c:915   Setting activation/missing_stripe_filler to error
libdm-config.c:1010   Setting global/metadata_read_only to 0
libdm-config.c:946   Setting devices/pv_min_size to 2048
libdm-config.c:915   Setting global/units to h
libdm-config.c:1010   Setting global/si_unit_consistency to 1
libdm-config.c:1023   report/binary_values_as_numeric not found in config: defaulting to 0
libdm-config.c:1010   Setting global/suffix to 1
libdm-config.c:924   report/list_item_separator not found in config: defaulting to ,
libdm-config.c:924   report/time_format not found in config: defaulting to %Y-%m-%d %T %z
libdm-config.c:1010   Setting global/detect_internal_vg_cache_corruption to 0
libdm-config.c:915   Setting global/system_id_source to none
libdm-config.c:915   Setting config/profile_dir to /etc/lvm/profile
libdm-config.c:946   Setting devices/disable_after_error_count to 0
device/dev-cache.c:701   devices/preferred_names not found in config: using built-in preferences
libdm-config.c:1010   Setting devices/obtain_device_list_from_udev to 1
config/config.c:1439   Setting devices/scan to scan = [ "/dev" ]
libdm-config.c:946   Setting activation/reserved_stack to 64
libdm-config.c:946   Setting activation/reserved_memory to 8192
libdm-config.c:946   Setting activation/process_priority to -18
format1/format1.c:636   Initialised format: lvm1
format_pool/format_pool.c:338   Initialised format: pool
format_text/format-text.c:2538   Initialised format: lvm2
libdm-config.c:924   global/format not found in config: defaulting to lvm2
striped/striped.c:236   Initialised segtype: striped
zero/zero.c:95   Initialised segtype: zero
error/errseg.c:101   Initialised segtype: error
libdm-config.c:915   Setting dmeventd/snapshot_library to libdevmapper-event-lvm2snapshot.so
snapshot/snapshot.c:271   Initialised segtype: snapshot
libdm-config.c:915   Setting dmeventd/mirror_library to libdevmapper-event-lvm2mirror.so
mirror/mirrored.c:633   Initialised segtype: mirror
libdm-config.c:924   dmeventd/raid_library not found in config: defaulting to libdevmapper-event-lvm2raid.so
raid/raid.c:450   Initialised segtype: raid1
raid/raid.c:450   Initialised segtype: raid10
raid/raid.c:450   Initialised segtype: raid4
raid/raid.c:450   Initialised segtype: raid5
raid/raid.c:450   Initialised segtype: raid5_la
raid/raid.c:450   Initialised segtype: raid5_ls
raid/raid.c:450   Initialised segtype: raid5_ra
raid/raid.c:450   Initialised segtype: raid5_rs
raid/raid.c:450   Initialised segtype: raid6
raid/raid.c:450   Initialised segtype: raid6_nc
raid/raid.c:450   Initialised segtype: raid6_nr
raid/raid.c:450   Initialised segtype: raid6_zr
libdm-config.c:915   Setting dmeventd/thin_library to libdevmapper-event-lvm2thin.so
thin/thin.c:816   Initialised segtype: thin-pool
thin/thin.c:816   Initialised segtype: thin
cache_segtype/cache.c:429   Initialised segtype: cache-pool
cache_segtype/cache.c:443   Initialised segtype: cache
libdm-config.c:1010   Setting backup/archive to 1
libdm-config.c:946   Setting backup/retain_days to 30
libdm-config.c:946   Setting backup/retain_min to 10
libdm-config.c:915   Setting backup/archive_dir to /etc/lvm/archive
libdm-config.c:1010   Setting backup/backup to 1
libdm-config.c:915   Setting backup/backup_dir to /etc/lvm/backup
libdm-config.c:1023   global/fallback_to_lvm1 not found in config: defaulting to 0
config/config.c:1436   devices/global_filter not found in config: defaulting to global_filter = [ "a|.*/|" ]
libdm-config.c:946   Setting global/locking_type to 1
libdm-config.c:1010   Setting global/use_lvmetad to 1
libdm-config.c:1010   Setting global/use_lvmpolld to 1
libdm-config.c:1010   Setting devices/sysfs_scan to 1
libdm-config.c:1010   Setting devices/multipath_component_detection to 1
libdm-config.c:1010   Setting devices/md_component_detection to 1
libdm-config.c:1010   Setting devices/fw_raid_component_detection to 0
libdm-config.c:1010   Setting devices/ignore_suspended_devices to 0
libdm-config.c:1010   Setting devices/ignore_lvm_mirrors to 1
config/config.c:1436   devices/filter not found in config: defaulting to filter = [ "a|.*/|" ]
libdm-config.c:915   Setting devices/cache_dir to /run/lvm
libdm-config.c:915   Setting devices/cache_file_prefix to 
libdm-config.c:924   devices/cache not found in config: defaulting to /run/lvm/.cache
libdm-config.c:1010   Setting devices/write_cache_state to 1
libdm-config.c:1010   Setting global/use_lvmetad to 1
libdm-config.c:915   Setting activation/activation_mode to degraded

How can I fix this pb. ?

9
  • How do you know it was stuck? You seem to have interupted the commands by Ctrl-C
    – jarno
    Jan 27, 2020 at 1:20
  • @jarno Because I waited a LONG time before hitting CTRL+C
    – SebMa
    Jan 27, 2020 at 1:23
  • Do you have any kernels completely installed? uname -r ; inux-version list
    – jarno
    Jan 27, 2020 at 1:36
  • 1
  • 1
    @jarno Here, I guess you meant linux-version list
    – SebMa
    May 27, 2020 at 16:56

1 Answer 1

0

I can see I have all that I need :

$ ls -1 /boot/*4.4.0-171*
/boot/System.map-4.4.0-171-generic
/boot/config-4.4.0-171-generic
/boot/initrd.img-4.4.0-171-generic
/boot/vmlinuz-4.4.0-171-generic

and I have the necessary grub entry for kernel 4.4.0-171 :

$ grep -B15 4.4.0-171 /boot/grub/grub.cfg | egrep "menuentry|4.4.0-171"
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-14ffbbb5-6bef-4565-9984-f53e20d19d0e' {
linux /vmlinuz-4.4.0-171-generic root=/dev/mapper/VG_ALL-root_LV ro splash $vt_handoff
initrd /initrd.img-4.4.0-171-generic
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-14ffbbb5-6bef-4565-9984-f53e20d19d0e' {
menuentry 'Ubuntu, with Linux 4.4.0-171-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-171-generic-advanced-14ffbbb5-6bef-4565-9984-f53e20d19d0e' {
echo 'Loading Linux 4.4.0-171-generic ...'
linux /vmlinuz-4.4.0-171-generic root=/dev/mapper/VG_ALL-root_LV ro splash $vt_handoff
initrd /initrd.img-4.4.0-171-generic
menuentry 'Ubuntu, with Linux 4.4.0-171-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-171-generic-init-upstart-14ffbbb5-6bef-4565-9984-f53e20d19d0e' {
echo 'Loading Linux 4.4.0-171-generic ...'
linux /vmlinuz-4.4.0-171-generic root=/dev/mapper/VG_ALL-root_LV ro splash $vt_handoff init=/sbin/upstart
initrd /initrd.img-4.4.0-171-generic
menuentry 'Ubuntu, with Linux 4.4.0-171-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-171-generic-recovery-14ffbbb5-6bef-4565-9984-f53e20d19d0e' {
echo 'Loading Linux 4.4.0-171-generic ...'
linux /vmlinuz-4.4.0-171-generic root=/dev/mapper/VG_ALL-root_LV ro recovery nomodeset
initrd /initrd.img-4.4.0-171-generic

So I tried and reboot :

$ sudo reboot
Failed to start reboot.target: Connection timed out

So I typed this according to https://unix.stackexchange.com/a/534227/135038 :

$ sudo systemctl --force --force reboot

And it finally worked things out for the vgs and update-initramfs commands :

$ time sudo vgs --noheadings -o pv_name VG_ALL
  /dev/sda1 

real    0m0.116s
user    0m0.056s
sys 0m0.048s
$ time sudo dpkg --configure -a
Setting up linux-image-4.4.0-171-generic (4.4.0-171.200) ...
Processing triggers for linux-image-4.4.0-171-generic (4.4.0-171.200) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-4.4.0-171-generic
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found background image: today.jpg
Found linux image: /boot/vmlinuz-4.4.0-171-generic
Found initrd image: /boot/initrd.img-4.4.0-171-generic
Found linux image: /boot/vmlinuz-4.4.0-148-generic
Found initrd image: /boot/initrd.img-4.4.0-148-generic
Found linux image: /boot/vmlinuz-4.4.0-146-generic
Found linux image: /boot/vmlinuz-4.4.0-143-generic
Found linux image: /boot/vmlinuz-4.4.0-142-generic
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
done

real    1m54.827s
user    0m43.056s
sys 0m21.300s

Now, I'm going to cleanup the remaining kernels that I don't need with linux-purge :

$ sudo screen -L linux-purge -k 2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .