From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JrH1w-0002bP-GB for garchives@archives.gentoo.org; Wed, 30 Apr 2008 18:27:48 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A9E8DE09B9; Wed, 30 Apr 2008 18:24:55 +0000 (UTC) Received: from QMTA07.westchester.pa.mail.comcast.net (qmta07.westchester.pa.mail.comcast.net [76.96.62.64]) by pigeon.gentoo.org (Postfix) with ESMTP id 83172E09B9 for ; Wed, 30 Apr 2008 18:24:55 +0000 (UTC) Received: from OMTA01.westchester.pa.mail.comcast.net ([76.96.62.11]) by QMTA07.westchester.pa.mail.comcast.net with comcast id KscX1Z00D0EZKEL5709a00; Wed, 30 Apr 2008 18:24:46 +0000 Received: from iwillxp333 ([68.58.192.35]) by OMTA01.westchester.pa.mail.comcast.net with comcast id KuQu1Z0050mGrD83M00000; Wed, 30 Apr 2008 18:24:54 +0000 X-Authority-Analysis: v=1.0 c=1 a=LRuB1CXnq-0A:10 a=VQxfaffxSS0A:10 a=eEy-4iJuAAAA:8 a=TWSj67Ca4d4g-WUcKYQA:9 a=i4VvJkdM1HNA3puD0ToA:7 a=MZeJXGbsUeOhjEFclO1sPTHnQAAA:4 a=si9q_4b84H0A:10 a=RUNXi7WdHkcA:10 a=plE8mkVoi54A:10 Message-ID: <002501c8aaef$18dc8530$0200a8c0@iwillxp333> From: "Drake Donahue" To: References: <1209537833.6170.62.camel@ws2912.agr.st.com> <001401c8aaec$8e74c440$0200a8c0@iwillxp333> Subject: Re: [gentoo-amd64] boot Gentoo from USB key Date: Wed, 30 Apr 2008 14:21:58 -0400 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-amd64@lists.gentoo.org Reply-to: gentoo-amd64@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Archives-Salt: b9459098-3690-40f5-9f97-40068bcf4e08 X-Archives-Hash: c058a530d1e8e77f2877e4779f6db660 ----- Original Message ----- From: "Drake Donahue" To: Sent: Wednesday, April 30, 2008 2:03 PM Subject: Re: [gentoo-amd64] boot Gentoo from USB key > > ----- Original Message ----- > From: "Raffaele BELARDI" > To: "gentoo-amd64" > 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!). Instead of HP utilities, maybe, quoting: Solution: When you boot into a command shell, as root, simply pick the drive you want to fill [with zeros], sdg presumed, and use the command: Code: dd if=/dev/zero of=/dev/sdg bs=1MWARNING! This will destroy ALL data on the hard (pen) drive, all boot sector info and all data on all partitions. It will not however render the disk useless, you simply have a clean disk that only needs to have partitions created and a new boot sector installed, which will happen when you install any OS including Linux or Windows. This is a good way to clean up any bad partitions, viruses, botched installs or data that you don't want to be seen (OK, it is theoretically possible to forensically retrieve data after using this method, but not likely and not doable by the average computer user) and it is simple to do with existing GNU/Linux! 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 > -- gentoo-amd64@lists.gentoo.org mailing list