LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 10-26-2013, 04:11 AM   #1
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Rep: Reputation: Disabled
Unhappy Error: attempt to read or write outside of disk 'hd0'


Hi there, can you help?

I installed an update on by laptop last night and it asked me to restart so that the update could take place. On doing so I got the above message and the prompt "grub rescue>".

Ubuntu was installed on the laptop by a friend of my son when he was visiting us in Wales after our Windows drive crashed. I have absolutely no idea what he did and it is enough for me to turn the machine on everyday. What I am getting at is that unless the help comes in the form of "type this prompt" and then the prompt rather than assuming I know any programming language (which of course I don't) I will not have a clue. Sorry to be so pathetic. Can anyone help?
 
Old 10-26-2013, 04:52 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,298

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Windows probably did a 'fdisk c: /mbr' on the disk, overwriting the master boot record

/cure
Provoke grub into reinstalling the mbr. I hesitate to be dogmatic but I think it's
grub setup (hd0)
where (hd0) is your disk location in grub speak. If not, info grub.

/prevention
The above is a Royal PITA. For these cases, I am inclined to run
dd if=/dev/sda of=/boot/sdambr bs=512 count=1
dd if=/dev/sda1 of=/boot/sdambr1 bs=512 count=1

and have these undocumented backups lying there ready for the next time windows pulls that stunt.
 
Old 10-26-2013, 05:02 AM   #3
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks businesskid you do realise of course I have no idea what you are referring to. I know absolutely no programming language so what you have said is gobbledygook.
What do I need to type in?

I typed in /cure, /prevention and the message is 'Unknown command'
I typed in both "dd if=/dev/sda etc" and they came back as Unknown commaand 'dd' and Unknown command 'if=/dev/sda'
I'm obviously missing something if what you said should work. Any clues?

Last edited by Penpusher; 10-26-2013 at 05:15 AM. Reason: Updated information
 
Old 10-26-2013, 09:19 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,514

Rep: Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492
Boot your Ubuntu CD, wait until you are connected to the internet, go to the website at the link below and review the page. Open a terminal windows on your computer by holding down the Ctrl+Alt+t keys simultaneously. On the site below, go to the section 2nd Option and copy and paste the first line beginning with 'sudo' (grey box) in your terminal and hit the Enter key. After that completes, repeat the process for the second line. When that completes, scroll down to using Boot-Repair at the site below and follow the instructions. This will download and install the Boot-Repair software and you should be able to repair your bootloader. If this fails, make not of any messages you see on screen and post back.

https://help.ubuntu.com/community/Boot-Repair
 
Old 10-26-2013, 10:12 AM   #5
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks yancek. One problem though I don't have a copy of the Ubuntu CD my son's friend downloaded an on-line copy (my bad?). Is there anything I can do from the prompt "grub rescue>". Incidentally, in layman's terms what is grub?
 
Old 10-26-2013, 10:29 AM   #6
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Original Poster
Rep: Reputation: Disabled
I followed your link and eventually got to someone who had the same problem. It was suggested to them that they type "ls /" which I did and this is what I got:
Quote:
Originally Posted by Penpusher View Post
./ ../ lost+found/ etc/ media/ var/ bin/ boot/ dev/ home/ lib/ mnt/ opt/ proc/ root/ run/ sbin/ selinux/ srv/ sys/ tmp/ usr/ initrd.img initrd.img.old vmlinuz cdrom/ vmlinuz.old
grub rescue>
I don't understand what any of it means though but I'm posting it in case it offers any clue to the problem.

Last edited by Penpusher; 10-26-2013 at 10:32 AM. Reason: Updating post
 
Old 10-26-2013, 12:43 PM   #7
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Do you now have a working Live CD?
 
Old 10-26-2013, 11:44 PM   #8
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,514

Rep: Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492
Quote:
Incidentally, in layman's terms what is grub?
GRand Unified Bootloader. A bootloader is needed and used by all operating systems to start the system.

You obviously have access to a computer. You could download and burn Ubuntu to a CD and boot it.
 
Old 10-27-2013, 07:13 AM   #9
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Original Poster
Rep: Reputation: Disabled
Yes I do have a CD, I've tried loading it in but I get the same message
 
Old 10-27-2013, 10:07 AM   #10
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,514

Rep: Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492
Quote:
Yes I do have a CD, I've tried loading it in but I get the same message
You would have to change the boot priority in the BIOS to boot first from the CD drive if you are still getting the Grub prompt. When you boot the computer, you should see a message at the bottom of the screen for 3-5 seconds indicating which key you need to press to enter setup or the BIOS. When you do that, you should see a screen with several options and one should be Boot. Use the arrow keys on your keyboard to highlight boot, hit the enter key and your should see more options. The key varies, depending upon who the manufacturer of the system is.
 
Old 10-27-2013, 11:34 AM   #11
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,298

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Sorry, I didn't lay my answer out very well. Let me try again. If you think you want to, try the suggested commands in boxes. The /cure and /prevention were for you, not for the pc :-/.

/cure
Provoke grub into reinstalling the mbr. I hesitate to be dogmatic but I think it's
Quote:
grub setup (hd0)
where (hd0) is your disk location in grub speak. If not, read the info grub page.
Quote:
info grub
/prevention
The above is a Royal PITA. For these cases, once things are right, I am inclined to run
Quote:
dd if=/dev/sda of=/boot/sdambr bs=512 count=1
dd if=/dev/sda1 of=/boot/sdambr1 bs=512 count=1
These commands back up your master boot record(sdambr) and the first partition (sdambr1).
Keep these undocumented backups lying there ready for the next time windows pulls that stunt.
 
Old 10-28-2013, 05:47 AM   #12
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks again businesskid. I typed in "grub setup (hd0)" as suggested and it came back as Unknown command 'grub'. The other command came back as Unknown command 'info'. :-(
 
Old 10-28-2013, 06:01 AM   #13
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Original Poster
Rep: Reputation: Disabled
Yancek, first the good news! I booted the Ubuntu CD and when it asked whether I wanted to "Try" or "Install" Ubuntu I went for "Try" as I had some files on the PC and I didn't want to lose them. Next the bad news, I checked the files I had and they have all gone. Is there anyway I can recover them? If not is there anyway I can prevent this from happening again otherwise the PC is useless if I can't rely on the machine to keep safe files from one day to the next? I fee like it's 1 step forward and 2 back, urrgggh!
 
Old 10-28-2013, 09:36 AM   #14
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,514

Rep: Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492Reputation: 2492
I'm not really sure what you did. If you booted the Ubuntu CD and created files on it and rebooted, they will be gone as the Live CD is read-only. Nothing is saved on reboot. If you are referring to files/directories you had on the computer with the installed Ubuntu previously, that is another matter.

Boot the Ubuntu CD, open a terminal by holding down the Ctrl+Alt+t keys simultaneously. Type in: sudo fdisk -l(Lower Case Letter L in the command) and post the output here. That should provide information on your drives/partitions so if you still have partitions on the drive they will show any someone will then be able to explain how you can mount the filesystems to access the data.
 
Old 10-28-2013, 10:13 AM   #15
Penpusher
LQ Newbie
 
Registered: Oct 2013
Location: Wales
Posts: 8

Original Poster
Rep: Reputation: Disabled
Yes Yancek I had already had Ubuntu before and it was on this that I had the files. As regards the CD when I turned on the machine I pressed F12 which took me to the Boot Option Menu. Of the 3 options 1) IDE 0: WDC WD3200BEVT-22ZCT0, 2) IDE 1: Slimtype DVD A DS8A4SH and 3) Network Boot: Atheros Boot Agent I chose option 2, simply because it said DVD and I didn't know what the others stood for.

