If the standard boot-from-CD install method doesn't work for you (or you just
don't like it), help is now here. This document serves to provide a repository
of alternative Gentoo Linux installation techniques to those who need them.
Or, if you prefer, it serves as a place to put your wacky installation methods.
If you have an installation method that you yourself find useful, or you have
devised an amusing way of installing Gentoo, please don't hesitate to write
something up and post it on
Download Smart BootManager available from
Either compile the package from source or just grab the binary. There are several options that can be utilized while creating your boot floppy, as seen below.
sbminst [-t theme] [-d drv] [-b backup_file] [-u backup_file]
-t theme select the theme to be used, in which the theme could be:
us = English theme de = German theme
hu = Hungarian theme zh = Chinese theme
ru = Russian theme cz = Czech theme
es = Spanish theme fr = French theme
pt = Portuguese theme
-d drv set the drive that you want to install Smart BootManager on;
for Linux:
/dev/fd0 is the first floppy driver,
/dev/hda is the first IDE harddisk driver.
/dev/sda is the first SCSI harddisk driver.
for DOS:
0 is the first floppy drive
128 is the first hard drive;
-c disable CD-ROM booting feature;
-b backup_file backup the data that will be overwritten for
future uninstallation;
-u backup_file uninstall Smart BootManager, should be used alone;
-y do not ask any question or warning.
# sbminst -t us -d /dev/fd0
Now simply place the floppy in the floppy drive of the computer you'd like to boot the Install CD on, as well as placing the Install CD in the CD-ROM and boot the computer.
You'll be greeted with the Smart BootManager dialog. Select your CD-ROM and press ENTER to boot the Install CD. Once booted proceed with the standard installation instructions.
Further information on Smart BootManager may be found at
Booting from the
Boot from the Knoppix CD. If you have Knoppix 3.6-3.8.2, you will need to
specify
By default Knoppix boots into a KDE desktop. Open a
# mkdir /mnt/gentoo
At this point, you can pick up with the standard install documentation at
# mount -o bind /proc /mnt/gentoo/proc
Also, know that some of Portage's FEATURES will not work in knoppix. Especially
watch out for
You will need a network card on the diskless client that uses the PXE protocol to boot, like many 3com cards. You will also need a BIOS that supports booting from PXE.
Create directories: The first thing to do is to create the directories where
your diskless system will be stored. Create a directory called
# mkdir /diskless # mkdir /diskless/eta # mkdir /diskless/eta/boot
DHCP and TFTP setup: The client will get boot informations using DHCP and
download all the required files using TFTP. Just emerge DHCP and configure it
for your basic needs. Then, add the following on
For DHCPd, run
option option-150 code 150 = text ;
ddns-update-style none ;
host eta {
hardware ethernet 00:00:00:00:00:00;
fixed-address ip.add.re.ss;
option option-150 "/eta/boot/grub.lst";
filename "/eta/boot/pxegrub";
}
Next you'll need to configure your interface in
(Replace eth0 with the correct interface) config_eth0=( "noop" )
For TFTP, emerge
INTFTPD_PATH="/diskless"
INTFTPD_USER="nobody"
INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}"
Setup GRUB: To provide PXE booting I use GRUB with the
# echo "sys-boot/grub netboot" >> /etc/portage/package.use # emerge -av grub # cp /usr/lib/grub/pxegrub /diskless/eta/boot/pxegrub # nano -w /diskless/eta/boot/grub.lst
default 0 timeout 30 title=Diskless Gentoo root (nd) kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=ip.add.re.ss:/diskless/eta# For the nfsroot option, the IP address is the one of the server and the directory is the one where your diskless client files are located (on the server).
Setup NFS: NFS is quite easy to configure. The only thing you have to do is to
add a line on the
# nano -w /etc/exports # /etc/exports: NFS file systems being exported. See exports(5). /diskless/eta eta(rw,sync,no_root_squash)
Update your hosts: One important thing to do now is to modify your
127.0.0.1 localhost 192.168.1.10 eta.example.com eta 192.168.1.20 sigma.example.com sigma
You might want to reboot the server with a Gentoo Install CD, although you can
very well continue immediately if you know how to proceed with the Gentoo
Installation Instructions from an existing installation. Follow the standard
install procedure as explained in the
# mount /dev/hdaX /mnt/gentoo
Stage tarballs and chroot: This example uses a stage3 tarball. Mount
# cd /mnt/gentoo/diskless/eta/ # tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2 # mount -t proc /proc /mnt/gentoo/diskless/eta/proc # cp /etc/resolv.conf /mnt/gentoo/diskless/eta/etc/resolv.conf # chroot /mnt/gentoo/diskless/eta/ /bin/bash # env-update # source /etc/profile
Kernel configuration: When you do the
- Your network card device support(In the kernel, *not* as a module!) - Under "Networking options" : [*] TCP/IP networking [*] IP: kernel level autoconfiguration [*] IP: DHCP support [*] IP: BOOTP support - Under "File systems --> Network File Systems" : <*> NFS file system support [*] Provide NFSv3 client support [*] Root file system on NFS
Save the kernel in your chrooted
# nano -w /etc/fstab /dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 proc /proc proc defaults 0 0 tmpfs /dev/shm tmpfs nodev,nosuid,noexec 0 0
You also need to prevent the client to run a filesystem check:
# touch /fastboot # echo "touch /fastboot" >> /etc/conf.d/local.start
Install
# emerge nfs-utils
Bootloader. Don't install another bootloader because we already have one - pxegrub. Simply finish the install and restart the server. Start the services you'll need to boot the new client: DHCP, TFTPD, and NFS.
# /etc/init.d/dhcp start # /etc/init.d/in.tftpd start # /etc/init.d/nfs start
For the new client to boot properly, you'll need to configure the bios and the network card to use PXE as the first boot method - before CD-ROM or floppy. For help with this consult your hardware manuals or manufacturers website. The network card should get an IP address using DHCP and download the GRUB PXE image using TFTP. Then, you should see a nice black and white GRUB bootmenu where you will select the kernel to boot and press Enter. If everything is ok the kernel should boot, mount the root filesystem using NFS and provide you with a login prompt. Enjoy.
In order to install Gentoo from your existing Linux distribution you need to have chroot command installed, and have a copy of the Gentoo installation tarball or ISO you want to install. A network connection would be preferable if you want more than what's supplied in your tarball. (by the way, a tarball is just a file ending in .tbz or .tar.gz). The author used RedHat Linux 7.3 as the "host" operating system, but it is not very important. Let's get started!
We will first allocate a partition to Gentoo by resizing our existing Linux partition, mount the partition, untar the tarball to the partition that is mounted, chroot inside the pseudo-system and start building. Once the bootstrap process is done, we will do some final configuration on the system so as to make sure it boots, then we are ready to reboot and use Gentoo.
The root partition is the filesystem mounted under
# mount /dev/hdb2 on / type ext3 (rw) none on /proc type proc (rw) none on /dev/pts type devpts (rw,gid=5,mode=620) none on /dev/shm type tmpfs (rw,nodev,nosuid,noexec) # df -h Filesystem Size Used Avail Use% Mounted on /dev/hdb2 4.0G 1.9G 2.4G 82% / none 38M 0 38M 0% /dev/shm
As we can see, the partition mounted as
Parted is an utility supplied by the GNU foundation, an old and respectable
huge project whose software you are using in this very moment. There is one
tool, however, that is extremely useful for us at the moment. It's called
parted, partition editor and we can get it from
Look up on that page the type of filesystem you want to resize and see if
parted can do it. If not, you're out of luck, you will have to destroy some
partition to make space for Gentoo, and reinstall back. Go ahead by downloading
the software, install it. Here we have a problem. We want to resize our Linux
root partition, therefore we must boot from a floppy disk a minimal linux
system and use previously-compiled parted copied to a diskette in order to
resize
Get the mininux boot/root disk (a 2.4-powered mini Linux distribution on a
floppy - free of charge) from
# mkfs.minix /dev/fd0 480 inodes 1440 blocks Firstdatazone=19 (19) Zonesize=1024 Maxsize=268966912
We will now proceed with the build of parted. If it's not already downloaded
and untarred, do so now and
# mkdir /floppy; mount -t minix /dev/fd0 /floppy && export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" && ./configure && make && cp parted/parted /floppy && umount /floppy
Congratulations, you are ready to reboot and resize your partition. Do this
only after taking a quick look at the parted documentation on the GNU website.
The resize should take under 30 minutes for the largest hard-drives, be
patient. Reboot your system with the mininux boot disk (just pop it inside),
and once you are logged in, switch the disk in the drive with your utility disk
we have created above and type
# mount /dev/fd0 /floppy
# cd /floppy; ./parted [drive you wish to operate on]
(parted) print
Disk geometry for /dev/hdb: 0.000-9787.148 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 2953.125 primary ntfs
3 2953.125 3133.265 primary linux-swap
2 3133.266 5633.085 primary ext3
4 5633.086 9787.148 extended
5 5633.117 6633.210 logical
6 6633.242 9787.148 logical ext3
(parted) help resize
resize MINOR START END resize filesystem on partition MINOR
MINOR is the partition number used by Linux. On msdos disk labels, the
primary partitions number from 1-4, and logical partitions are 5
onwards.
START and END are in megabytes
(parted) resize 2 3133.266 4000.000
Once you have resized, boot back into your old linux as described. Then go to
# env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash # /usr/sbin/env-update # source /etc/profile
Enjoy!