package grub-pc 1.98-1ubuntu4 failed to upgrade: grub-setup hangs on fs sync - device or resource busy

Bug #561374 reported by Oswald on 2010-04-12
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: grub2

While upgrading Ubuntu 10.04 Beta 1, the post installation script hangs. I had to kill it manually for the installation to proceed.

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: grub-pc 1.98-1ubuntu4
ProcVersionSignature: Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-19-generic i686
Architecture: i386
Date: Mon Apr 12 12:33:02 2010
ErrorMessage: subprocess installed post-installation script killed by signal (Terminated)
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta i386 (20100318)
SourcePackage: grub2
Title: package grub-pc 1.98-1ubuntu4 failed to install/upgrade: subprocess installed post-installation script killed by signal (Terminated)

Oswald (q8179670) wrote :
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

Are you able to reproduce the hang when running (all on 1 line)
$ sudo DEBCONF_DEBUG='.*' sh -x /var/lib/dpkg/info/grub-pc.postinst configure 1.98-1ubuntu5 2>&1 | tee ~/grub-pc.log

If it hangs then please attach the file ~/grub-pc.log to this report

Thanks in advance.

Changed in grub2 (Ubuntu):
status: New → Incomplete
Oswald (q8179670) wrote :

After 370 lines in the attached grub-pc.log, I had to kill grub-install (I could not kill grub-setup). pstree at that time was

bash─┬─frontend───grub-pc.postins───grub-install───grub-setup
     └─tee

In the end I had to kill frontend. Here's the pstree before the final killing began:

bash(22083)─┬─frontend(22100)───grub-pc.postins(22122)───grub-mkconfig(23466)───30_os-prober(23658)───30_os-prober(23670)─┬─os-prober(23671)───50mounted-tests(23744)───mount(23748)───mount.ntfs-3g(23749)
            │ ├─paste(23673)
            │ └─tr(23672)
            └─tee(22101)

Changed in grub2 (Ubuntu):
status: Incomplete → New
Jean-Baptiste Lallement (jibel) wrote :

Thanks for the trace. I think that we've finally caught something.

From the grub-pc.log:
rmdir: failed to remove `/var/lib/os-prober/mount': Device or resource busy

There is also this trace in dmesg at the same time:
[217080.308127] INFO: task grub-setup:21796 blocked for more than 120 seconds.
[217080.308136] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[217080.308142] grub-setup D 000168a6 0 21796 21163 0x00000000
[217080.308152] f145bf2c 00000082 c2b28000 000168a6 00000000 c0844720 c0cde92c c0844720
[217080.308167] 3b3cff87 0000c44f c0844720 c0844720 c0cde92c c0844720 c0844720 f6bef880
[217080.308181] 00000000 0000c44f c0cde680 f145bf60 c0cde680 e4c1c23c f145bf58 c058aa05
[217080.308196] Call Trace:
[217080.308220] [<c058aa05>] rwsem_down_failed_common+0x75/0x1a0
[217080.308228] [<c058ab7d>] rwsem_down_read_failed+0x1d/0x30
[217080.308236] [<c058abd7>] call_rwsem_down_read_failed+0x7/0x10
[217080.308243] [<c058a12c>] ? down_read+0x1c/0x20
[217080.308252] [<c022a10d>] sync_filesystems+0xbd/0x110
[217080.308260] [<c022a1b6>] sys_sync+0x16/0x40
[217080.308268] [<c01033ec>] syscall_call+0x7/0xb

Which would suggest that the sync call in grub-setup didn't return and matches the 1rst ps output.

BTW I noticed that there are I/O errors on sdb
[118033.240069] Buffer I/O error on device sdb1, logical block 4096327
[118033.240084] Buffer I/O error on device sdb1, logical block 4096328
[118033.240093] Buffer I/O error on device sdb1, logical block 4096329
[118033.240101] Buffer I/O error on device sdb1, logical block 4096330
[118033.240110] Buffer I/O error on device sdb1, logical block 4096331
[118033.240119] Buffer I/O error on device sdb1, logical block 4096332
[118033.240127] Buffer I/O error on device sdb1, logical block 4096333
[118033.240136] Buffer I/O error on device sdb1, logical block 4096334
[118033.240144] Buffer I/O error on device sdb1, logical block 4096335
[118033.240526] sd 2:0:0:0: [sdb] Unhandled error code
[118033.240532] sd 2:0:0:0: [sdb] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[118033.240541] sd 2:0:0:0: [sdb] CDB: Read(10): 28 00 01 f4 0b 67 00 00 10 00
[118033.240561] end_request: I/O error, dev sdb, sector 32770919

but that shouldn't be related to the grub-pc upgrade since it was not mounted at the time of the failure.

Just to confirm your setup. This is a dual boot system with windows on sda1, linux on sda3, a data disk (which filesystem) on sdc, another unused drive on sdb, and an external drive on sd. grub2 is installed on MBR of sda and it's not a virtual machine ?
Is there anything else specific to your setup ?

Do you have some "boot sector virus protection" enabled in your bios ?

Changed in grub2 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Oswald (q8179670) wrote :

The data disk has NTFS on the second partition the first partition is an truecrypt volume.

The data disk sometimes shows up as sdb and sometimes as sdc (which is quite annoying, because I did not yet dig into these UUID-thingies I find in recent fstab-files). My guess is, this is where the IO error comes from.

No boot sector virus protection enabled in the BIOS.

summary: - package grub-pc 1.98-1ubuntu4 failed to upgrade: subprocess installed
- post-installation script hangs
+ package grub-pc 1.98-1ubuntu4 failed to upgrade: grub-setup hangs on fs
+ sync - device or ressource busy
summary: package grub-pc 1.98-1ubuntu4 failed to upgrade: grub-setup hangs on fs
- sync - device or ressource busy
+ sync - device or resource busy
Changed in grub2 (Ubuntu):
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers