Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HowTo] Install on a PC that reboots at gentoo.igz
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Crash_Maxed
n00b
n00b


Joined: 28 Apr 2006
Posts: 17

PostPosted: Thu Jun 08, 2006 12:41 pm    Post subject: [HowTo] Install on a PC that reboots at gentoo.igz Reply with quote

ok....so far here's what i've had to do....the reason I'm posting this is that it may be of use to people who cannot get the x86 LiveCD to boot and don't wanna go to the trouble of downloading a new CD (minimal) and play with other crap. There is a little catch though. You must already have access to the following:
1) A working gentoo environment OR a PC that is capable of actually booting the LiveCD.
2) A USB to mini-IDE (laptop IDE) converter.
3) working gentoo environment / LiveCD AND the crappy laptop must have some sort of interface to install grub through - for me i luckily have floppy on this old crappy laptop. The reason for this is because your crappy laptop can't boot the LiveCD....and hence really can't install grub. Technically you can but the problem is that we have to issue the command "grub-install /dev/hda because when the drive is back in the lappy it WILL BE /dev/hda (correct me if I'm wrong in my theory....i'm new to gentoo). However, in the environment we're installing in we're sda....this is a bad predicament. The fix for this is that once the HD is back in the lappy we boot to grub via an alternate method (bootable floppy/CD with grub), then from the grub shell we boot the system, login, and finally truely install grub via grub-install /dev/hda.

Ok....here it comes....
1) Load up your spare PC that CAN boot the LiveCD. Get it up to the command prompt/GUI
2) Hook up your laptops HD with the converter and plug in into the computer (and wall if it needs a power adapter)
3) issue a dmesg from command line and hope to god that it shows something about usb and "sda/sdb/sd[etc]"
4) provided it tells you about your device (a handy util...although don't know if LiveCD has it would be the command "lsusb" to see if device is recognized) If your on a working gentoo environment use "emerge usbutils" to get the lsusb command" -- proceed to set up partitions like normal....except issue fdisk /dev/sd[X] instead of the normal /dev/hd[X]
5) setup your partitions and make sure to save changes (write to disk)
6) make your file systems. I use reiserfs for both the "/" and "/boot" mountpoints. also, make your swap partition.
for reiserfs use mkreiserfs /dev/sd[x]- for ext2 use mke2fs /dev/sd[x]- for ext3 use mke2fs -j /dev/sd[x]
note the use of sd[x] instead of hd[x]...this is because we're using a USB mass storage device technically
here's what mine looks like (note, this must be ran as root):
Code:
fury ~# mkreiserfs /dev/sda1
>>program garbage here and accept that it will wipe your partition<<
Initiallizing Journal: 0% >>>>>>>>>>>>>>> 100%
fury ~# mkreiserfs /dev/sda3
>>program garbage here and accept that it will wipe your partition<<
Initiallizing Journal: 0% >>>>>>>>>>>>>>> 100%
fury ~# mkswap /dev/sda2

7) Activate the swap...easy enough:
Code:
fury ~# swapon /dev/sda2

8 ) mount the partitions to an applicaple mountpoint. If one doesn't exist...make one. I used /mnt/usb....you can use/mnt/gentoo (just make sure you make the directory in /mnt before trying to mount the partitions) or whatever else. Mount your "/" mountpoint partition...mines hda3...then do "mkdir /mnt/[mntdir]/boot". Last but not least mount the "/boot" mountpoint.....mines hda1 (hda2 is swap)
Code:
fury ~# mount /dev/sda3 /mnt/usb
fury ~# mkdir /mnt/usb/boot
fury ~# mount /dev/sda1 /mnt/usb/boot

9) download stage3 and portage snapshots to the mount directory (in my case its /mnt/usb/) - I'm on the x86 stage3
10) untar the stage3 and portage snapshots according to the gentoo install documentation
Code:
fury ~# cd /mnt/usb
fury usb# tar xvjpf stage3-*.tar.bz2
fury usb# tar xvjf /mnt/usb/portage-<date>.tar.bz2 -C /mnt/usb/usr