After a few minutes the Ubuntu "Welcome" screen came up. As I said before rather than re-installing Ubuntu I pressed "Try Ubuntu".

When the main screen came up I typed the command you suggested and got this prompt: ubuntu@ubuntu:~$
I then typed in the command and got:
Quote:
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0007e3e6

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 616896511 308447232 83 Linux
/dev/sda2 616898558 625141759 4121601 5 Extended
/dev/sda5 616898560 625141759 4121600 82 Linux swap / Solaris
Obviously this means nothing to me so I need to ask.
Should I be re-installing ubuntu rather than pressing "Try"
If I do install will I see the files on my original copy.
I'm assuming not as I'm sure it will over-right the lot so...
If I can't get the files back will re-installing the disk mean that I don't have to keep going through the same rigmarole to start up.

Sorry to take up so much of your time. I just didn't realise it would be so complicated.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error: attempt to read or write outside of disk `hd0' blackholes Linux - Newbie 2 07-10-2013 11:00 PM
error: hd0 out of disk. (???) oznola Linux - General 7 06-27-2012 09:00 AM
Ubunutu 11.10 grub2 can boot but error hd0 no disk from bootable usb config help craig6398 Linux - Newbie 1 02-06-2012 05:10 AM
Raid disk problem : Attempt to read block from filesystem resulted in short read ElmPie Linux - General 5 08-26-2008 05:21 AM
remount USB Disk Read Write poetfreak MEPIS 1 08-30-2006 01:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 08:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration