LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 10-13-2012, 03:53 PM   #1
drimades
Member
 
Registered: Jun 2006
Posts: 60

Rep: Reputation: 15
Grub2 on usb stick


Hi!
I installed GRUB2 on a usb stick with:
Code:
sudo grub-install --boot-directory=/mnt/lfs/boot /dev/sdb
down here you can see how is the usb mounted:
Code:
/dev/sdb1 on /mnt/lfs type ext2 (rw)
The installation process finished successfully.
Then I edited grub.cfg in /mnt/lfs/boot/grub to the following:
Code:
set default=0
set timeout=5

insmod ext2
set root=(hd1,1)

menuentry "LFS test" {
 linux /boot/vmlinuz root=/dev/sdb1 ro
}
When I restart the system booting from usb it results in a blank screen with the cursor blinking after 4-5 empty lines. Any idea why it's not showing the boot menu?
 
Old 10-13-2012, 04:05 PM   #2
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

What files do you have in boot
 
Old 10-13-2012, 04:09 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
/sdb1
Shouldn't a booted device be sda?
 
Old 10-13-2012, 04:12 PM   #4
drimades
Member
 
Registered: Jun 2006
Posts: 60

Original Poster
Rep: Reputation: 15
In /mnt/lfs/boot I have grub vmlinuz vmlinuz-3.5.2
grub is a directory and the other two are same files

---------- Post added 10-13-12 at 05:13 PM ----------

Quote:
Originally Posted by jefro View Post
/sdb1
Shouldn't a booted device be sda?
well, sda is the hdd for me
 
Old 10-13-2012, 04:16 PM   #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
Should there be other files there as well
System.map config and vmlinuz according to this
http://www.linuxfromscratch.org/lfs/...08/kernel.html
 
Old 10-13-2012, 04:34 PM   #6
drimades
Member
 
Registered: Jun 2006
Posts: 60

Original Poster
Rep: Reputation: 15
that's true, but it seems to me that the files System.map and config don't make the difference
 
Old 10-13-2012, 04:39 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
Well i,m sure the config will,
I have my usb drive grub cfg setup as
Quote:
# Begin /boot/grub/grub.cfg
set default=0
set timeout=5


insmod ext2
set root=(hd0,1)

menuentry "Planet-Spike7" {
linux /boot/vmlinuz-3.2-lfs-7.0 root=/dev/sdc1 rootdelay=5 ro
the part rootdelay=5 you might not need this gives the usb time to start up.

Mine boots from usb so reads the mbr as hd0
 
Old 10-13-2012, 04:45 PM   #8
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
The config file is for loading drivers and settings for your system, The kernel configuration, what makes you think you dont need it

Last edited by spiky0011; 10-13-2012 at 05:06 PM.
 
Old 10-13-2012, 05:11 PM   #9
drimades
Member
 
Registered: Jun 2006
Posts: 60

Original Poster
Rep: Reputation: 15
as far as I know, it is used for preparing the image of the kernel. once you have vmlinuz (bzImage), you can keep the config file only as a reference
 
Old 10-13-2012, 05:34 PM   #10
drimades
Member
 
Registered: Jun 2006
Posts: 60

Original Poster
Rep: Reputation: 15
I've tried now to put the menuentry in the existing grub menu of the system and it starts with decompressing the kernel. it blocks with a kernel panic. in the kernel configuration I used a make allyesconfig. is it possible that it hasnt included support for the scsi devices?
 
Old 10-14-2012, 01:14 AM   #11
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

Can you get a grub prompt, If so try loading manually
 
Old 10-14-2012, 02:54 AM   #12
drimades
Member
 
Registered: Jun 2006
Posts: 60

Original Poster
Rep: Reputation: 15
Probably I can get to the grub shell. A question, is it syntactically correct if I add init=/bin/bash to the following:

Code:
menuentry "LFS test" {
set default=0
set timeout=5

insmod ext2
set root=(hd0,1)

 linux /boot/vmlinuz root=/dev/sdb1 rootdelay=10 init=/bin/bash ro

}
 
Old 10-14-2012, 02:58 AM   #13
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
With that cfg are you tryin to boot from usb
 
Old 10-14-2012, 03:07 AM   #14
drimades
Member
 
Registered: Jun 2006
Posts: 60

Original Poster
Rep: Reputation: 15
Yes, and I get VFS : Cannot open root device "sdb1" or unknown-block(0,0)
 
Old 10-14-2012, 03:11 AM   #15
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
Try loading manually from grub prompt, it will also let you check that everything is looking in the correct places and the correct things.

Have you tried updating grub on the host
 
  


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
How to boot from an USB stick without BIOS support using Grub2? vimico Linux - Laptop and Netbook 11 02-25-2012 05:19 PM
Booting a USB stick with GRUB2 and Labels ljones0 Slackware 1 02-14-2011 07:53 PM
[SOLVED] Create independent Grub2 boot loader menu in USB stick. cr4321 Linux - General 27 07-18-2010 12:48 PM
Grub2 (1.96) loopback problem on usb-stick ganimo Linux - General 4 10-01-2009 07:26 AM
mount/umount usb stick - PQI Intelligent Stick 2.0 sandbag Linux - Software 5 05-06-2005 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 11:03 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
Open Source Consulting | Domain Registration