grub-pc hangs while package is configured

Bug #426239 reported by inode77
166
This bug affects 33 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Expired
High
Unassigned

Bug Description

Binary package hint: grub-pc

1)
# lsb_release -rd
Description: Ubuntu karmic (development branch)
Release: 9.10

2)
# apt-cache policy grub-pc
grub-pc:
  Installed: 1.97~beta2-2ubuntu1
  Candidate: 1.97~beta2-2ubuntu1
  Version table:
 *** 1.97~beta2-2ubuntu1 0
        500 http://ch.archive.ubuntu.com karmic/main Packages
        100 /var/lib/dpkg/status

3)
I expected the update to run without any problems.

4)
Updates downloads and hangs upon configuring grub-pc

# dpkg --configure -a
Processing triggers for menu ...
Processing triggers for python-support ...
WARNING: WARNING: /usr/share/pyshared/lsb_release.py is linked but does not belong to any package.
Setting up grub-pc (1.97~beta2-2ubuntu1) ...
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(hd0) /dev/sda
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-9-generic
Found initrd image: /boot/initrd.img-2.6.31-9-generic
Found linux image: /boot/vmlinuz-2.6.31-8-generic
Found initrd image: /boot/initrd.img-2.6.31-8-generic
Found memtest86+ image: /boot/memtest86+.bin
^C (abort by me using CTRL+C)
dpkg: error processing grub-pc (--configure):
 subprocess installed post-installation script killed by signal (Interrupt)
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Setting up libmagickcore2 (7:6.5.1.0-1.1ubuntu3) ...

Setting up libmagickwand2 (7:6.5.1.0-1.1ubuntu3) ...

Setting up rss-glx (0.9.0-2ubuntu3) ...
Setting up obex-data-server (0.4.4-2build1) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 grub-pc

FS is either NTFS or ext4 (swap) so nothing special

# fdisk -l
Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xXxxxxxxxx

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 5100 40856576 7 HPFS/NTFS
Partition 2 does not end on cylinder boundary.
/dev/sda3 5100 7775 21485520 83 Linux
Partition 3 does not end on cylinder boundary.
/dev/sda4 7775 15567 62589240 5 Extended
Partition 4 does not end on cylinder boundary.
/dev/sda5 7775 14218 51755728+ 83 Linux
/dev/sda6 14218 15434 9767488+ 83 Linux
/dev/sda7 15434 15567 1065928+ 82 Linux swap / Solaris

Revision history for this message
inode77 (simon-gerber) wrote :

Reboot renders grub unusable thus system not bootable anymore.

Using ubuntu 9.10a4 resuce mode from alternate cd I manually removed /etc/grub.d/30_os-prober and reconfigured grub-pc without problems.

System is up again.

Revision history for this message
Alex Wauck (awauck) wrote :

This happens for me with grub-pc 1.97~beta2-2ubuntu2. I have two hard disks (one Ubuntu, one Windows 7) and a SATA optical drive. The process that actually hangs appears to be grub-mkdevicemap.

Revision history for this message
Alex Wauck (awauck) wrote :

I ran strace on grub-mkdevicemap. I have attached the results. grub-mkdevicemap itself enters a state where it cannot be killed. strace was killable, but only with kill -9. It looks like it didn't like opening /dev/sdc, which is a SD/MMC reader.

Revision history for this message
Wizzleby (wizzleby) wrote :

I have encountered this bug. While upgrading from aptitude, it seemed
like the process must be killed with ^C, but I find if I run update-grub,
then at the point of it stopping (after memtest), hitting return a few
times brings up an interesting error that I think I saw something similar to
in /etc/grub.d/30_os-prober:
Found on Password
    is not yet supported by grub-mkconfig.
done

However, I still have this program as unconfigured in dpkg.

Revision history for this message
Christian Mangold (neversfelde) wrote :

Same problem here.

grub-pc:
  Installiert: 1.97~beta2-2ubuntu2
  Kandidat: 1.97~beta2-2ubuntu2
  Versions-Tabelle:

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Alex Wauck (awauck) wrote :

When this problem occurs, check dmesg for a kernel oops. I have been having oopses in usb_storage, and I think it may be related. That would also explain why configuring grub-pc sometimes works for me and sometimes doesn't. I also have a sneaking suspicion that the oops is related to my USB memory card reader.

Revision history for this message
Jörn Dreyer (j.dreyer) wrote :

same problem and yep, got a kernel oops ... usb sdcard reader present
[ 7321.141260] INFO: task grub-mkdevicema:25249 blocked for more than 120 seconds.
[ 7321.141260] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 7321.141260] grub-mkdevice D 0000000000000000 0 25249 25246 0x00000000
[ 7321.141260] ffff880042de9c28 0000000000000086 0000000000000000 0000000000015580
[ 7321.141260] ffff8800ab01b110 0000000000015580 0000000000015580 0000000000015580
[ 7321.141260] 0000000000015580 ffff8800ab01b110 0000000000015580 0000000000015580
[ 7321.141260] Call Trace:
[ 7321.141260] [<ffffffff81522447>] __mutex_lock_slowpath+0xd7/0x160
[ 7321.141260] [<ffffffff81147bd0>] ? blkdev_open+0x0/0xc0
[ 7321.141260] [<ffffffff81522346>] mutex_lock+0x26/0x50
[ 7321.141260] [<ffffffff81147858>] __blkdev_get+0x38/0x3a0
[ 7321.141260] [<ffffffff81147bd0>] ? blkdev_open+0x0/0xc0
[ 7321.141260] [<ffffffff81147bcb>] blkdev_get+0xb/0x10
[ 7321.141260] [<ffffffff81147c3c>] blkdev_open+0x6c/0xc0
[ 7321.141260] [<ffffffff81117ed6>] __dentry_open+0xe6/0x2e0
[ 7321.141260] [<ffffffff811181d7>] nameidata_to_filp+0x57/0x70
[ 7321.141260] [<ffffffff811275fa>] do_filp_open+0x2ca/0xac0
[ 7321.141260] [<ffffffff810ef679>] ? __do_fault+0x419/0x4e0
[ 7321.141260] [<ffffffff81032419>] ? default_spin_lock_flags+0x9/0x10
[ 7321.141260] [<ffffffff81277912>] ? __strncpy_from_user+0x22/0x60
[ 7321.141260] [<ffffffff81132072>] ? alloc_fd+0x102/0x150
[ 7321.141260] [<ffffffff81117ca4>] do_sys_open+0x64/0x160
[ 7321.141260] [<ffffffff81117dcb>] sys_open+0x1b/0x20
[ 7321.141260] [<ffffffff81011fc2>] system_call_fastpath+0x16/0x1b

Revision history for this message
Pequetrefe (lecochon3) wrote :

Hi. I had a similar if not the same problem. I stopped the grup-pc install and rebooted. Then I got a message telling me to run manually: " sudo dpkg --configure -a ". Then I rebooted again and I got my problem solved. I'm not an expert at this kind of things. I hope it can help you guys.

Revision history for this message
Jonathan Ernst (jonathan.ernst) wrote :

Another workaround is to unmount all USB mass storage drives, and then to rmmod usb_storage. Configuring grub-pc then works here.

Revision history for this message
PeterLi65 (peter-littmann) wrote :
Download full text (3.5 KiB)

Seems to be similar by installing grub-pc 1.97~beta4-1ubuntu5 (usb harddisk mounted):

