Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub starts but only get prompt [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 324
Location: Belgium

PostPosted: Mon May 20, 2013 10:59 am    Post subject: grub starts but only get prompt [solved] Reply with quote

I re-installed Gentoo on my laptop after replacing the 16GB SSD by a larger one. Also changed the partitioning so that now the SSD would be the OS disk instead of the (very) slow HD.

The SSD is detected as /dev/sdb and the HD as /dev/sda when going through the installation. Used parted for defining the partitions and set following map:

sdb1 -> ext2 used as /boot
sdb2 -> xfs used as /
sda1 -> swap
sda2 -> xfs used as /root
sda3 -> xfs used as /home
sda4 -> xfs used as /var

Followed the handbook and ran "grub-install --no-floppy /dev/sdb" The result of that is

Code:

Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script 'grub-install'

(fd0)   /dev/fd0
(hd0)  /dev/sda
(hd1)  /dev/sdb
(hd2)  /dev/sdc


Apart from still insisting on a floppy this looks correct to me. I take it that /dev/sdc is the install dvd.

Fsab looks like this:
Code:

/dev/sdb1       /boot          ext2        noauto,noatime     1 2
/dev/sdb2       /                xfs          noatime                0 1
/dev/sda1       none          swap       sw                        0 0
/dev/sda2       /root          xfs          noatime                 0 0
/dev/sda3       /home        xfs          noatime                0 0
/dev/sda4       /var           xfs          noatime                0 0
/dev/cdrom    /mnt/cdrom auto        noauto,ro              0 0
#/dev/fd0      /mnt/floppy auto         noauto


In grub.conf I put the following:
Code:

title Gentoo hd0
root (hd0,0)
kernel kernel_3.8 root=/dev/sdb2

title Gentoo hd1
root (hd1,0)
kernel kernel_3.8 root=/dev/sdb2

title Gentoo hd2
root (hd2,0)
kernel kernel_3.8 root=/dev/sdb2


Now if I reboot the laptop I'm dumped in the grub prompt. Now if I'm seeing the grub prompt, then at least I can be sure that grub is correctly installed and it is booting from the SSD /dev/sdb. Correct? But if I'm not seeing the content of grub.conf then what is wrong?
_________________
Expert in non-working solutions


Last edited by Spanik on Tue May 21, 2013 6:28 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31716
Location: 56N 3W

PostPosted: Mon May 20, 2013 4:41 pm    Post subject: Reply with quote

Spanik,

Check your /boot for a symlink that shows
Code:
/boot -> .
and in /boot/grub/ a symlink that shows as
Code:
menu.lst -> grub.conf

That menu.lst is menu.<Lower case letter L>st, short for list, not numeral 1.

-- edit --
Your device.map is a bit worrying. hd(x) does not include optical media, so that it lists three drives means you had three HDD/USB storage devices connected when that device map was written. If all three are not there now, you may have removed /dev/sda, grub won't like that at all.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 324
Location: Belgium

PostPosted: Mon May 20, 2013 6:24 pm    Post subject: Reply with quote

Ok:

Code:
cd /boot
ls -l
total 5569
lrwxrwxrwx 1 root root           1 May 16 22:31 boot -> .
drwxr-xr-x  2 root root     2014 May 20 10:29 grub
-rw-r--r--    1 root root   5665600 May 16 22:07 kernel_3.8
drwx------   2 root root     12288 May 16 18:23 lost+found


So the first is covered I think.

Code:
cd grub
ls -l
...
lrwxrwxrwx 1 root root    9 May 16 22:21 menu.lst -> grub.conf
...


So I guess that is also ok.

I don't have anything else connected except an usb mouse. There are no usb sticks, no sd card either. Only the minimal dvd in the dvdreader and ethernet plugged in. So I have no idea why it would have found a third device.

It starts grub and /dev/sdb is the only one set as bootable from what I see with parted. "parted /dev/sdc" doesn't work as I get "Error: Could not stat device /dev/sdc - No such file or directory.".

The SSD is an mSata device that I didn't know was there when I bought it. As it was only 16GB I installed Gentoo on the HD and managed to get it working. But as the HD is something very slow I replaced the mSata with a 128GB SSD. I reused the makefile and .config (using "make oldconfig"). In meantime it was gone from 3.0.6 to 3.8 but I don't think that would be an issue.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31716
Location: 56N 3W

PostPosted: Mon May 20, 2013 6:47 pm    Post subject: Reply with quote

Spanik,

It looks like grub is loading from somewhere. If its really the grub prompt, typing
Code:
kernel (hd1,0)kernel_3.8 root=/dev/sdb2
should get you going or an informative error message.

The bootable flag is used only by brain dead BIOSs, that refuse to boot from a drive if its not set somewhere and by Windows.
Its ignored by Linux.

Is it possible that you have grub on both drives and the BIOS is loading grub from the wrong drive?
That would cause the expected /boot/grub to be missing.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 324
Location: Belgium

PostPosted: Mon May 20, 2013 7:15 pm    Post subject: Reply with quote

I tried your command and some variations in case the hard discs are mounted differently during boot than when running (had that on the desktop):

Code:

grub> kernel (hd1,0)kernel_3.8 root=/dev/sdb2

Error 1: Filename must be either an absolute path or blocklist

grub> kernel (hd0,0)kernel_3.8 root=/dev/sdb2

Error 1: Filename must be either an absolute path or blocklist

grub> kernel (hd1,0) kernel_3.8 root=/dev/sdb2

Error 1: Filename must be either an absolute path or blocklist

grub> kernel (hd1,0)/kernel_3.8 root=/dev/sdb2
      [Linux-bzImage, setup=0x3c00, size=0x563540]

grub> kernel (hd0,0)/kernel_3.8 root=/dev/sdb2

Error 17: Cannot mount selected partition

grub>


It is a Lenovo... so brain dead might apply.


Quote:
Is it possible that you have grub on both drives and the BIOS is loading grub from the wrong drive?


Could be as the HD was bootable before. I wiped it and replaced the partitiontable but that would leave the MBR (with grub) I guess. Is there a safe way to wipe the MBR of the second disc?

Other thing, is it possible in the grub prompt to get a list of the found hd's and something like their size or so? That way I could identify them and at least have a reasoned guess of their position in the list.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 31716
Location: 56N 3W

PostPosted: Mon May 20, 2013 7:42 pm    Post subject: Reply with quote

Spanik,

So, you are talking to grub ... good.

I missed a / out of my command.
Code:
kernel (hd1,0)/kernel_3.8 root=/dev/sdb2

The path is now a partition in grubspeak, followed by a path element separator, "/" and a file name.

Sorry about that.

If you type
Code:
kernel (hd
then press tab, grub should list the drives it can see.
Choose one and get to
Code:
kernel (hd0,
and press tab, then it will list the partitions on the drive, (in this case, drive 0).
I think the same thing works with filenames too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Spanik
Guru
Guru


Joined: 12 Dec 2003
Posts: 324
Location: Belgium

PostPosted: Tue May 21, 2013 6:27 pm    Post subject: Reply with quote

I tried using the tab-complete to get an idea what it sees.

- hd0 is indeed /dev/sda with the 5 partitions recognised. It sees the correct filesystems only the swap is listed as "filesystem type unknown"
- hd0 is /dev/sdb with the 2 partitions and correctly recognised filesystems. If I tab-complete the filename, then it finds the kernel_3.8, the one I want to boot.

result however is:
Code:
grub> kernel (hd1,0)/kernel_3.8 root=/dev/sdb2
[Linux-bzImage, setup=0x3c00, size=0x563540]

grub>


So it looks as if everything is there but it doesn't want to start it.

While trying and typing this I tought of taking a look in the BIOS. Made sure UEFI is off etc. But when I came to the boot order I found the list as follows:
1 hdd0 -> my normal hd
2 cdrom
3 hdd1 -> not assigned to anything
4 hdd2 -> SSD
5 network

This is probably the answer why grub-install lists 3 devices. So I just put the SSD at the top followed by the cdrom and then the hd. Guess what: the bloody thing boots straight into the grub list and then continues straight to the terminal. So like you said it is a brain-dead BIOS!

Thanks to all for the help, I learned again some things.

For the record this is a Lenovo Thinkpad Edge E530.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum