Latest update renders system unbootable "error: no such partition"

Bug #960092 reported by Alan Pope 🍺🐧🐱 🦄
88
This bug affects 18 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Invalid
High
Unassigned

Bug Description

Just did my daily 12.04 updates and ended up with an unbootable system:-

error: no such partition.
error: no such partition.
error: no such partition.

Press any key to continue...

I had to chroot into the install to reinstall grub and the kernel to get it back to a bootable state.

See attached photos.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: grub (not installed)
ProcVersionSignature: Ubuntu 3.2.0-19.30-generic 3.2.11
Uname: Linux 3.2.0-19-generic x86_64
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
Date: Tue Mar 20 11:00:34 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120102)
SourcePackage: grub
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub (Ubuntu):
status: New → Confirmed
Steve Langasek (vorlon)
affects: grub (Ubuntu) → grub2 (Ubuntu)
Changed in grub2 (Ubuntu):
importance: Undecided → High
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

My partition layout is based on two disks. One SSD for / and swap, one large hard disk for /home.

alan@wopr:~$ sudo fdisk -l
[sudo] password for alan:

Disk /dev/sda: 1000 GB, 1000202273280 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 121602 976768033 83 Linux
Warning: Partition 1 does not end on cylinder boundary.

Disk /dev/sdb: 120 GB, 120031511040 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13995 112414806 83 Linux
Warning: Partition 1 does not end on cylinder boundary.
/dev/sdb2 13995 14594 4811467 5 Extended
Warning: Partition 2 does not end on cylinder boundary.
/dev/sdb5 13995 14594 4811467 82 Linux swap
Warning: Partition 5 does not end on cylinder boundary.
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
Error: /dev/sr0: unrecognised disk label

alan@wopr:~$ mount
/dev/sdb1 on / type ext4 (rw,errors=remount-ro,discard)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
cgroup on /sys/fs/cgroup type tmpfs (rw,relatime,mode=755)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,relatime,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,relatime,perf_event)
/dev/sda1 on /home type ext4 (rw,user_xattr)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/alan/.cache/gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=alan)
gvfs-fuse-daemon on /tmp/guest-dF1pAM/.cache/gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=guest-dF1pAM)

Revision history for this message
Colin Watson (cjwatson) wrote :

Could you attach /boot/grub/grub.cfg and the output of 'debconf-show grub-pc'?

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :
Download full text (13.6 KiB)

alan@wopr:~$ debconf-show grub-pc
debconf: DbDriver "passwords" warning: could not open /var/cache/debconf/passwords.dat: Permission denied
  grub-pc/kopt_extracted: false
  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
* grub-pc/install_devices: /dev/disk/by-id/ata-SAMSUNG_HD103SI_S1VSJ90B701831
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/disk_description:
* grub2/linux_cmdline:
  grub-pc/install_devices_empty: false
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/partition_description:
  grub-pc/install_devices_failed: false
  grub-pc/install_devices_disks_changed:
* grub2/linux_cmdline_default: quiet splash
  grub-pc/chainload_from_menu.lst: true
  grub-pc/hidden_timeout: true
  grub-pc/mixed_legacy_and_grub2: true
  grub-pc/timeout: 10

#
# 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/00_header ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
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 recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd1,msdos1)'
search --no-floppy --fs-uuid --set=root 3d53ca44-6af4-422d-b1b0-adf30c679a2f
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd1,msdos1)'
  search --no-floppy --fs-uuid --set=root 3d53ca44-6af4-422d-b1b0-adf30c679a2f
  set locale_dir=($root)/boot/grub/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ]; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
