grub2: 'error: no such partition' when trying to boot from hd0,10

Bug #440587 reported by tavasti
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Binary package hint: grub2

ProblemType: Bug
Architecture: i386
Date: Fri Oct 2 16:14:42 2009
Dependencies:
 base-files 5.0.0ubuntu6
 base-passwd 3.5.21
 coreutils 7.4-2
 debconf 1.5.27ubuntu1
 debconf-i18n 1.5.27ubuntu1
 dpkg 1.15.4ubuntu2
 findutils 4.4.2-1
 gcc-4.4-base 4.4.1-4ubuntu4
 grub-common 1.97~beta3-1ubuntu6
 libacl1 2.2.47-2
 libattr1 1:2.4.43-3
 libc-bin 2.10.1-0ubuntu12
 libc6 2.10.1-0ubuntu12
 libdb4.7 4.7.25-7ubuntu2
 libfreetype6 2.3.9-5
 libgcc1 1:4.4.1-4ubuntu4
 liblocale-gettext-perl 1.05-4build1
 libncurses5 5.7+20090803-2ubuntu1
 libpam-modules 1.1.0-2ubuntu1
 libpam-runtime 1.1.0-2ubuntu1
 libpam0g 1.1.0-2ubuntu1
 libselinux1 2.0.85-2
 libstdc++6 4.4.1-4ubuntu4
 libtext-charwidth-perl 0.04-5build1
 libtext-iconv-perl 1.7-1build1
 libtext-wrapi18n-perl 0.06-7
 lsb-base 4.0-0ubuntu4
 lzma 4.43-14ubuntu1
 ncurses-bin 5.7+20090803-2ubuntu1
 perl-base 5.10.0-24ubuntu3
 sed 4.2.1-1
 tzdata 2009m-1
 ucf 3.0018ubuntu1
 zlib1g 1:1.2.3.3.dfsg-13ubuntu3
DistroRelease: Ubuntu 9.10
Package: grub-pc 1.97~beta3-1ubuntu6
PackageArchitecture: i386
ProcEnviron:
 SHELL=/bin/sh
 PATH=(custom, no user)
 LANG=C.UTF-8
 LANGUAGE=en
ProcVersionSignature: Ubuntu 2.6.31-11.36-generic
SourcePackage: grub2
Uname: Linux 2.6.31-11-generic i686

I installed from xubuntu-9.10-alternative beta. Install goes ok.
On boot I get:
----------------------------------------------
GRUB loading.
error: no such partition
grub rescue> ls
(hd0) (hd0,7) (hd0,6) (hd0,5) (hd0,4) (hd0,3) (hd0,2) (hd0,1)
error: out of disk
grub rescue> set
prefix=(hd0,10)/boot/grub
root=hd0,10
----------------------------------------------

root@toope:~# fdisk -l

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004038c

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 2612 20980858+ 7 HPFS/NTFS
/dev/sda2 2613 3735 9020497+ 7 HPFS/NTFS
/dev/sda3 3736 3867 1060290 83 Linux
/dev/sda4 3868 38913 281506995 5 Extended
/dev/sda5 3868 6479 20980858+ 83 Linux
/dev/sda6 9092 9875 6297448+ 82 Linux swap / Solaris
/dev/sda7 9876 28152 146809971 8e Linux LVM
/dev/sda8 28153 34680 52436128+ 8e Linux LVM
/dev/sda9 34681 38913 34001541 8e Linux LVM
/dev/sda10 6480 9091 20980858+ 83 Linux

Partition table entries are not in disk order

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 440587] [NEW] grub2: 'error: no such partition' when trying to boot from hd0, 10

Thanks for your report. Could you try this at the rescue prompt and
report the output?

  set debug=partition
  ls

Revision history for this message
tavasti (tavasti) wrote :

I can, but no serial console, so I cannot even see all. I'll attach picture what is seen:

Revision history for this message
tavasti (tavasti) wrote :

Older grub gives better erro message telling BIOS can't access such partition. sda10 is not itself too far on disk, but to get address of it grub has to walk through sda5->sda9. And apparently BIOS can't access sda8 beginning?

I think this bug can be marked as minor, only thing to fix is give more informative error message. If BIOS can't access it, it''s impossible to boot from that partion. After deleting and creating logical partitions in correct order grub works fine.

Revision history for this message
Liu Bo (liubolyuha) wrote :

Hi, I also met the same problem. But I comment the following code to work around it.

Package: grub-1.97.1.tar.gz
  Source: grub-1.97.1/kern/disk.c:

  Before Modified:

373 if (disk->total_sectors <= *sector
374 || ((*offset + size + GRUB_DISK_SECTOR_SIZE - 1)
375 >> GRUB_DISK_SECTOR_BITS) > disk->total_sectors - *sector)
376 return grub_error (GRUB_ERR_OUT_OF_RANGE, "out of disk");
377
378 return GRUB_ERR_NONE;

 After Modified:

373 if (disk->total_sectors <= *sector
374 || ((*offset + size + GRUB_DISK_SECTOR_SIZE - 1)
375 >> GRUB_DISK_SECTOR_BITS) > disk->total_sectors - *sector)
376 /*return grub_error (GRUB_ERR_OUT_OF_RANGE, "out of disk");*/ ******
          {;}
377
378 return GRUB_ERR_NONE;

Please confirm the funtion of the above code. Thanks.

Revision history for this message
Felix Zielcke (fzielcke) wrote : Re: [Bug 440587] Re: grub2: 'error: no such partition' when trying to boot from hd0, 10