11) follow the rest of the gentoo installation guide....of course using sda[X] instead of hda[X] where needed. However, make sure in the /etc/fstab file you declare the mountpoints as dev/hda[X]. THIS IS IMPERATIVE! This is because once its in the crappy laptop it WILL BE /dev/hda
-------------------------------------------------------------------------------------------------------------
-----Once you get to the BOOTLOADER section tune into the following directions!--------
-------------------------------------------------------------------------------------------------------------
12) emerge grub just like normal:
Code:
emerge grub

13) setup the grub.conf file just like in the install guide
heres mine (ignore the Phase 3 BS....its a personalization thing ;)) also...if you follow the guide to the "T" you'll use /boot/bzImage -- not /boot/2.6.16-r9
Code:
default 0
timeout 10

title=Gentoo 2.6.16-r9 [Phase 3]
root(hd0,0)
kernel /boot/2.6.16-r9 root=/dev/hda3

14) instead of doing grub-install or the manual grub shell install do the following
15) if your using a floppy disk method (like I mentioned up near the top in the 3rd pre-requisite) do the following (with a floppy in the drive of course -- also assuming the device is /dev/fd0 like most peoples) to make a bootable grub
Code:

(chrooted) fury / # cd /boot/grub
(chrooted) fury grub # dd if=stage1 of=/dev/fd0 bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, X.XXXXXX seconds, X.X kB/s
(chrooted) fury grub # dd if=stage2 of=/dev/fd0 bs=512 seek=1
153+1 records in
153+1 records out
104008 bytes (104 kB) copied, X.XXXXXX seconds, XX.X kB/s

16) exit the chrooted environment by issuing "exit"
17) unmount the systems just like the install guide says (I do it 1 at a time just for safety):
Code:
fury / # umount /mnt/usb/boot
fury / # umount /mnt/usb/dev
fury / # umount /mnt/usb/proc
fury / # umount /mnt/usb

18 ) disconnect the USB cord and take the drive off of the mini-IDE adapter
19) put laptop drive in laptop (use HD carriage of course)
20) boot up laptop with the floppy we just created (if you didn't use the floppy method...EX: used a CD -- please find out how to make the CD and then boot from it...sry I can't help on the CD creation thing since I didn't need to do it.)
21) at the grub shell we are now in do the following:
Code:
grub> root (hd0,0)
grub> kernel /boot/2.6.16-r9 /root=/dev/hda3
grub> boot

of course if you followed the tutorial to the "T" you'd issue "kernel /boot/bzImage /root=/dev/hda3" instead. Note....I am assuming you know to replace "hda3" with whatever your actual "/" mountpoint you setup in the fstab is. I'm assuming you at least know the basics here of course....why else would I go in depth how to set this up...nonetheless how would I have even completed this feat had I not known the basics.
22) if all is well (and you configured your kernel correctly EX: I didn't do genkernel...nor do I remember the grub lines needed to boot a genkernel'd install) your system should now boot and you should be at a (hallelujah) login prompt. Login with the user "root" and of course the password you set with "passwd" earlier.....you did set it....didn't you?
23) finally... issue a "grub-install /dev/hda" from the command line....all should be well and your system should report that it successfully installed grub
24) remove grub floppy (or CD) and issue "shutdown -r now" to reboot the machine. If all is happy you now have a fully bootable gentoo install on a POS that won't boot a LiveCD!!!!

If this has been of any help to anyone with this issue I'm very glad....after all...it did take me about and hour to write!!! If you need clarification on any of this please feel free to message me.

Final Note: There is one HUGE....FREAKING HUGE advantage to using this method. The more powerful the PC you boot the LiveCD (or have a working gentoo environment on) the faster your system will be ready as a P-MMX @ 200Mhz will take EONS to compile ANYTHING!!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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