LinuxQuestions.org
Help answer threads with 0 replies.
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 08-25-2009, 10:16 AM   #1
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Rep: Reputation: 16
locate grub


Hi all, i am reading about USB bootable and it points me to grub in tutorial is issued command:
grub
grub> find /boot/grub/stage1

but it gives me: Error 15: File not found


i do not have any problems with grub, i can choose between M$ and Linux while boot

so when i issue:
sudo fdisk -l
i see which partition is bootable (sda1)
i have multiple partitons
sda1, sda2, sda3, sda4

sda1 windows
sda2 linux
sda3 swap
sda4 ntfs

so my question: how can i know where is grub installed ?
I found on net that is in directory /boot/grub/stage1 (sda2 in my case)
but why I have bootable sda1 ?? can anyody explain that ?

another question: I found grub can be installed on a partition
Code:
grub> setup (hd0,0)
or on a MBR
Code:
grub> setup (hd0)
. How can i know where is ?

last question: can i issue i think in my case command:
Code:
grub> root (hd0,1)
(sould be sda2 where i expecting grub) and then command:
Code:
grub> find /boot/grub/stage1
should gives output ?

realy last question: I create bootalbe usb with unetbootin which uses syslinux, is possible to boot M$ located on HDD throught that ? Thanks a lot
 
Old 08-25-2009, 10:31 AM   #2
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Original Poster
Rep: Reputation: 16
Seems that i answer 2nd question
Code:
sudo dd if=/dev/sda bs=512 count=1 | od -a | grep G
gives me GRUB but
Code:
sudo dd if=/dev/sda1 bs=512 count=1 | od -a | grep G
did not gives nothing
 
Old 08-25-2009, 11:46 AM   #3
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Original Poster
Rep: Reputation: 16
I thing I ve found solution so
/boot/grub/ contains grub files that are too big to store in MBR so they have to be located somewhere in hdd.

Code:
grub> root(hd0,0)
now works i forget sudo

but still i would know if is possible from unetbootin created USB boot directly to harddisk partition (i dont want to press ctrl alt del)
 
Old 08-25-2009, 11:52 AM   #4
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
I hope this article can help you. There are three stages of grub. Here is a tutorial on grub that I read four or five times and still refer back to. I suggest starting at the 'Technical details' for the answers and details for your questions.


http://www.justlinux.com/forum/showt...hreadid=147959

Here is another article by the same man that is shorter

http://www.justlinux.com/forum/showthread.php?t=144294

To answer your question yes you can boot usb with grub easy if usb can be booted by m/b bios.

Last edited by Larry Webb; 08-25-2009 at 12:03 PM.
 
Old 08-25-2009, 04:18 PM   #5
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Original Poster
Rep: Reputation: 16
Thank you for reply i will check links.
I know it is possible boot from USB if mb support it but i read http://www.slax.org/forum.php?action...03#postid45603 and there are troubles using syslinux (Used by unetbootin) they recomend GRUB.
So I decided to install on USB GRUB and DSL linux according to another tutorial http://www.freesoftwaremagazine.com/...tro?page=0%2C0. this boot DSL but just in very "simple" version I must do something wrong...
OK what I am trying to say... When I have booted my USB with GRUB I press 'c' so i can type commands. So if syntax would be strange I am sorry I do not have grub menu now .
I wanted to to view my grub menu, so i type:
Code:
grub> cat (hd1,1)/boot/grub/menu.lst
OK that is fine, I noticed something like
Code:
/boot/vmlinuz-2.6.28-13-generic
so i decided to do some experiments I typed:
Code:
grub> kernel (hd1,1)/boot/vmlinuz-2.6.28-13-generic
and then I type
Code:
boot
I expected that will boot my system normaly from hard drive, but it started and then writes something like Kernel Panic and computer automaticaly shuted down.
Maybe i know where I had mistake in
Code:
menu.lst
also was "options" uuid and initrd but i did not use them during boot.
So I booted system normaly (without my created USB) and typed
Code:
dmesg
to see what happened but i did not see anything about kernel panic. So where is this info stored ? And Why system did not boot correctly if I do that ? And last question I would like to add to unetbootin USB some features to menu (another distro, boot from first partiton) ist this possible ? Thanks a lot

Last edited by wakatana; 08-25-2009 at 04:19 PM.
 
Old 08-25-2009, 07:27 PM   #6
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
I have read your last post and do not understand exactly what you want. It would appear you only have a grub shell or are you operating grub from a cd?
 