if [ ${recordfail} != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
menuentry 'Ubuntu, with Linux 3.2.0-19-generic' --class ubuntu --class gnu-linux --class gnu --class os {
 recordfail
 set gfxpayload=$linux_gfx_mode
 insmod gzio
 insmod part_msdos
 insmod ext2
 set root='(hd1,msdos1)'
 search --no-floppy --fs-uuid --set=root 3d53ca44-6af4-422d-b1b0-adf30c679a2f
 linux /boot/vmlinuz-3.2.0-1...

Revision history for this message
Colin Watson (cjwatson) wrote :

ls -l /dev/disk/by-id/

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

alan@wopr:~$ ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root 9 Mar 20 14:09 ata-Corsair_CSSD-F120GB2_11126500000009980264 -> ../../sdb
lrwxrwxrwx 1 root root 10 Mar 20 10:53 ata-Corsair_CSSD-F120GB2_11126500000009980264-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 20 10:53 ata-Corsair_CSSD-F120GB2_11126500000009980264-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Mar 20 10:53 ata-Corsair_CSSD-F120GB2_11126500000009980264-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 9 Mar 20 14:09 ata-SAMSUNG_HD103SI_S1VSJ90B701831 -> ../../sda
lrwxrwxrwx 1 root root 10 Mar 20 10:53 ata-SAMSUNG_HD103SI_S1VSJ90B701831-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Mar 20 10:53 ata-TSSTcorp_CDDVDW_SH-222AB_R8F06GAB502689 -> ../../sr0
lrwxrwxrwx 1 root root 9 Mar 20 14:09 scsi-SATA_Corsair_CSSD-F111126500000009980264 -> ../../sdb
lrwxrwxrwx 1 root root 10 Mar 20 10:53 scsi-SATA_Corsair_CSSD-F111126500000009980264-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 20 10:53 scsi-SATA_Corsair_CSSD-F111126500000009980264-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Mar 20 10:53 scsi-SATA_Corsair_CSSD-F111126500000009980264-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 9 Mar 20 14:09 scsi-SATA_SAMSUNG_HD103SIS1VSJ90B701831 -> ../../sda
lrwxrwxrwx 1 root root 10 Mar 20 10:53 scsi-SATA_SAMSUNG_HD103SIS1VSJ90B701831-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Mar 20 14:09 wwn-0x5000000000000612 -> ../../sdb
lrwxrwxrwx 1 root root 10 Mar 20 10:53 wwn-0x5000000000000612-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 20 10:53 wwn-0x5000000000000612-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Mar 20 10:53 wwn-0x5000000000000612-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 9 Mar 20 14:09 wwn-0x50024e9205949bd1 -> ../../sda
lrwxrwxrwx 1 root root 10 Mar 20 10:53 wwn-0x50024e9205949bd1-part1 -> ../../sda1

Revision history for this message
Colin Watson (cjwatson) wrote :

OK, so I'm afraid your GRUB installation was simply misconfigured. It was set up to upgrade the boot loader on /dev/sda every time you upgraded, but according to your comment on IRC you want it on /dev/sdb. The effect of this was that you had an old partial copy of GRUB on /dev/sdb, which eventually broke due to otherwise-innocuous changes (the ABI between a GRUB core image and GRUB modules is not fixed).

You should run 'sudo dpkg-reconfigure grub-pc' and make sure the disk you want to boot from is selected; I would in general recommend selecting all the non-removable disks in your system.

Changed in grub2 (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Henk-Jan (henk-jan) wrote :

I already fixed this with a live cd..

While upgrading grub, there was an error that grub couldn't be installed to /dev/dm-5. That is the partition Ubuntu is installed on.

How to prevent this in the future?
I'm using fakeraid 10.

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

Hmm. It seems to be triggered by having multiple disks in the host. My /dev/sda (which I don't boot off) has previously had a linux install on it, and I reused the disk by creating one big partition and formatting it for /home. I would never have wiped grub off the master boot record.

So I'd suggest it's not that my grub was misconfigured, but merely that there was an old grub on the start of the disk in the mbr. I don't think this is an unreasonable or massively unusual situation these days as people re-use disks and move them about between machines.

Revision history for this message
FJYwade (fjywade) wrote :

I came into the same problem after the upgrade of my 12.04 this morning.
I googled for how to fix this bug for almost an hour and tried much but made nothing...
My laptop just has a single os of ubuntu 12.04, without any windows or other.

Revision history for this message
Andreas Pabst (andhii) wrote :

Same problem for me now after running upgrade this morning.

Single harddisk, but multiple partitions (Windows, precise, another linux, swap), none of them bootable any more.
During the update, aptdaemon had crashed while some python packages were being installed.
I can chroot into the installation from a live cd to report some information, if someone tells me what might be interesting.

Revision history for this message
Jason Harman (apollyon-direct) wrote :

Also have this problem - have multiple disk system likely with some old grub installs from past configurations. Latest upgrade broke boot into Ubuntu & Windoze. Using LiveCD now but could use some advice for a quick fix.

Revision history for this message
Andreas Pabst (andhii) wrote :

Jason, I guess you will simply have to reinstall grub using a live cd.
To do this you can either use the graphical solution bootrepair: https://help.ubuntu.com/community/Boot-Repair
Or you use the chroot method as described here: https://help.ubuntu.com/community/Grub2#ChRoot

Revision history for this message
Jason Harman (apollyon-direct) wrote :

Thanks Andreas - the Boot-Repair program worked like a charm and I'm back in Ubuntu 12.04!

Revision history for this message
icetnet (bfetters) wrote :

Andreas,

You get the ribbon. I had the same exact symptoms: single drive, multiple partitions (however only one OS - Ubuntu).

Boot-Repair worked like a champ.

Thanks.

z3non (tom-uttenthaler)
Changed in grub2 (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Phillip Susi (psusi) wrote :

Please don't change bug status without giving a good reason.

Changed in grub2 (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
misko (michael-wagner-gmx) wrote :

Same error occured on my TravelMate 8481TG Notebook (equipped with a 64GB SSD and a 320 GB HDD). System was initially installed and worked with oneiric, but refused to boot ("error: no such partition.") after upgrading to precise pangoline.

Fixed it with a Boot-Repair LiveCD- the diagnostic output of Boot-Repair can be found here: http://paste.ubuntu.com/957421/

Revision history for this message
Jason Harman (apollyon-direct) wrote :

Its true - in a sense - a similar bug was produced after a recent update to grub which caused similar errors as this one - I got a "blocklist" error and while I could still boot Ubuntu I could not boot Windows. From Ubuntu I ran Boot-Repair which re-identified a harddrive missed by Grub and restored my bootloader.

Revision history for this message
finn (finn-uni-bremen) wrote :

Same here after update from 11.10 on a machine with intel fakeraid.

Revision history for this message
Thorsten Hesemeyer (thorsten-hesemeyer) wrote :

Same here:
  1. backup: attached an external disk to update my files first
  2. started upgrade from Ubuntu 11.10 to 12.04 with the usb disk attached
  3. system does not boot

Dear Colin Watson and Phillip Susi,
 "invalid" is not appropriate for a bug or product failure.
It is not a users fault, if the upgrade failes to reconfigure a running system.

Kind regards,
Thorsten Hesemeyer

Changed in grub2 (Ubuntu):
status: Invalid → Confirmed
Revision history for this message
Phillip Susi (psusi) wrote :

It is invalid because it is not a bug. The original reporter's system was misconfigured, and can be corrected by running sudo dpkg-reconfigure grub-pc. If you are having a different issue and/or this does not resolve it for you, please file a new bug.

Changed in grub2 (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Bryce Nesbitt (bryce2) wrote :

It's hard to 'sudo dpkg-reconfigure grub-pc' when your system won't boot.

For those ending up here looking for a solution, this worked for me:
http://askubuntu.com/questions/125428/grub-complains-of-no-such-partition-after-installing-1204

Revision history for this message
Phillip Susi (psusi) wrote :

Obviously once you have gotten yourself into this situation, you need to boot from a rescue disk, then you fix the misconfiguration so that the system won't fail to boot on the next upgrade.

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.