PDA

View Full Version : [ubuntu] hd0 out of disk



HaasEffect
June 10th, 2013, 09:30 AM
Hi,

I'm having troubles booting ubuntu 12.04.1 via GRUB2. Quite frequently (more often than not) I'm getting the following message right after I start up the computer:

error: hd0 out of disk.
grub rescue>

Sometimes it's able to load the GRUB bootloader and boot Ubuntu - but rather rarely. I researched the issue and already tried out some things:
1) Reinstalled Grub manually
2) Tried to fix it using Boot-Repair
3) Executing this in grub rescue:
grub rescue> set prefix=(hd0,msdos3)/boot/grub
grub rescue> insmod normal
grub rescue> normal--> returns "out of disk"

But no luck yet - the problem stays the same.

Here's the log file from Boot-Repair (check out the last message at the end of the log file) - here's a link to the log file for format reasons: http://paste.ubuntu.com/5750805/:

Boot Info Script e7fc706 + Boot-Repair extra info
============================= Boot Info Summary: =============================== => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 1 of the same hard drive [B]for core.img. core.img is at this location and looks for (,msdos1)/boot/grub on this drive.sda1: __________________________________________________ ________________________ File system: ext4 Boot sector type: - Boot sector info: Operating System: Ubuntu 12.04.1 LTS Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.imgsda2: __________________________________________________ ________________________ File system: Extended Partition Boot sector type: - Boot sector info: sda5: __________________________________________________ ________________________ File system: swap Boot sector type: - Boot sector info: ============================ Drive/Partition Info: =============================Drive: sda __________________________________________________ ___________________Disk /dev/sda: 120.0 GB, 120034123776 bytes255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesPartition Boot Start Sector End Sector # of Sectors Id System/dev/sda1 * 2,048 226,297,855 226,295,808 83 Linux/dev/sda2 226,299,902 234,440,703 8,140,802 5 Extended/dev/sda5 226,299,904 234,440,703 8,140,800 82 Linux swap / Solaris"blkid" output: __________________________________________________ ______________Device UUID TYPE LABEL/dev/sda1 dc91e228-d60e-49ea-9d90-b7eff89168e5 ext4 /dev/sda5 d83de15a-0253-4db7-85cf-ad3490c8b899 swap ================================ Mount points: =================================Device Mount_Point Type Options/dev/sda1 / ext4 (rw,errors=remount-ro)=========================== sda1/boot/grub/grub.cfg: ===========================--------------------------------------------------------------------------------## 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 ]; thenset have_grubenv=trueload_envfiset default="0"if [ "${prev_saved_entry}" ]; thenset saved_entry="${prev_saved_entry}" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=truefifunction savedefault { if [ -z "${boot_once}" ]; thensaved_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_msdosinsmod ext2set root='(hd0,msdos1)'search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5if loadfont /usr/share/grub/unicode.pf2 ; thenset gfxmode=auto load_video insmod gfxterm insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5 set locale_dir=($root)/boot/grub/locale set lang=de_AT insmod gettextfiterminal_output gfxterm#if [ "${recordfail}" = 1 ]; then# set timeout=10#else set timeout=10#fi### END /etc/grub.d/00_header ###### BEGIN /etc/grub.d/05_debian_theme ###set menu_color_normal=white/blackset menu_color_highlight=black/light-grayif background_color 44,0,30; thenclearfi### END /etc/grub.d/05_debian_theme ###### BEGIN /etc/grub.d/10_linux ###function gfxmode { set gfxpayload="${1}" if [ "${1}" = "keep" ]; thenset vt_handoff=vt.handoff=7 elseset vt_handoff= fi}if [ "${recordfail}" != 1 ]; then if [ -e ${prefix}/gfxblacklist.txt ]; then if hwmatch ${prefix}/gfxblacklist.txt 3; then if [ ${match} = 0 ]; thenset linux_gfx_mode=keep elseset linux_gfx_mode=text fi elseset linux_gfx_mode=text fi elseset linux_gfx_mode=keep fielseset linux_gfx_mode=textfiexport linux_gfx_modeif [ "${linux_gfx_mode}" != "text" ]; then load_video; fimenuentry 'Ubuntu, with Linux 3.2.0-30-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os { recordfail gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5 linux /boot/vmlinuz-3.2.0-30-generic-pae root=UUID=dc91e228-d60e-49ea-9d90-b7eff89168e5 ro text initrd /boot/initrd.img-3.2.0-30-generic-pae}menuentry 'Ubuntu, with Linux 3.2.0-30-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5 echo 'Loading Linux 3.2.0-30-generic-pae ...' linux /boot/vmlinuz-3.2.0-30-generic-pae root=UUID=dc91e228-d60e-49ea-9d90-b7eff89168e5 ro recovery nomodeset echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.2.0-30-generic-pae}submenu "Previous Linux versions" {menuentry 'Ubuntu, with Linux 3.2.0-29-generic-pae' --class ubuntu --class gnu-linux --class gnu --class os { recordfail gfxmode $linux_gfx_mode insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5 linux /boot/vmlinuz-3.2.0-29-generic-pae root=UUID=dc91e228-d60e-49ea-9d90-b7eff89168e5 ro text initrd /boot/initrd.img-3.2.0-29-generic-pae}menuentry 'Ubuntu, with Linux 3.2.0-29-generic-pae (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod gzio insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5 echo 'Loading Linux 3.2.0-29-generic-pae ...' linux /boot/vmlinuz-3.2.0-29-generic-pae root=UUID=dc91e228-d60e-49ea-9d90-b7eff89168e5 ro recovery nomodeset echo 'Loading initial ramdisk ...' initrd /boot/initrd.img-3.2.0-29-generic-pae}}### END /etc/grub.d/10_linux ###### BEGIN /etc/grub.d/20_linux_xen ###### END /etc/grub.d/20_linux_xen ###### BEGIN /etc/grub.d/20_memtest86+ ###menuentry "Memory test (memtest86+)" { insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5 linux16 /boot/memtest86+.bin}menuentry "Memory test (memtest86+, serial console 115200)" { insmod part_msdos insmod ext2 set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root dc91e228-d60e-49ea-9d90-b7eff89168e5 linux16 /boot/memtest86+.bin console=ttyS0,115200n8}### END /etc/grub.d/20_memtest86+ ###### BEGIN /etc/grub.d/30_os-prober ###### END /etc/grub.d/30_os-prober ###### BEGIN /etc/grub.d/40_custom #### This file provides an easy way to add custom menu entries. Simply type the# menu entries you want to add after this comment. Be careful not to change# the 'exec tail' line above.### END /etc/grub.d/40_custom ###### BEGIN /etc/grub.d/41_custom ###if [ -f $prefix/custom.cfg ]; thensource $prefix/custom.cfg;fi### END /etc/grub.d/41_custom ###--------------------------------------------------------------------------------=============================== sda1/etc/fstab: ================================--------------------------------------------------------------------------------# /etc/fstab: static file system information.## Use 'blkid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## <file system> <mount point> <type> <options> <dump> <pass>proc /proc proc nodev,noexec,nosuid 0 0# / was on /dev/sda1 during installationUUID=dc91e228-d60e-49ea-9d90-b7eff89168e5 / ext4 errors=remount-ro 0 1# swap was on /dev/sda5 during installationUUID=d83de15a-0253-4db7-85cf-ad3490c8b899 none swap sw 0 0--------------------------------------------------------------------------------=================== sda1: Location of files loaded by Grub: ==================== GiB - GB File Fragment(s) 44.145736694 = 47.401123840 boot/grub/grub.cfg 1 74.169601440 = 79.639003136 boot/grub/core.img 1 0.545734406 = 0.585977856 boot/vmlinuz-3.2.0-29-generic-pae 2 1.052520752 = 1.130135552 boot/vmlinuz-3.2.0-30-generic-pae 1 0.545734406 = 0.585977856 vmlinuz 2 1.764156342 = 1.894248448 boot/initrd.img-3.2.0-29-generic-pae 1 1.506343842 = 1.617424384 boot/initrd.img-3.2.0-30-generic-pae 2 1.764156342 = 1.894248448 initrd.img 1 1.764156342 = 1.894248448 initrd.img.old 1ADDITIONAL INFORMATION :=================== log of boot-repair 2013-06-10__09h19 ===================boot-repair version : 3.199~ppa4~preciseboot-sav version : 3.199~ppa4~preciseglade2script version : 3.2.2~ppa45~preciseboot-sav-extra version : 3.199~ppa4~preciseboot-repair is executed in installed-session (Ubuntu 12.04.1 LTS, precise, Ubuntu, i686)CPU op-mode(s): 32-bit, 64-bitBOOT_IMAGE=/boot/vmlinuz-3.2.0-30-generic-pae root=UUID=dc91e228-d60e-49ea-9d90-b7eff89168e5 ro text=================== os-prober:/dev/sda1:Das aktuell benutzte Betriebssystem - Ubuntu 12.04.1 LTS CurrentSession:linux=================== blkid:/dev/sda1: UUID="dc91e228-d60e-49ea-9d90-b7eff89168e5" TYPE="ext4"/dev/sda5: UUID="d83de15a-0253-4db7-85cf-ad3490c8b899" TYPE="swap"1 disks with OS, 1 OS : 1 Linux, 0 MacOS, 0 Windows, 0 unknown type OS.Warnung: erweiterte Partition beginnt nicht an einer ZylindergrenzeDOS und Linux werden den Inhalt unterschiedlich interpretieren.=================== /etc/default/grub :# If you change this file, run 'update-grub' afterwards to update# /boot/grub/grub.cfg.# For full documentation of the options in this file, see:# info -f grub -n 'Simple configuration'GRUB_DEFAULT=0#GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=falseGRUB_RECORDFAIL_TIM EOUT=4GRUB_TIMEOUT=2GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"GRUB_CMDLINE_LINUX_DEFAULT="text"GRUB_CMDLINE_LINUX=""# Uncomment to enable BadRAM filtering, modify to suit your needs# This works with Linux (no patch required) and with any kernel that obtains# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"# Uncomment to disable graphical terminal (grub-pc only)#GRUB_TERMINAL=console# The resolution used on graphical terminal# note that you can use only modes which your graphic card supports via VBE# you can see them in real GRUB with the command `vbeinfo'#GRUB_GFXMODE=640x480# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux#GRUB_DISABLE_LINUX_UUID=true# Uncomment to disable generation of recovery mode menu entries#GRUB_DISABLE_RECOVERY="true"# Uncomment to get a beep at grub start#GRUB_INIT_TUNE="480 440 1"=================== /etc/grub.d/ :drwxr-xr-x 2 root root 4096 Aug 18 2012 grub.dinsgesamt 56-rwxr-xr-x 1 root root 6730 Mär 6 19:28 00_header-rwxr-xr-x 1 root root 5522 Mai 17 2012 05_debian_theme-rwxr-xr-x 1 root root 7407 Mai 17 2012 10_linux-rwxr-xr-x 1 root root 6335 Mai 17 2012 20_linux_xen-rwxr-xr-x 1 root root 1588 Nov 27 2011 20_memtest86+-rwxr-xr-x 1 root root 7603 Mai 17 2012 30_os-prober-rwxr-xr-x 1 root root 214 Mai 17 2012 40_custom-rwxr-xr-x 1 root root 95 Mai 17 2012 41_custom-rw-r--r-- 1 root root 483 Mai 17 2012 README=================== UEFI/Legacy mode:This installed-session is not EFI-compatible.SecureBoot disabled.=================== PARTITIONS & DISKS:sda1 : sda, not-sepboot, grubenv-ok grub2, grub-pc , update-grub, 32, with-boot, is-os, not--efi--part, fstab-without-boot, fstab-without-efi, no-nt, no-winload, no-recov-nor-hid, no-bmgr, notwinboot, apt-get, grub-install, with--usr, fstab-without-usr, not-sep-usr, standard, farbios, .sda : not-GPT, BIOSboot-not-needed, has-no-EFIpart, not-usb, has-os, 2048 sectors * 512 bytes=================== parted -l:Model: ATA INTEL SSDSC2CW12 (scsi)Disk /dev/sda: 120GBSector size (logical/physical): 512B/512BPartition Table: msdosNumber Start End Size Type File system Flags1 1049kB 116GB 116GB primary ext4 boot2 116GB 120GB 4168MB extended5 116GB 120GB 4168MB logical linux-swap(v1)=================== parted -lm:BYT;/dev/sda:120GB:scsi:512:512:msdos:ATA INTEL SSDSC2CW12;1:1049kB:116GB:116GB:ext4::boot;2:116GB :120GB:4168MB:::;5:116GB:120GB:4168MB:linux-swap(v1)::;=================== mount:/dev/sda1 on / type ext4 (rw,errors=remount-ro)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)gvfs-fuse-daemon on /home/roos/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=roos)=================== ls:/sys/block/sda (filtered): alignment_offset bdi capability dev device discard_alignment events events_async events_poll_msecs ext_range holders inflight power queue range removable ro sda1 sda2 sda5 size slaves stat subsystem trace uevent/dev (filtered): agpgart autofs blackmagic blackmagic0 block bsg btrfs-control bus char console core cpu cpu_dma_latency disk dri ecryptfs fb0 fd full fuse hidraw0 hidraw1 hidraw2 hidraw3 hidraw4 hidraw5 hidraw6 hpet input kmsg libmtp-2-1.1 log mapper mcelog mei mem net network_latency network_throughput null oldmem port ppp psaux ptmx pts random rfkill rtc rtc0 sda sda1 sda2 sda5 serial sg0 shm snapshot snd stderr stdin stdout uinput urandom usb usbmon0 usbmon1 usbmon2 usbmon3 usbmon4 vga_arbiter watchdog zerols /dev/mapper: control=================== df -Th:Filesystem Type Size Used Avail Use% Mounted on/dev/sda1 ext4 107G 31G 71G 31% /udev devtmpfs 3.9G 12K 3.9G 1% /devtmpfs tmpfs 1.6G 892K 1.6G 1% /runnone tmpfs 5.0M 12K 5.0M 1% /run/locknone tmpfs 3.9G 124K 3.9G 1% /run/shm=================== fdisk -l:Disk /dev/sda: 120.0 GB, 120034123776 bytes255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0002d292Device Boot Start End Blocks Id System/dev/sda1 * 2048 226297855 113147904 83 Linux/dev/sda2 226299902 234440703 4070401 5 Extended/dev/sda5 226299904 234440703 4070400 82 Linux swap / Solaris=================== Recommended repairRecommended-RepairThis setting will reinstall the grub2 of sda1 into the MBR of sda.Additional repair will be performed: unhide-bootmenu-10sUnhide GRUB boot menu in sda1/etc/default/grubgrub-install (GRUB) 1.99-21ubuntu3.1,grub-install (GRUB) 1.Reinstall the GRUB of sda1 into the MBR of sdagrub-install /dev/sda: Installation finished. No error reported.exit code of grub-install /dev/sda:0update-grubGenerating grub.cfg ...Found linux image: /boot/vmlinuz-3.2.0-30-generic-paeFound initrd image: /boot/initrd.img-3.2.0-30-generic-paeFound linux image: /boot/vmlinuz-3.2.0-29-generic-paeFound initrd image: /boot/initrd.img-3.2.0-29-generic-paeFound memtest86+ image: /boot/memtest86+.binUnhide GRUB boot menu in sda1/boot/grub/grub.cfgBootsektor wurde erfolgreich repariert.Sie können Ihren Rechner nun neu starten. Die Startdateien für [Das aktuell benutzte Betriebssystem - Ubuntu 12.04.1 LTS] liegen weit hinten auf der Festplatte. Ihr BIOS könnte sie nicht erkennen. Bitte legen Sie eine Partition vom Typ /boot an und versuchen es ggf. erneut. (EXT4, >200MB, Anfang des Datenträgers). Dies könnte mit einem Tool wie gParted geschehen. Danach wählen Sie diese Partition über Option [Separate /boot-Partition:] von [Boot-Reparatur]. (https://help.ubuntu.com/community/BootPartition)