Old 08-26-2009, 05:02 AM   #7
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Original Poster
Rep: Reputation: 16
1 I made my live USB vith GRUB.
2 I rebooted system with this plugged USB.
3 So after reboot I had the GRUB menu of my live USB.
4 That GRUB havent option to boot from hard disk (I did not added to menu.lst because i dont know how, if you know please help)
5 I entered to GRUB command console (press 'c')
6 I wanted to boot normaly system from HDD (as is done by GRUB on my HDD)
7 So i tried
Code:
grub> kernel (hd1,1)/boot/vmlinuz-2.6.28-13-generic
8 Instead of booting my linux from HDD it gives me Kernel Panic and I cannot find anything about that in logs.
9 Why system did not boot correctly ?
10 Can you advise me goot tutorial for creating USB live?
11 I wanted to add some more options (other distro, boot directly from HDD...) to unetbootin live USB but it used syslinux and found is better to use GRUB on USB do you agree with that ?
 
Old 08-26-2009, 08:40 AM   #8
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
You have not given us a copy of your fdisk -l so I will assume your usb has one partition and your grub menu.lst should be (hd1,0).

With the grub shell try the following

grub>
root (hd1,0)
setup (hd1)
exit

Then in your grub menu.lst add the following

title Linux
root (hd1,0)
chainloader +1

Last edited by Larry Webb; 08-26-2009 at 08:46 AM.
 
Old 08-31-2009, 03:39 AM   #9
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Original Poster
Rep: Reputation: 16
I am sorry i have not internet and now i am not in front of my PC. I post fdisk -l as soon as possible
 
Old 10-08-2009, 06:22 PM   #10
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Original Poster
Rep: Reputation: 16
I am sorry that takes a long time, early I forgot that I created this thread, so output is

sudo fdisk -l
[sudo] password for marek:

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x3c2e1ae8

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2547 20458746 7 HPFS/NTFS
/dev/sda2 8530 9623 8787555 83 Linux
/dev/sda3 9624 9729 851445 82 Linux swap / Solaris
/dev/sda4 2548 8529 48050415 7 HPFS/NTFS

Partition table entries are not in disk order
 
Old 10-08-2009, 07:54 PM   #11
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Did you have your usb plugged in when you ran fdisk -l? If you did your usb is not bootable.
 
Old 10-08-2009, 08:13 PM   #12
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I think it is relevant to point out that not all Linux has been arranged to be bootable from a USB device. A ram disk file "initrd" needs to conatin drivers for the USB to load at the right time for the kernel access but that is not univesally done by distros. Therefore many Linux distros boot but only to a panic stage if installed in a USB device. I suspect the slower speed of the USB access has something to do with it too.

Partition (hd0,0) is the first partition of the first hard disk.

device (hd0) is the whole of the hard disk and that usually means the MBR. The MBR full length is actually 512 x 63 = 32256 bytes but the Bios only reads the first sector of 512 bytes. (hd0,0) starts from the end of 32256 bytes. Therefore (hd0) and (hd0,0) are physically two different locations of a hard disk.
 
Old 10-09-2009, 01:35 AM   #13
wakatana
Member
 
Registered: Jul 2009
Location: Slovakia
Posts: 133

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Larry Webb View Post
Did you have your usb plugged in when you ran fdisk -l? If you did your usb is not bootable.
USB must be bootable because i createt bootable USB with software unet bootin. I havent it plugged during fdisk -l

Last edited by wakatana; 10-09-2009 at 01:38 AM.
 
Old 10-09-2009, 03:52 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
wakatana,

The acid test is before you fire up a Linux press the "c" key and drop into a Grub prompt then type
Code:
geometry (hd0)
geometry (hd1)
geometry (hd2)
etc to exhaust all the disks

If Grub reports your (hd0) is the USB drive then you got it. Grub works on the disk order hands by the Bios. So get it from the horse's mouth!

It may surprises you that being a boot loader and has no driver to read a USB port how the hell can Grub boot a USB drive? The answer is Bios forces this arrangement and not Grub.

Last edited by saikee; 10-09-2009 at 03:53 AM.
 
  


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
locate grub.conf on a separate /boot partition to edit in an additional kernel ktek Linux - Newbie 6 10-03-2008 09:21 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 01:55 PM
Ubuntu 6.06 No option to locate grub in lixbie Ubuntu 6 12-08-2006 10:59 PM
cpan> locate -u Unknown shell command 'locate -u'. Type ? for help. sharad2005 Linux From Scratch 1 08-04-2006 01:40 AM


All times are GMT -5. The time now is 09:06 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration