I have Ubuntu 12.04 in a dual-boot system with Windows XP in another partition. I used the live CD to perform the install and create the partitions. It has been running for about 2 weeks but this morning after restarting, Ubuntu fails to boot from grub2. I get the following message:
error: out of partition
After that the boot menu comes up as usual, but when I select 1Ubuntu, with Linux 3.2.0-37-generic-pae1 I get the following messages:
error: out of partition error: cannot read the Linux header error: you need to load the kernel first
After that I can press any key to continue, which brings me back to the boot menu, but then I am back to the same error messages when I re-select Ubuntu. Fortunately, I can boot Windows XP from the menu which allows me web access.
The bootloader displays
GNU GRUB version 1.99-21ubuntu3.9
It also seems that the problem coincides with the appearance of a new boot menu item
Previous Linux Versions, or something like that, and when I select that one I get a menu with an older version of Linux but I cannot boot that one either. A few days ago I installed the 330 or so
recommended updates using the Ubuntu Software Updater but there was no problem at the time, it just shows up now after a few trivial changes and then rebooting.
I am new to Linux/Ubuntu environment. It may be hard for me to provide logs, etc. unless somehow I can copy files onto USB. Because of the dual-boot system, I cannot access Linux files from Windows XP, which is my only web access right now.
Now later this week, I was able to use boot-repair to create a Bootinfo summary (by booting from live CD in demo mode). The URL it generated is here. I hope someone on this forum can look at the URL to find out if the problem is with
grub2 or with the Linux file system, and then recommend how to fix the damage.
Ideally I would like to get Ubuntu back with all my settings intact. If that's not possible then I could try reinstalling Ubuntu from live CD but I want to be careful not to lose my Windows XP boot option.
The solution and steps taken:
Finally, after much research on the web, the solution to my problem was to reinstall Ubuntu from live CD. Along the way, I took the following steps:
Checked that my BIOS supports
LBA(Logical Block Addressing) mode on the hard disk. Some older PCs that use the ATA specification cannot address sectors on the hard disk beyond 268435456 which at 512 bytes/sector is 137GB (128GiB), due to a BIOS limitation. This happened to be where my Linux partition (and grub2) started so I suspected this was the source of the "out of partition" error. However, this was not the case because when accessing the BIOS setup screen it showed LBA under the hard disk information section. And usually, this problem results in an "out of disk" error, not "out of partition" as I was getting.
TestDiskutility to rewrite the partition table after booting from live CD. Again I suspected there was something wrong with the partitioning so TestDisk was a logical choice. However, this did not fix the problem and I would not recommend this to anyone who is unfamiliar with partitioning methods since it can do serious damage if not used carefully.
The fact that the bootinfo summary showed that it was not able to mount the Linux filesystem was a strong indicator that the filesystem was corrupted. However, I wanted to see how bad the damage was before attempting to fix it. I booted from the live CD and ran the following command from the terminal:
sudo e2fsck -n -v /dev/sdXY, where sdXY is the name of the Linux partition (in my case it was /dev/sda5). The -n option specifies read-only mode so it detects errors but does not fix them. Using the -v (verbose) option, the output of the command showed hundreds of errors. At this point I realized that the problem was a hopelessly corrupted Linux partition and that the only way to fix it was to reinstall Ubuntu from live CD. To do this I selected the "Something Else" option when installing to reuse the existing partitions and checked the Format box for the Linux ext4 partition. The reinstall also fixed the "out of partition" errors -- I never did find out what was causing them.