LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2013, 08:55 PM   #1
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Rep: Reputation: Disabled
Can't boot from CD. Grub Rescue> - Initramfs - Only Linux commands will save me.


This is a doozy! I tried to partition change and crashed. I worked through grub rescue> with some Linux commands I found online, but now I'm stuck at "initramfs" prompt.

I can't boot anything from CD/DVD drive or USB. I can open BIOS, but no options there to boot from CD. I guess I screwed up the MBR?

Any Linux Wizards want a challenge?

Many Thanks!

ASUS K52F
Win7/Ubuntu
 
Old 05-11-2013, 10:40 PM   #2
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
The MBR has absolutely nothing to do with booting from a CD, DVD or a USB disk.

What is important is the BIOS configuration (computer setup). When you start your computer you should see messages saying which keys to press to get into the BIOS settings. If you see a graphical logo, try pressing the Esc key or the Tab key. Then you may see a text screen with the BIOS messages.

You may see that there is a key you can press to get a boot menu. For example on some computers you press F11 for a boot menu. Then you can choose to boot from the CD/DVD drive or the USB drive instead of the default (internal hard disk).

If you can't use a boot menu, then you will have to change the BIOS settings. Go into the BIOS settings. There is usually a way to change the boot priority (or boot order). Sometimes there is a separate menu for the disks, and a separate menu for the different types of devices, CD, hard disk, network, etc. You need to make sure that the CD/DVD drives appear before the hard disks, and that the required drives are enabled for booting. To boot a USB hard disk you have put it before the normal internal hard disk in the boot order. You have to connect the USB (or other external disk) before going into the BIOS setup or it may not appear in the settings.

Once you can boot from the installation disk for your Linux operating system then you can see if your hard disk has valid information (partitions, file-systems and files). First, start a shell command prompt using the root account. Then use "fdisk" or "cfdisk" to see if you have partitions on the hard disk. If you have partitions, you can use "fsck" to check that the Linux file-system is valid. If it is valid, mount the Linux partition using "mount". Then use "ls" to see what directories and files are in the Linux partition.

If the partitions and files look correct, it's possible that you only need to install or re-install your boot loader. If the Linux kernel or initrd file is not correct, you will have to install Linux or copy the correct files onto the hard disk.

Most Linux distributions (distros) install a boot loader to the Master Boot Record (Partition Table sector) of the first hard disk. That is the first sector on the hard disk. It is also possible (though unusual) to install the boot loader to a partition (in the partition's boot sector).

The boot loader's files should be in a partition on the first hard disk (usually your Linux partition). You have to make sure that the order of the hard disks does not change after installing the boot loader. Usually the order of the hard disks is the same as the boot order in the BIOS.

After the boot loader has started, it loads in the Linux kernel and possibly an initram FS (initrd) file. Where those can be located depends on the boot loader and whether the computer uses a BIOS or UEFI/EFI firmware. The boot loader also tells the Kernel the location of the root file-system (that it gets from the boot menu or boot configuration). You may be able to override or change the file locations or root file-system location when the boot loader's menu is displayed.

If you want more specific help, please post some additional information about your system.
  • What Linux distribution are you using, and what is the version?
  • What boot loader are you using (GRUB 2, LILO, GRUB Legacy)?
  • Does your computer use UEFI or EFI (you will probably see a message mentioning that)?
  • What is the manufacturer and model of your computer (or motherboard)?
  • What hard disks and CD/DVD drives are connected?
  • How is your internal hard disk partitioned, or how do you want to partition it?
  • Is there anything already on the internal hard disk that you care about losing?
  • Do you have any other operating systems installed, or are you planning to install others?
  • Exactly what error message do you see, and what are the messages leading up to the problem?
  • What did you try to correct the problem and what happened as a result?

When a computer with a BIOS boots from the hard disk it goes through these steps.
  1. Computer resets and goes through BIOS Power On Self Test (POST)
  2. BIOS tries to boot first boot device (usually first hard disk)
  3. BIOS reads the Master Boot Record from the first hard disk
  4. If a boot loader is installed to the MBR, start loading the boot loader
  5. If no boot loader installed to MBR, find the first primary partition marked for "Boot"
  6. If a partition is marked for "Boot" load in the boot (first) sector of the partition
  7. At this point a boot loader has started up and usually displays a boot menu (or prompt)
  8. The boot loader loads in the Linux kernel file, EX: /boot/vmlinuz
  9. If requested, the boot loader loads in the initrd (initram FS) file, EX: /boot/initrd.gz
  10. The Linux kernel starts up (boot loader tells it the root device name and initram FS location)
  11. At this point you may get errors if the initram FS information or the root device name is incorrect
  12. The kernel mounts the initram FS (that is in memory) if it was specified
  13. The initram FS runs programs to mount the Linux root device, or the kernel mounts the Linux root device
  14. After the Linux root device is mounted, the "init" program runs and Linux starts up

If you happen to have UEFI (or EFI) then the start up is a little bit different.
  1. Computer resets and goes through UEFI firmware initialization
  2. UEFI firmware looks at its boot configuration to locate the boot loader.
    The boot loader is usually located in the EFI System Partition on the first hard disk
  3. UEFI firmware loads and starts the boot loader
  4. At this point a boot loader has started up and usually displays a boot menu (or prompt)
  5. The remainder of the steps are the same as for a BIOS (step 8)

UEFI does not use a Master Boot Record or boot sectors (in partitions). Boot loaders have to be added to the firmware's configuration (NVRAM variables) or be in a default location. The default location for the boot loader is the EFI System Partition on the first hard disk, in the "/EFI/BOOT" directory. Boot loaders are usually installed under the "/EFI" directory in the EFI System Partition on the first hard disk.
 
Old 05-11-2013, 11:07 PM   #3
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Erik:

Thank you so very much for all that information. I'll have to go through all of it point-by-point. When I get finished I'll post all information and the status. Very cool of you to take the time for such an in-depth response. I need a few hours sleep and I'll be on it tomorrow.

Thanks again for all your time!

Willie
 
Old 05-12-2013, 11:07 AM   #4
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Hi Erik!

I hope you're still available and willing to help me get through this disaster. Again, many thanks.

I think my problem is that I can't boot from CD. I have “Boot Repair Disk”, a grub boot disk, a Fedora 15 install disk and a Windows 7 Home Premium SP1 disk from a different computer. I was going to try the Boot Repair Disk first, but just can't get the thing to boot.

When I hit the F2 on the ASUS K52F, the BIOS opens (Aptio Setup Utility, American Megatrends). My available tabs are: Main – Advanced – Boot – Security – Save & Exit.
At the Boot tab I get this Default Boot Configuration list: (I selected the Default settings at one point)

UEFI Boot Disabled
PXE ROM Disabled

(Boot Option Priorities)

Boot Option #1 [PO: ST9500325AS..............]
Boot Option #2 [P1: HL-DT-STDVDRAM...]

Hard Drive BBS Priorities
CD/DVD ROM Drive BBS Priorities
Delete Boot Option

Under the Advanced Tab

Start Easy Flash
ASUS FanceStart [Disabled]
POST Logo Type [Static]
Play POST Sound [No]
Internal Pointing Device [Enabled]

Intel Virtualization Technology [Enabled]
VT-d [Enabled]
Legacy USB Support [Enabled]
SATA Configuration

Under the Security Tab: (I was afraid to attempt putting in a Password, read it could be problems) COULD THIS be the problem?

Password Description

If ONLY the Administrator's password is set, then this only limits access to Setup and is only asked for when entering Setup.
If ONLY the User's password is set, then this is a power on password and must be entered to boot or enter Setup. In Setup, the User will have Administrator rights.

Administrator Password Status NOT INSTALLED
User Password Status NOT INSTALLED

Setup Administrator Password
Setup User Password

I/O Interface Security

HDD Security Configuration:
HDD 0:ST9500325AS

Here are the answers to the additional info you asked for:

What Linux distribution are you using, and what is the version?
Ubuntu 12 (.04 or .10, not sure)
What boot loader are you using (GRUB 2, LILO, GRUB Legacy)?
Unknown
Does your computer use UEFI or EFI (you will probably see a message mentioning that)?
UEFI is listed in Boot options
What is the manufacturer and model of your computer (or motherboard)?
ASUS K52F
What hard disks and CD/DVD drives are connected?
500 GB Internal; CD/DVD internal
How is your internal hard disk partitioned, or how do you want to partition it?
One hard drive partitioned to C and D drives with 2 smaller partitions when Ubunto installed
Is there anything already on the internal hard disk that you care about losing?
Yes BUT... this is an emergency situation. I can live with total format
Do you have any other operating systems installed, or are you planning to install others?
The original Win7 Home Premium and Ubuntu are/were installed
Exactly what error message do you see, and what are the messages leading up to the problem?
It started when I tried to move some disk space from D to C drive. I used a free utility to do it and at some point it said to reboot. When I did, I got the grub rescue> prompt.
What did you try to correct the problem and what happened as a result?
I tried Linux commands I found on the 'net at the grub rescue prompt. I eventually got the initramfs prompt, but could find nothing to complete the process of repair.
 
Old 05-12-2013, 11:29 AM   #5
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

Do you get to the grub prompt. If so what have you tried how far did you get?
 
Old 05-12-2013, 11:53 AM   #6
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
Hi

Do you get to the grub prompt. If so what have you tried how far did you get?
Thanks for your reply.

Yes, I only get the "error: unknown filesystem - grub rescue>" prompt when I boot up. From there I found information about the grub prompt. I used linux commands to change Hard Drive settings, and followed that all the way until I got a prompt that says: "initramfs".

That is where I got stuck... I couldn't find any usable commands for initramfs to solve the problem. I then tried to use a repair disk... "Boot Repair Disk", and discovered problems booting from CD\DVD (or USB).

I believe this problem could be solved with Linux commands or with booting a repair disk from BIOS. My problem is I can't boot from CD/DVD.

I hope this thread helps other people with this problem. There are a LOT of grub rescue problems out there.
 
Old 05-12-2013, 12:14 PM   #7
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Hi

when I boot from grub prompt
after the line vmlinuz root=/dev/sdx ro
I put initrd /boot/ then if you use the "tab key" it will show the initrd.img-3.8.0-18-generic Put that in after /boot/. Then press "enter"
Then type boot
 
Old 05-12-2013, 01:10 PM   #8
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,137

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
As for booting from CD/DVD:

Code:
(Boot Option Priorities)

Boot Option #1 [PO: ST9500325AS..............]
Boot Option #2 [P1: HL-DT-STDVDRAM...]
ST9500325AS - starting with ST means it is a Seagate hard disk
HL-DT-STDVDRAM - this is your DVD drive

If the BIOS finds grub in the MBR it will try to boot from the hard drive first. If you need to boot from DVD you need to put that choice as #1 and the hard drive as #2. Depending on how badly your BIOS is written, you may have to delete the old ones to add new ones. If your BIOS is even worse, you may have to take the hard drive out of the list.

Note: The first rule of fixing a disk problem is to sit on your hands until you are sure you are doing the right thing.

Last edited by smallpond; 05-12-2013 at 01:12 PM. Reason: add note
 
Old 05-12-2013, 01:47 PM   #9
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Quote:
Originally Posted by Wet Willie View Post
UEFI Boot Disabled
PXE ROM Disabled

(Boot Option Priorities)

Boot Option #1 [PO: ST9500325AS..............]
Boot Option #2 [P1: HL-DT-STDVDRAM...]

Hard Drive BBS Priorities
CD/DVD ROM Drive BBS Priorities
Delete Boot Option
The above information from your BIOS settings shows that the hard disk "ST9500325AS" will be booted before the DVD drive "HL-DT-STDVDRAM". In order to boot from a DVD or CD you will have to change the BIOS settings and make the "HL-DT-STDVDRAM" the first boot option.

You have firmware that supports UEFI or BIOS booting. UEFI booting is disabled. That is OK because your disk is small enough that you can use a Master Boot Record partition table and BIOS booting.

Quote:
Originally Posted by Wet Willie View Post
Under the Security Tab: (I was afraid to attempt putting in a Password, read it could be problems) COULD THIS be the problem?
It is OK to have no BIOS password for setup or booting. That just allows anyone to change the computer settings or start up an operating system without a password.

When you changed the partition sizes it also changed the position of files on the disk. In order for grub to work, the grub program file "core.img" and grub boot sector cannot be moved after grub is installed. So, you will need to install grub again.

To install grub, change your computer settings to boot from the DVD drive first, before the hard disk. Boot from a Ubuntu live-CD or live-USB.

Follow the instructions for "2nd option : install Boot-Repair in Ubuntu" on this web page.
Ubuntu Help Wiki - Boot-Repair

You may need to use the option to "repair file systems".

If you are able to get Linux to boot, but not Windows, then you also may need to repair Windows using the Windows setup DVD. After repairing Windows, don't be surprised if you no long have grub. You may need to install grub again after repairing Windows.
 
Old 05-12-2013, 01:49 PM   #10
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
As for booting from CD/DVD:

Code:
(Boot Option Priorities)

Boot Option #1 [PO: ST9500325AS..............]
Boot Option #2 [P1: HL-DT-STDVDRAM...]
ST9500325AS - starting with ST means it is a Seagate hard disk
HL-DT-STDVDRAM - this is your DVD drive

If the BIOS finds grub in the MBR it will try to boot from the hard drive first. If you need to boot from DVD you need to put that choice as #1 and the hard drive as #2. Depending on how badly your BIOS is written, you may have to delete the old ones to add new ones. If your BIOS is even worse, you may have to take the hard drive out of the list.

Note: The first rule of fixing a disk problem is to sit on your hands until you are sure you are doing the right thing.
Thanks smallpond. I just went through the linux commands suggested above by spiky. A lot of info loaded on the screen which I can't make any sense of. It's been 45 minutes and nothing has happened. Not sure if it's repairing/reinstalling or what (?) --

I will try to switch to the DVD drive and reboot after I wait this out a while and see if anything happens. Thanks again.
 
Old 05-12-2013, 01:55 PM   #11
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Wet Willie View Post
Thanks smallpond. I just went through the linux commands suggested above by spiky. A lot of info loaded on the screen which I can't make any sense of. It's been 45 minutes and nothing has happened. Not sure if it's repairing/reinstalling or what (?) --

I will try to switch to the DVD drive and reboot after I wait this out a while and see if anything happens. Thanks again.
Thanks Erik! I've got several more things to try now. Right now part of the screen says "Loading, please wait", but it's been 45 minutes without change. I do hear a faint hum... don't know if it's repairing/loading or if it's just the fan. I'll wait this out a while before trying anything else. Appreciate your help -----
 
Old 05-12-2013, 01:58 PM   #12
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Erik_FL View Post
The above information from your BIOS settings shows that the hard disk "ST9500325AS" will be booted before the DVD drive "HL-DT-STDVDRAM". In order to boot from a DVD or CD you will have to change the BIOS settings and make the "HL-DT-STDVDRAM" the first boot option.

You have firmware that supports UEFI or BIOS booting. UEFI booting is disabled. That is OK because your disk is small enough that you can use a Master Boot Record partition table and BIOS booting.



It is OK to have no BIOS password for setup or booting. That just allows anyone to change the computer settings or start up an operating system without a password.

When you changed the partition sizes it also changed the position of files on the disk. In order for grub to work, the grub program file "core.img" and grub boot sector cannot be moved after grub is installed. So, you will need to install grub again.

To install grub, change your computer settings to boot from the DVD drive first, before the hard disk. Boot from a Ubuntu live-CD or live-USB.

Follow the instructions for "2nd option : install Boot-Repair in Ubuntu" on this web page.
Ubuntu Help Wiki - Boot-Repair

You may need to use the option to "repair file systems".

If you are able to get Linux to boot, but not Windows, then you also may need to repair Windows using the Windows setup DVD. After repairing Windows, don't be surprised if you no long have grub. You may need to install grub again after repairing Windows.
I replied to the wrong comment..... -->

Thanks Erik! I've got several more things to try now. Right now part of the screen says "Loading, please wait", but it's been 45 minutes without change. I do hear a faint hum... don't know if it's repairing/loading or if it's just the fan. I'll wait this out a while before trying anything else. Appreciate your help -----
 
Old 05-12-2013, 02:37 PM   #13
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Erik, smallpond and spiky:

I got the boot order changed... I ad to disable the Seagate internal HD to get anything to happen, then....
tried to boot first with "Boot Repair Disk", then with a different brand repair disk. I got the message:

"Reboot and Select proper Boot device or Insert Boot Media in selected Boot device and press a key." It looks like the CD/DVD drive isn't being recognized?

Any suggestions?
 
Old 05-12-2013, 02:43 PM   #14
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
How did you install Ubuntu
 
Old 05-12-2013, 02:58 PM   #15
Wet Willie
LQ Newbie
 
Registered: May 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spiky0011 View Post
How did you install Ubuntu
I finally got a Win7 install disk to work boot, but stopped it. It's from another computer and I was afraid MSoft wouldn't let me install it on a different computer. (?)

I'm downloading Ubuntu now on my other pc (which has Ubuntu). I've got to burn it to DVD and try it.

Question spiky:

Will I be able to save my Win7 when I re-install Ubuntu?
If Win7 disappears, can I download it from MSoft? I have the product key.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Grub Rescue - failure to boot Linux in dual drive system loftus49 Linux - General 4 08-26-2010 02:03 PM
what commands are used for : grub rescue> kiruja Linux - Newbie 1 05-11-2010 07:12 PM
grub rescue> commands are unix ? jenaniston Linux From Scratch 5 02-26-2010 06:57 AM
How to save the GRUB loader to the Linux boot partition? bettyhills Linux - Newbie 1 05-27-2008 03:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:20 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