50mounted-tests: debug: /usr/lib/linux-boot-probes/mounted/40grub2 succeeded
Apr 1 00:35:05 mediondt linux-boot-prober: debug: linux detected by /usr/lib/linux-boot-probes/50mounted-tests
Apr 1 01:03:06 mediondt kernel: [ 7440.493096] devkit-disks- D c08185c0 0 13791 1876 0x00000000
Apr 1 01:03:06 mediondt kernel: [ 7440.493103] f32a1c44 00000086 f4960000 c08185c0 f25a4df8 c08185c0 076901d2 000006a0
Apr 1 01:03:06 mediondt kernel: [ 7440.493112] c08185c0 c08185c0 f25a4df8 c08185c0 00000000 000006a0 c08185c0 f259a800
Apr 1 01:03:06 mediondt kernel: [ 7440.493120] f25a4b60 f32a1cf4 7fffffff f32a1cf8 f32a1ca0 c05724d5 f32a1c58 00000092
Apr 1 01:03:06 mediondt kernel: [ 7440.493129] Call Trace:
Apr 1 01:03:06 mediondt kernel: [ 7440.493142] [<c05724d5>] schedule_timeout+0x185/0x200
Apr 1 01:03:06 mediondt kernel: [ 7440.493149] [<c030762f>] ? __blk_run_queue+0x6f/0x120
Apr 1 01:03:06 mediondt kernel: [ 7440.493153] [<c02fced6>] ? elv_insert+0x116/0x1f0
Apr 1 01:03:06 mediondt kernel: [ 7440.493157] [<c05721f2>] wait_for_common+0xa2/0x120
Apr 1 01:03:06 mediondt kernel: [ 7440.493163] [<c013c4c0>] ? default_wake_function+0x0/0x10
Apr 1 01:03:06 mediondt kernel: [ 7440.493167] [<c0572302>] wait_for_completion+0x12/0x20
Apr 1 01:03:06 mediondt kernel: [ 7440.493172] [<c030a4c5>] blk_execute_rq+0x75/0xd0
Apr 1 01:03:06 mediondt kernel: [ 7440.493175] [<c030a380>] ? blk_end_sync_rq+0x0/0x30
Apr 1 01:03:06 mediondt kernel: [ 7440.493180] [<c0309fbf>] ? blk_rq_append_bio+0x1f/0x60
Apr 1 01:03:06 mediondt kernel: [ 7440.493183] [<c030a1ad>] ? __blk_rq_map_user+0x8d/0x110
Apr 1 01:03:06 mediondt kernel: [ 7440.493187] [<c030a2f3>] ? blk_rq_map_user+0xc3/0x150
Apr 1 01:03:06 mediondt kernel: [ 7440.493193] [<c014ea00>] ? capable+0x10/0x40
Apr 1 01:03:06 mediondt kernel: [ 7440.493198] [<c030d996>] sg_io+0x226/0x360
Apr 1 01:03:06 mediondt kernel: [ 7440.493203] [<c030e212>] scsi_cmd_ioctl+0x412/0x480
Apr 1 01:03:06 mediondt kernel: [ 7440.493210] [<c03c5d5d>] sd_ioctl+0x8d/0xe0
Apr 1 01:03:06 mediondt kernel: [ 7440.493215] [<c01b48a8>] ? filemap_fault+0xa8/0x340
Apr 1 01:03:06 mediondt kernel: [ 7440.493219] [<c030b54a>] __blkdev_driver_ioctl+0x6a/0x80
Apr 1 01:03:06 mediondt kernel: [ 7440.493223] [<c030ba81>] blkdev_ioctl+0x91/0x610
Apr 1 01:03:06 mediondt kernel: [ 7440.493229] [<c020e92f>] block_ioctl+0x2f/0x50
Apr 1 01:03:06 mediondt kernel: [ 7440.493233] [<c020e900>] ? block_ioctl+0x0/0x50
Apr 1 01:03:06 mediondt kernel: [ 7440.493238] [<c01f55cc>] vfs_ioctl+0x1c/0x90
Apr 1 01:03:06 mediondt kernel: [ 7440.493242] [<c01f58f1>] do_vfs_ioctl+0x71/0x310
Apr 1 01:03:06 mediondt kernel: [ 7440.493247] [<c057614b>] ? do_page_fault+0x19b/0x380
Apr 1 01:03:06 mediondt kernel: [ 7440.493251] [<c01f5bef>] sys_ioctl+0x5f/0x80
Apr 1 01:03:06 mediondt kernel: [ 7440.493255] [<c01033ac>] syscall_call+0x7/0xb
Apr 1 01:05:06 mediondt kernel: [ 7560.493091] devkit-disks- D c08185c0 0 13791 1876 0x00000000
Apr 1 01:05:06 mediondt kernel: [ 7560.493098] f32a1c44 00000086 f4960000 c08185c0 f25a4df8 c08185c0 07...

Read more...

Revision history for this message
PeterLi65 (peter-littmann) wrote :

After rebooting and detaching my usb harddrive I was able to complete dpkg --configure -a

Revision history for this message
eyemeansit (eyemeansit) wrote :

I also had this problem, on Kubuntu 10.04, but when I unplugged my HP printer usb cable (printer has an SD card slot for pix), I was then able to run "sudo dpkg –configure -a" and it completed without a hiccup! I personally wonder if that is also why installation from the live cd (both kubuntu and Mint 9 KDE) came to a dead stop when it was trying to install grub. It always stopped at "looking for other operating systems..."

Thanks guys! this was driving me bonkers!

Revision history for this message
Dan McGuirk (incandenza) wrote :

This happens to me, reproducibly (as long as usb_storage is loaded), when upgrading from 10.04 to 10.10. It results in an unusable system that I wasn't even able to fix via chrooting.

As mentioned earlier, making sure the usb_storage module is not loaded works as a workaround.

Revision history for this message
MarcRandolph (mrand) wrote :

2.5 years later, and this bug appears to be unfixed.

I'm doing 10.04 LTS upgrade testing to 12.04. I installed 10.04 and then tell it to install updates (before upgrading to 12.04). During the update, I end up stuck at "Configuring grub-pc" window in update-manager. It will not let me continue unless I select "continue without installing GRUB?"

This is really bad for less technical users.

Changed in grub2 (Ubuntu):
importance: Undecided → High
Revision history for this message
Phillip Susi (psusi) wrote :

Marc, do you also get the hung task error in dmesg, and does unloading the usb_storage module before upgrading fix it?

Revision history for this message
Aaron C. de Bruyn (darkpixel2k) wrote :

I'm getting this about once a second in syslog:

udevd[17223]: timeout: killing '/sbin/blkid -o udev -p /dev/sdb' [18986]

Fdisk only shows /dev/sda.

/dev/sdb may have been my android phone that was plugged in hours ago.

Running rmmod usb_storage did not fix the issue.

Revision history for this message
Sergio Barjola (sbarjola) wrote :

I'm testing kernel mainline, 3.3.0-999-generic, in Ubuntu 12.04 and update-grub hangs and not end.
With the linux-image-3.2.0-19-generic, I have not this problem.

Revision history for this message
jmrasor (jmrasor) wrote :

This bug affected me as well, on a near-fresh install of Lubuntu 12.04 to a USB stick, inserted into a laptop.

The upgrade was about 80% done when it hung on setting up grub-pc. I waited a few minutes, killed the process, rebooted. Grub menu looked good; system rebooted properly.
Launched Update Manager: it reported partial upgrade, with software index broken. Tried the recommended sudo apt-get install -f: failed, dpkg was interrupted. Tried sudo dpkg --configure -a: "GRUB bootloader was previously installed to a disk that is no longer present, or whose unique identifier has changed for some reason."
Then dpkg offered to put GRUB on one of 3 devices: two disks (including the USB stick), and the USB stick's Linux partition. I chose the stick. Setting up grub-pc appeared to proceed normally, with no errors reported. dpkg continued on its merry way. I then relaunched Update Manager; it reported all up to date. Reboot the laptop: again, the GRUB menu looked good and the system rebooted properly. The Update Manager reported all up to date.

Revision history for this message
jmrasor (jmrasor) wrote :

The other OS's on the laptop (Windows 7, Linux Mint) also booted properly after this adventure.

Revision history for this message
RoestVrijStaal (roestvrijstaal) wrote :

Bump.

After installing Kubuntu 17.10.1 I'm also experiencing this bug.

I installed grub on /dev/sda

Unfortunately I HAVE to reconfigure grub-pc because dpkg demands that.

Reinstalling explicitly grub-pc seems to do the trick.

Phillip Susi (psusi)
Changed in grub2 (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for grub2 (Ubuntu) because there has been no activity for 60 days.]

Changed in grub2 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.