----- my translation of the last german messages -----
Boot sector was successfully repaired
You can now restart the computer

the boot script for [your current operation system - ubuntu 12.04.1 LTS] lies way back on your hard drive. Your BIOS could not recognize it. Please create a partition of type "/boot" and try again. (EXT4, >200MB, Begin of hard drive). You can do that using a tool like gParted. Choose this partition via Option [Seperate /boot-Partition:] in Boot-Repair.



Is it possible that my boot partition is corrupt (is there a way to find this out)? And why does it sometimes work and sometimes not? Any other suspicious things you can spot in this log-file?

Thank you for your help in advance!

[EDIT]
Maybe a little bit more background information:
My system used to work flawlessly in this regard. But last friday I did a backup of my entire harddrive using "dd" to copy it onto my external harddrive. I did this via a Live Kubuntu usb drive from which I booted and from which I started the "dd" copy process. Saturday evening (the first time I started my computer again after the backup) I ran into this problem.

I have no idea what could have caused my problem in by using live kubuntu and dd. Maybe this is just a coincidence but I'd rather mention than not.

darkod
June 10th, 2013, 09:58 AM
Some BIOSes have a limitation that they can not see boot files beyond 137GB on the disk. You seem to be affected by this.

With hrd disks these days being much bigger than 137GB, if the boot files randomly end up beyond this point, the BIOS will not be able to load them. In this case, you have to have a small 1GB /boot partition at the front of the disk. That way you make sure the boot files are always at front, because they are always saved in /boot.

