public inbox for gentoo-amd64@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Drake Donahue" <donahue95@comcast.net>
To: <gentoo-amd64@lists.gentoo.org>
Subject: Re: [gentoo-amd64] boot Gentoo from USB key
Date: Wed, 30 Apr 2008 14:03:54 -0400	[thread overview]
Message-ID: <001401c8aaec$8e74c440$0200a8c0@iwillxp333> (raw)
In-Reply-To: 1209537833.6170.62.camel@ws2912.agr.st.com


----- Original Message ----- 
From: "Raffaele BELARDI" <raffaele.belardi@st.com>
To: "gentoo-amd64" <gentoo-amd64@lists.gentoo.org>
Sent: Wednesday, April 30, 2008 2:43 AM
Subject: [gentoo-amd64] boot Gentoo from USB key


> In the process of building an amd64 diskless box, I am trying to make a
> bootable USB key with no success up to now.
>
> The first problem I encountered was related to ext2/vfat. I initially
> tried to format the key as ext2, but grub refuses to install on it. Even
> though I copied the /boot/grub/* directory into the key, and I see it is
> there, grub does not see it. The problem does not happen with vfat.
>
> So I worked around that and created two partitions in the key, a small
> vfat for the /boot and a 2Gb ext2 for the /. I copied the stage3 into
> the / with no problem. In the /boot I put the kernel image which I am
> already using on the same box, for now with discs still connected. All
> the modules are compiled in.
>
> When I boot from the key, grub enters the shell (although I did create
> the grub.conf and menu.1st, so I don't understand why it doesn't show
> the menu). I manually specify the kernel file location and root
> parameter:
>
>> kernel /linux-2.6.24-gentoo-r4 root=/dev/sdg1
>> boot
>
> The kernel starts to load, but panics because it is unable to find the
> root partition. When it stops it shows the available partitions, these
> include all the hard disk partitions but no USB key partition. In fact,
> if I omit the 'root' parameter from the grub shell the boot works fine
> but it uses the hard disk root partition instead of the USB one.
>
>>From the log on the screen the USB controller seems correctly detected,
> so I don't understand why it is not finding the root. While writing this
> one idea comes to my mind, maybe it is failing because I attach the key
> to a SDC/MMC/USB card reader? This evening I'll try to plug it into a
> different USB slot.
>
> Any other ideas welcome.
>
> raffaele
>
> -- 
> gentoo-amd64@lists.gentoo.org mailing list
>
Other ideas and SWAGS:

This link may be useful:
http://www.bootdisk.com/pendrive.htm

Perhaps the pen drive manufacturer did you favors and added some control 
software?
I had a similar problem with fdisk results that I attributed to the helpful 
manufacturer putting some extra software on the drive to add features for 
the windows user (the bootable flag would have disappeared upon reboot, the 
pen drive would not appear in BIOS). I may have been right. I used the HP 
utilities referenced in the link to rewrite the recalcitrant pen drive into 
a psuedo floppy drive with linux on board (HP provides a linux based windows 
computer troubleshooting tool!). After verifying that I could boot the pen 
drive as though it were a huge floppy, I rebooted to my hard drive and used 
fdisk to delete existing partitions on the pen drive, created a bootable 
partition, wrote the new partition table, exited fdisk, and formatted it 
ext2. On reboot it showed as a bootable hard drive in BIOS. Encouraged, I 
rebooted to the hard drive. Mounted the pen drive and copied /boot from the 
hard drive to it. Create dummy directory on the pendrive:
>mkdir  {pendrive path}/pendrive
Keeping the problem simple, the machine had one sata hard drive, one ide 
dvd, and the one pen drive.
The major problems at this point were identifying which (hd?) to use in 
editing the grub.conf and in running grub itself.
>umount {pendrive}
>grub
>root (hd0,1)
>root (hd1,1)
>find /pendrive
>quit
As the pen drive first (0) partition was the only ext2 partition on the 
machine, only one of the two commands would expose an ext2 filesystem; in my 
case (hd1,1). Find should provide the same information.
If the pen drive is the selected boot drive for my motherboard it will be 
(hd0) for bios and grub.
So the pen drive grub.conf edits to:
timeout 5
default 0
fallback 1
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title USB Flash boot
root (hd0,0)
kernel (hd0,0)/boot/bzImage root=/dev/sdb1

title  Gentoo Linux on hard drive, first partition (hd1,0)
root (hd1,0)
kernel (hd1,0)/boot/bzImage root=/dev/sda1

So far my hard drive always /dev/sda pendrive /dev/sdb. As a slob, I put 
everything on one partition so all catastrophes can be catastrophic.

Still need to install grub so proper stage 1 and 1.5 and dynamic links can 
be written:

>grub
>root (hd1,0) #should confirm unique ext2 file system in my case
>setup (hd1)
>quit

Proceeding in similar fashion should allow you to select the kernel on the 
pen drive from grub and watch it load to the point where it can't find the 
system because no system is on the pen drive.

Copying the system files may not quite work. Got some copy errors while 
doing the libraries. Playing with 512 mb pen drive so no room to copy /sys. 
Can verify that I completed kernel load and got into init.before lack of 
needed files started an endless reboot cycle with boot sbin bin etc 
libraries directories present.

. 

-- 
gentoo-amd64@lists.gentoo.org mailing list



  parent reply	other threads:[~2008-04-30 18:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30  6:43 [gentoo-amd64] boot Gentoo from USB key Raffaele BELARDI
2008-04-30  6:49 ` Kyle Liddell
2008-04-30  6:56 ` Branko Badrljica
2008-04-30  7:44   ` Raffaele BELARDI
2008-05-05  8:40     ` Raffaele BELARDI
2008-04-30 10:47 ` [gentoo-amd64] " Duncan
2008-04-30 12:35 ` [gentoo-amd64] " Jason
2008-04-30 14:29   ` Branko Badrljica
2008-04-30 14:47     ` Jason
2008-04-30 15:05       ` Branko Badrljica
2008-04-30 15:40         ` Jason
2008-04-30 15:55           ` Branko Badrljica
2008-05-05  8:53           ` Raffaele BELARDI
2008-04-30 17:39 ` Hernan Lopez
2008-04-30 17:58   ` Branko Badrljica
2008-05-01  7:26     ` Branko Badrljica
2008-04-30 18:03 ` Drake Donahue [this message]
2008-04-30 18:21   ` Drake Donahue
2008-05-02 11:22 ` [gentoo-amd64] " Duncan
2008-05-02 15:33   ` Drake Donahue
2008-05-05  8:38     ` Raffaele BELARDI
2008-05-06 13:18       ` Raffaele BELARDI
2008-05-06 17:08         ` Duncan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001401c8aaec$8e74c440$0200a8c0@iwillxp333' \
    --to=donahue95@comcast.net \
    --cc=gentoo-amd64@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox