HOWTO Install Gentoo without a livecd
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Contents |
[edit] Introduction
Many people have asked how to install Gentoo on a system without a CDROM drive. This HOWTO will describe what you need to complete this.
[edit] Requirements
You need a means to boot your system. There are various methods of booting your system. For example; PXE, floppy, usbstick, zip drive, alternate hard drive, etc. But for the scope of this document we will use the most common; a boot floppy. I personally like RIP, but you could use just about any boot floppy. Your boot floppy will need:
- The ability to access your harddrive(s). In other words, you will need the required drivers such as SCSI drivers, etc.
- A means to get files onto the computer. Basically, you need network or internet access.
- The following tools: fdisk,mk*fs,mount,tar,chroot, and a tool to transfer files to the computer like wget. (* is whatever filesystem you intend to use)
- A sufficiently recent kernel, or `chroot /mnt/gentoo /bin/bash' will fail. (For example the 2.4 kernel used in Damn Small Linux won't allow the chroot to work for Gentoo 2006.1)
- A kernel that can use a swap partition (look for a `swapon' command).
BG-Rescue Linux is a 2-floppy Linux distribution that seems adequate for CD-less installation work. BG-Rescue Linux runs in RAM so the floppy drive can be used to transfer (smallish) files between the outside world and the installation environment.
Red Hat Linux 6.2 is an old distribution that is not entirely sufficient (no `swapon' command, kernel probably too old for `chroot /mnt/gentoo /bin/bash'). However, the 1-floppy boot disk seems to boot successfully on a wide range of oldish hardware. Type `linux rescue' at the initial boot prompt. Among the boot choices will be NFS server, FTP server and HTTP server. The NFS alternative is useful. Start by downloading the Red Hat 6.2 ISO image to a nearby machine, loop-mount the .iso file and export the file tree so that the rescue floppy can boot from it. Once the rescue environment is up further NFS mounts can be done, thereby allowing download of files to the installation environment. Careful planning is needed: Use the Red Hat environment to load stage tarballs, portage snapshots, extra distfiles and such to the hard disk, then switch to e. g. BG-Rescue for the chroot work (such a strategy may work if BG-Rescue alone does not provide network connectivity).
Later versions of Red Hat Linux may work as well, but more RAM is needed. A 40 MB RAM machine seems to support the Red Hat Linux 6.2 rescue environment but fails to boot in the same way with Red Hat Linux 7.3.
[edit] PXE
You can use PXE booting with Knoppix easily if you have two machines. One will act as a server and needs to boot off the Knoppix CD. It will automatically self configure to allow your target machine to PXE boot Knoppix off it.
If you don't have a second machine, you can turn System Rescue CD into something PXE bootable (instructions). As a bonus it comes with various diagnostic utilities such as memory testers, hardware inventory, partition table editors, boot managers, NT password recovery etc. It is based on a recent version of Gentoo under the hood.
[edit] Boot
Boot your system into GNU/Linux, most of the time this should be a simple task. Once you have a command line, you can continue to the next step.
[edit] Prepare your harddrive
Partition your harddrive(s) with fdisk, and format them with mkfs*(Ex. mkswap,mke2fs,mkreiserfs). For more information, see chapter 4 of the Gentoo Handbook.
[edit] Transfer the required files to the system
This is the tricky part, you need to get files needed to install Gentoo onto the target system. The most common method will be over the network. These are the required files you will need, you can get them from a Gentoo Mirror:
- A stage tarball such as the one found:/releases/x86/current/stages/stage1-x86-<date>.tar.bz2 (this one is required, the other two depend on your installation method)
- A portage snapshot such as portage-latest.tar.bz2
- The distfiles for the packages to install the base system (like linux-2.6.8.1.tar.bz2, gcc-3.4.1.tar.bz2, etc)
[edit] Internet/Network
Get your network/internet connection working, chapter 3 may be of help. If you don't have an internet connection, you will need another computer that can serve files to the target system, via http,ftp,sftp,nfs,etc...
Once you are connected, you need to download the files onto the target computer. I suggest using wget or something similar. To get the stage tarball from the internet a command similar to "wget http://distro.ibiblio.org/pub/linux/distributions/gentoo/releases/x86/current/stages/stage1-x86-<date>.tar.bz2"
[edit] Other Methods
There are many ways to accomplish this task. Feel free to add them in this section. I could even imagine using floppies and the split tool, however time consuming that may be.
[edit] Boot from a Windows Partition
On a windows only machine, you may consider installing Grub for DOS, then extract the kernel image from a LiveCD, put it on a vfat partition, and boot from there: The Original Post at the Gentoo Forum
[edit] Follow the Handbook
You can basically pick up from here with chapter 5 of the Gentoo Handbook.
[edit] Alternate Method
There is another way that may be simpler. For this to work, you will need another system with GNU/Linux on it. Remove the harddrive from the system you want to put Gentoo onto, then connect the harddrive to the system with GNU/Linux on it.
Then you can follow the Handbook.
One caveat that you may want to consider is that the binaries you build for the new system should be able to run on both the target and host system. Remember this when setting your CFLAGS in make.conf.
[edit] Netboot
This also requires two computers, you can run a tftp server on one computer with the initrd and kernel, while using grub (booted from a floppy drive) to do a network boot.
The best link to learn how to setup netboot,pxe etc. is syslinux.zyor.com
You can learn a lot from different parts of the LTSP guide on how to do this:
You can get a 'quick' LTSP Server by booting from the Ubuntu Alternate CD. Select 'install an LTSP server' from the CD boot menu.
To then boot the computer you are installing Gentoo to requires either a BIOS that supports network booting or an etherboot floppy. For the later find your network cards chipset in the NIC Database and download the Floppy Bootable Rom Image. Block copy this image to good floppy disk and boot your target machine from this floppy.
[edit] Useful commands for the above
lspci | grep Ethernet to find out your network card chipset
cat eb-5.4.3-yournic.zdsk > /dev/fd0 to copy the downloaded image to floppy
If successful etherboot will first correctly identify your network cards chipset, then poll for an IP address from the DHCP server running as part of the LTSP installation.
Knoppix includes a terminal server that requires minimum GUI setup, no need to setup tftp and dhcp servers as it is done automatically. This can be used to boot any machine that supports PXE boot to linux. Installation using Knoppix is nearly identical to installation from the Gentoo LiveCD. Some consider Knoppix to be even better for the task of installing linux than any other distro-specific livecd.