Making the 1GB /boot at front might be complicated right now. You would have to shrink the filesystem and the first partition to make 1GB space at front. Working from live mode, create ext4 partition from this space, copy the content of the boot folder from the root partition on this new partition, then rename that boot folder so that it doesn't clash. Then modify the fstab to mount the new partition as /boot.

After that you will have to reinstall grub2 because it needs to "find" the new location of the boot files.

That should be it.

HaasEffect
June 10th, 2013, 10:08 AM
Hello Darkod,

thanks for the hint. I'm using a SSD harddrive wich has max volume of 120gb. So in theory it's impossible for the boot script to be located beyond 137gb. It's also strange that it sometimes work and sometimes not. Should I go for it anyway and introduce a new boot partition?

darkod
June 10th, 2013, 10:23 AM
No, in that case no. 120GB is too small to be a problem. There is another issue. Can you post the full bootinfo report or link? You can use the boot-repair program to create a link and post the link only. The formatting is better for reading that way too.
https://help.ubuntu.com/community/Boot-Repair

That message from boot-repair about BIOS not being able to see the files away is not correct then.

HaasEffect
June 10th, 2013, 10:25 AM
I added the boot repair link to my original post.

oldfred
June 10th, 2013, 05:32 PM
The BIOS limit is 137GB as Darko reports, but that is more for old BIOS. For whatever reason we see the same thing primarily with installs to external USB drives with any partition over 100GB. But your current list of where boot files are on drive all are inside the 100GB limit.

I always believed but never could prove that it is really a BIOS issue (some vendors) and more with IDE setting in BIOS. IDE is the old BIOS that may have the 137GB limit also and is for old drives.
So what mode do you have drive set in BIOS? it should be AHCI if an SSD as that is required for trim to work. Second choice is large or LBA for large block allocation which replaced IDE.

Since problem seemed more wide spread, Boot-Repair added it as a standard comment whenever it sees a / (root) partition over 100GB whether it really applies or not. Most of the time it is with those with a new 500GB drive or larger and just a / (root) partition. I normally suggest separate /home or even better separate data partitions. With my 60GB SSD, I made two 30GB / partitions, one for current working install and one for next or test install. All my data is then on a rotating hard drive.

History of BIOS and IDE limits
http://tldp.org/HOWTO/Large-Disk-HOWTO-4.html
Out of disk error add to grub install disk-module=ata or use Boot-Repair ATA Disk support
HOWTO: dualboot on big disk (BIOS limitations)
https://help.ubuntu.com/community/InstallingUbuntuOnBigDisk
http://ubuntuforums.org/showthread.php?t=1998257
Large external drive still needed /boot at beginning:
http://ubuntuforums.org/showthread.php?t=1888497