Am Dienstag, den 17.11.2009, 00:58 +0000 schrieb Liu Bo:
> Hi, I also met the same problem. But I comment the following code to
> work around it.
>
What does it work around?
Does it do more then just hiding the out of disk error?
If so then we probable have some bug in the error handling.

The kernel out of disk error is a sign for either a bug in our
filesystem code or in the filesystem itself.
Unfortunately reiserfs is the only filesystem for which we have debug
code.
Though it could also be a BIOS bug that it reports a different disk size
then it actually has.
>
> Please confirm the funtion of the above code. Thanks.
>

I doubt this function is the problem.
And if you would have looked a few lines below where this function gets
actually called it would give you at least a hint how you can find out
for which sector number that function fails.

To get the disk dprintfs shown in rescue mode the following should work,
but it seems like the pager only works in mormal mode.
sudo -s
printf 'set pager=1\nset debug=disk' > /boot/grub/rescue.cfg
In /usr/sbin/grub-install change this line
  $grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
to this
  $grub_mkimage --config=${grubdir}/rescue.cfg --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1
and then just run it like usual.

Though because you're already familiar with compiling and modifying it you could also replace the grub_dprintf with normal grub_printfs.

--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer

Revision history for this message
Felix Zielcke (fzielcke) wrote :

Please try if this still happens with my latest PPA upload:
https://launchpad.net/~fzielcke/+archive/grub-ppa/
Note that it's the experimental branch from upstream and so could contain other bugs.

Revision history for this message
victor_ze (viktors) wrote :
Download full text (16.2 KiB)

Felix, I have the same issue. Using qemu I have installed on my 320GB 2.5 SATA HDD ubuntu using alternate CD (using automatic partitioning) and it boots and works fine under qemu.
However, if I put this 320GB HDD in soekris (embedded board) I get the same grub error "no such partition". It looks like /boot partition gets assigned sda5 and it is far after LVG partition, but soekris BIOS detects 320GB HDD as 134GB, so it seems that its BIOS fault, what could be workaround? Should I create partition table manually specifying /boot as first partition on the disk start? Why ubuntu automatic partition assigns /boot as last partition on the end of the disk?

Under qemu:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/unknown-root
                      292G 79G 199G 29% /
udev 249M 156K 249M 1% /dev
none 249M 0 249M 0% /dev/shm
none 249M 64K 249M 1% /var/run
none 249M 0 249M 0% /var/lock
none 249M 0 249M 0% /lib/init/rw
/dev/sda5 228M 33M 183M 16% /boot
$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000c19d7

   Device Boot Start End Blocks Id System
/dev/sda1 * 1 38882 312319633+ 83 Linux
/dev/sda2 38883 38913 249007+ 5 Extended
/dev/sda5 38883 38913 248976 83 Linux

Under soekris:
$ cu --nostop -s 115200 -l /dev/ttyUSB0
Connected.
POST: 012345689bcefghips1234ajklnopqr,,,tvwxy
comBIOS ver. 1.33c 20080626 Copyright (C) 2000-2008 Soekris Engineering.

net5501

0512 Mbyte Memory CPU Geode LX 500 Mhz

Pri Sla ST9320421AS LBA Xlt 1024-255-63 134 Gbyte

Slot Vend Dev ClassRev Cmd Stat CL LT HT Base1 Base2 Int
-------------------------------------------------------------------
0:01:2 1022 2082 10100000 0006 0220 08 00 00 A0000000 00000000 10
0:06:0 1106 3053 02000096 0117 0210 08 40 00 0000E101 A0004000 11
0:07:0 1106 3053 02000096 0117 0210 08 40 00 0000E201 A0004100 05
0:08:0 1106 3053 02000096 0117 0210 08 40 00 0000E301 A0004200 09
0:09:0 1106 3053 02000096 0117 0210 08 40 00 0000E401 A0004300 12
0:17:0 1814 0302 02800000 0117 0410 08 40 00 A0008000 00000000 15
0:20:0 1022 2090 06010003 0009 02A0 08 40 80 00006001 00006101
0:20:2 1022 209A 01018001 0005 02A0 08 00 00 00000000 00000000
0:21:0 1022 2094 0C031002 0006 0230 08 00 80 A0010000 00000000 07
0:21:1 1022 2095 0C032002 0006 0230 08 00 00 A0011000 00000000 07

 1 Seconds to automatic boot. Press Ctrl-P for entering Monitor.
GRUB loading.
error: no such partition
grub rescue> set
prefix=(hd0,5)/grub
root=hd0,5
grub rescue> ls
(hd0) (hd0,1) (hd1) (hd1,1) (hd2) (hd2,1) (hd3) (hd3,1) (hd4) (hd4,1) (hd5) (hd5,1) (hd6) (hd6,1) (hd7) (hd7,1) (hd8) (hd8,1) (hd9) (hd9,1) (hd10) (hd10,1) (hd11) (hd11,1) (hd12) (hd12,1) (hd13) (hd13,1) (hd14) (hd14,1) (hd15) (hd15,1)
grub rescue> set debug=partition
grub rescue> ls
(hd0) /build/buildd/grub2-1.98~experimental.20091217/ke...

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

This release of Ubuntu is no longer receiving maintenance updates. If this is still an issue on a maintained version of Ubuntu please let us know.

Changed in grub2 (Ubuntu):
status: New → 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.

Other bug subscribers

Remote bug watches

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