# Install Gentoo on a Windows only machine, no floppy, cdrom!

## Hauser

If you use the 2006.0 LiveCD or minimal install CD, see: https://forums.gentoo.org/viewtopic-p-3146744.html#3146744

Edit:  A gentoo-based liveCD called SystemResueCD is a very good alternative, details please see: https://forums.gentoo.org/viewtopic-p-3308151.html#3308151

------------------------------------------------------------------------------------------

Edit: updated for 2005.1 

Let's say you only have windows on your machine, no floppy, no cdrom drive, and no vmware installed.  But I assume you have successfully installed and set up  Grub-for-DOS.

First you need to download the 2005.1 LiveCD iso: http://gentoo.osuosl.org/releases/x86/2005.1-r1/installcd/install-x86-universal-2005.1-r1.iso

You need to have a vfat partition, and you need to extract the files and directories from the LiveCD iso (using programs like ultraiso) and copy them over to the vfat partion.  

Edit: It turns out Grub-for-DOS also works on ntfs partitions: https://forums.gentoo.org/viewtopic-p-3525073.html#3525073

Next, set up a Grub entry like this:

```
title Gentoo Livecd

root (hd0,4)

kernel /isolinux/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/livecd.squashfs cdroot=/dev/hda5 vga=791 splash=silent,theme:livecd-2005.1 CONSOLE=/dev/tty1

initrd /isolinux/gentoo.igz
```

If it's necessary, you may append the kernel options as listed in the isolinux/F*.msg files.

Now the following scripts are for the impatient.  Basically you just copy them over to the above-mentioned vfat partition and execute them when you get into the installation environment, a Gentoo base system will be automatically installed for you.  :Smile: 

However you do need to edit these scripts according to your own circumstances, and backup your data before you consider using them, you've been warned!

step1

```
#!/bin/bash

hdparm -d 1 /dev/hda   #(Activate DMA)

#mke2fs -j /dev/hda9   #(initialize the boot partition)

#mkswap /dev/hda10   #(initialize the swap partition)

swapon /dev/hda10   #(Activate the swap partition)

#mke2fs -j /dev/hda3   #(if you want to use ext3 for your root partition)

mkreiserfs -f /dev/hda3    #(if you want to use reiserfs)

#mkfs.xfs -f /dev/hda3   #(if you want to use xfs)

mount /dev/hda3 /mnt/gentoo   #(Mount the root partition)

#mkdir /mnt/gentoo/boot   #(Create the boot mountpoint)

#mount /dev/hda9 /mnt/gentoo/boot   #(Mount the boot partition)

echo "Now set your system time!  For instance, to set the date to October 29th, 16:21 in the year 2005, type: date 102916212005"
```

step2

```
#!/bin/bash

cd /mnt/gentoo   #(Go to the mountpoint where the root partition has been mounted)

tar xjvpf /mnt/cdrom/stages/stage3-x86-2005.1-r1.tar.bz2   #(Extract a stage3 tarball...)

tar -xvjf /mnt/cdrom/snapshots/portage-20050709.tar.bz2 -C /mnt/gentoo/usr   #(unpack a portage tree)

mkdir /mnt/gentoo/usr/portage/distfiles   #(Create a directory for distfiles)

cp /mnt/cdrom/distfiles/* /mnt/gentoo/usr/portage/distfiles/   #(copy over distfiles)

#nano -w /mnt/gentoo/etc/make.conf (Optional: edit make.conf)

cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf   #(Copy over nameserver information)

mount -t proc none /mnt/gentoo/proc   #(Mount the proc filesystem)

mount -o bind /dev /mnt/gentoo/dev  #(Mount-bind the /dev filesystem)

cp /mnt/cdrom/step3 /mnt/gentoo    #(Copy over the step3 script)

echo "

Now you can run step3!"

chroot /mnt/gentoo /bin/bash   #(Chroot into the new environment)
```

step3

```
#!/bin/bash

env-update && source /etc/profile   #(Load the necessary variables)

export PS1="(chroot) $PS1"

emerge --metadata   #(Build the Portage cache to speed up future emerges)

cp /usr/share/zoneinfo/Hongkong /etc/localtime   #(Set timezone information)

#nano -w /etc/make.conf   #(Optional: edit make.conf)

emerge genkernel   #(prepare to compile a kernel)

USE="-doc symlink" emerge gentoo-sources   #(install a kernel source)

genkernel --menuconfig all   #(save your config when exit)

emerge coldplug   #(install coldplug)

rc-update add coldplug default   #(Add it to the default runlevel)

nano -w /etc/modules.autoload.d/kernel-2.6 #(List the modules you want automatically loaded)

nano -w /etc/fstab    #(edit fstab)

nano -w /etc/conf.d/hostname   #(Set the system hostname)

nano -w /etc/conf.d/domainname   #(Set the system domainname and NIS domain name)

rc-update add domainname default

echo 'config_eth0=( "dhcp" )

dhcp_eth0="nodns nontp nonis"' >> /etc/conf.d/net

rc-update add net.eth0 default

nano -w /etc/hosts

echo "Have fun with Gentoo!

" >> /etc/issue   #(Set the greeting message)

echo "

Now you need to set your root password!"

passwd

echo "tts/0" >> /etc/securetty   #(Let root to be able to log on through the serial console)

nano -w /etc/rc.conf   #(Further system configurations)

#nano -w /etc/conf.d/keymaps   

nano -w /etc/conf.d/clock

emerge syslog-ng   #(Installing a system logger)

rc-update add syslog-ng default

emerge slocate   #(Installing File Indexing tool)

emerge reiserfsprogs   #(Installing File System Tools)

#emerge xfsprogs

emerge dhcpcd   #(Installing a DHCP Client)

#emerge grub   #(If you want to keep your Grub-for-Dosï¼skip the following)

#cat > /boot/grub/grub.conf << "EOF"

#echo "default 0

#timeout 15

#color cyan/blue white/blue

#title=Gentoo Linux 2.6.12-r10

#root (hd0,2)

#kernel /boot/kernel-genkernel-x86-2.6.12-gentoo-r10 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev

#initrd /boot/initramfs-genkernel-x86-2.6.12-gentoo-r10

#

#title=Windows XP

#rootnoverify (hd0,0)

#makeactive

#chainloader +1

#EOF

#grub

echo "OK, your system is ready, now you may exit and reboot!"
```

Before you proceed, you need to prepare some partitions for Gentoo.  You may use Partition Magic in Windows or you can use fdisk once you boot into the installation environment. The usage of fdisk is described very well in the handbook.

Now boot with the Grub entry 'Gentoo Livecd'.  After getting into a root shell, you may proceed as described in the handbook. Note that the stuff in /mnt/cdrom are just the files and directories on that vfat partition (here /dev/hda5)

Or alternatively, you may want to try the following semi-auto way.  First, execute the 'step1' script:

```
# /mnt/cdrom/step1
```

After setting up time for your environment as instructed, execute the 'step2' script:

```
# /mnt/cdrom/step2
```

When you see the message 'Now you can run step3!', you're in the chroot environment.  Now execute the 'step3' script:

```
# ls           (to see you're in the chroot environment)

#./step3
```

You'll be promted to edit /etc/fstab, change root password, configure kernel and so on.  Unless your machine is very slow, the whole installation process takes less than 1 hour.  Try to keep things as simple as possible, once your base system is up, you can always take your time and configure it into anything you want it to be.  :Smile: 

----------

## syncale

[burns verbose mode] Excellent!!!! [/burns verbose mode]

the thing is that debian has a installer for windows...it runs under dos....

bye

----------

## bustersnyvel

 *syncale wrote:*   

> the thing is that debian has a installer for windows...it runs under dos....

 

LOL New howto:

 Install Debian using the installed mentioned above

 Install Gentoo from Debian

 :Razz: 

----------

## tuxlover

Why don't you put this article in the Gentoo Wiki? So it can even be found by search engines and the likes...

----------

## Chaosite

 *tuxlover wrote:*   

> Why don't you put this article in the Gentoo Wiki? So it can even be found by search engines and the likes...

 

Actually, Google indexes this forum.

But its nice when other people can improve and maintain the HOWTO on the wiki.

----------

## kohno

You know what, I'm gonna to add an entry to my grub.conf, and copy that 'isolinux' directory to my /boot.  It's like you suddenly have a Damn Small backup system (only 8.4MB) which you can use to to do system maintenance work.  :Smile: 

 *Hauser wrote:*   

> 
> 
> First you need to download a 1.2 minimal iso (I can't get it to work with other liveCDs, if you know how to do it, please tell me) which is about 16MB:

 

I think Gentoo developers should modify the 'linuxrc' init embedded in the 'gentoo.igz' file of the new LiveCDs so people can boot the LiveCD directly from harddisk like you can do with the 1.2 one.

----------

## NetTrodon

Or if you have a lot of patient try with zipslack.

Cited from http://www.slackware.com/zipslack/ :

 *Quote:*   

> ZipSlack
> 
> ZipSlack is a special edition of Slackware Linux that can be installed onto any FAT (or FAT32) filesystem with about 100 MB of free space. It uses the UMSDOS filesystem and contains most of the programs you will need. This means that you do not need to repartition your hard disk if you already have DOS or Windows installed. ZipSlack installs into a directory on your DOS filesystem. It can also be installed to and booted from a Zip disk.
> 
> This distribution is ideal for people who don't have a lot of hard disk space, do not have a fast Internet connection to download the entire distribution, or who want a Linux distribution they can carry around on a Zip disk. 

 

and then install with the procedure above for install gentoo form other linux distribution (In google are some examples too).

ftp://ftp.cerias.purdue.edu/pub/os/slackware/slackware-10.0/zipslack/zipslack.zip (more less 40 MB)

http://www.slackware.com/faq/do_faq.php?faq=zipslack

PD. I unknow if zipslack contain the chroot command. I only know wich the chroot is in de /a directory in the cd by the package coreutils (also you can download from a mirror of slackware).

----------

## Hauser

OK, here's a substitute for the 1.2 minimal iso which involves a bigger download but nicer installation environment, the Knoppix.  :Smile: 

I've tried the 3.6 CD.  Like before, you extract and copy over the 'isolinux' directory (it's in the boot directory) to a vfat partition, you also need to copy over the 'KNOPPIX' directory which is quite big.  Then write your grub entry like this:

```
title Knoppix26 From HD

root (hd0,6)

kernel /isolinux/linux26 ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce BOOT_IMAGE=knoppix

initrd /isolinux/minirt26.gz
```

You'll see it boots exactly like booting from a CD drive, only slightly faster.  :Smile: 

----------

## kimchi_sg

@Hauser: Can you provide a mirror link to Grub 4 DOS? The link you posted seems to be down.

----------

## Hauser

 *kimchi_sg wrote:*   

> @Hauser: Can you provide a mirror link to Grub 4 DOS? The link you posted seems to be down.

 

This is the GRUB4DOS project page on SourceForge.net:http://sourceforge.net/projects/grub4dos/  :Smile: 

----------

## l-bartos-l

Isn't there a way to boot the iso right away from GRUB | GRUB4DOS?

----------

## kimchi_sg

 *l-bartos-l wrote:*   

> Isn't there a way to boot the iso right away from GRUB | GRUB4DOS?

 

This is not possible as the iso boots only when burned onto a CDROM. An iso contains special "boot sector" info to boot the system that is used only when the iso properly burnt onto a CD. And if you want to boot from a CD, this topic is not for you.

----------

## l-bartos-l

 *kimchi_sg wrote:*   

>  *l-bartos-l wrote:*   Isn't there a way to boot the iso right away from GRUB | GRUB4DOS? 
> 
> This is not possible as the iso boots only when burned onto a CDROM. An iso contains special "boot sector" info to boot the system that is used only when the iso properly burnt onto a CD. And if you want to boot from a CD, this topic is not for you.

 

I understand, but if you can make some sort of loopback device and then mount the iso on the device. Or with some kind of a kernel and then boot a iso? It would be alot easier for devs of livec's, etc. I mean not only linux iso's...

----------

## kimchi_sg

 *l-bartos-l wrote:*   

> I understand, but if you can make some sort of loopback device and then mount the iso on the device.

 

Loopback device? Too linux-ish! Do not forget, we are talking about *ahem* a Windows environment here.  :Smile: 

 *l-bartos-l wrote:*   

> Or with some kind of a kernel and then boot a iso?

 

Isn't booting a kernel what we're trying to do in this thread? Also, you don't need to download a big fat ISO in this method.  :Very Happy: 

----------

## l-bartos-l

Hi,

for an example:

I extracted the kernel and  the init thingy from a knoppix iso putted in my c:\Grub\boot\knoppix.37 (on a ntsf partition) and added the following to my menu.lst from WINGRUB:

```
title Knoppix 3.7 kernel 2.6 from NTFS hda1 ISO scan ramdisk=32MB

kernel (hd0,0)/Grub/boot/knoppix.37/linux26 ramdisk_size=100000 init=/etc/init lang=be apm=power-off vga=791 nomce quiet bootfrom=/dev/sda1/Grub/boot/Knoppix.37/knoppix37.iso config=scan home=scan ramdisk=32768 noprompt

initrd (hd0,0)/Grub/boot/knoppix.37/minirt26_ntfs.gz

boot
```

This works because knoppix supports it, no need to make a partition for the distro it just makes a loopback device and mounts the iso (from a ntfs partition) on it. After that its like your booting from a cd. I know it works because I am posting this message from it. NOW my question is. Can't this be donne with other bootcd(for example booting ubcd - ulimate bootcd) iso's

----------

## TMiegel

Hi,

i've successfully booted Knoppix 3.8.1 with these tipps from my harddisk.

But you can't chroot into a AMD64-enviroment  :Crying or Very sad: 

Now i am trying to get the AMD64-LiveCD 2005.0 boot from my hd.

But i have problems with the correct entry in the menu.lst:

```
title Knoppix

root (hd0,7)

kernel /isolinux/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/livecd.squashfs udev nodevfs  cdroot vga=791 dokeymap splash=silent,theme:livecd-2005.0

initrd /isolinux/gentoo.igz
```

It is booting but it can't find the root-filesystem and puts me into the minimal shell.

Any hints on this?

----------

## Bertil

I tried this and it worked good.

But I just have one vfat-partition on my hard drive, så I can't copy the distfiles from the partition to the gentoo-partition, becuse I just have one, and if I create the gentoo-partition the partition with the distfiles destroys.

So I thaught I could copy the distfiles from my USB-pen to the gentoo-partition, but I can't mount my USB-pen, becuse there is no such /dev/sda*.

How can I fix that in gentoo 1.2 install cd?

modrobe usb-storage does'nt work.

----------

## Hauser

 *Bertil wrote:*   

> But I just have one vfat-partition on my hard drive, så I can't copy the distfiles from the partition to the gentoo-partition, becuse I just have one, and if I create the gentoo-partition the partition with the distfiles destroys.

 

Are you saying there's only one partition on your harddisk? If that's the case, you need to shrink the partition to make some space for Gentoo.

 *Bertil wrote:*   

> So I thaught I could copy the distfiles from my USB-pen to the gentoo-partition, but I can't mount my USB-pen, becuse there is no such /dev/sda*.
> 
> How can I fix that in gentoo 1.2 install cd?
> 
> modrobe usb-storage does'nt work.

 

Try Knoppix instead of Gentoo 1.2 iso.

----------

## Bertil

Yes, I'm trying with knoppix 4.0 now, but grub can't find mi minitr, the location to minitr is /knoppix/boot/isolinux/minitr, the same directory as my kernel, and the kernel works to load.

If I boot then, I've got "Kernel panic - VFS: Unable to mount root fs on unknown-block(1,3).

----------

## Hauser

I just tried knoppix 4.0, now I'm writing this post in Konqueror from the boot-up system. After copying two directories, i.e. "KNOPPIX" and "boot" (which contains the "isolinux" directory), onto a vfat partition (in this case /dev/hda6), I wrote the grub entry as follows:

```
title Knoppix From HD

root (hd0,5)

kernel /boot/isolinux/linux ramdisk_size=100000 init=/etc/init lang=us apm=power-off vga=791 nomce BOOT_IMAGE=knoppix

initrd /boot/isolinux/minirt.gz
```

----------

## Bertil

Thanks, it worked.

How do I configure grub so I use fluxbox insted of KDE?

----------

## Hauser

 *Bertil wrote:*   

> Thanks, it worked.
> 
> How do I configure grub so I use fluxbox insted of KDE?

 

Try adding "desktop=fluxbox" to the the entry. All the available options are in the boot/isolinux/f3 file. Some options may not work though.

----------

## Bertil

You said that I should shrink my windows-partition, how do I easiest do that?

Do knoppix have any programs for that?

----------

## Hauser

 *Bertil wrote:*   

> You said that I should shrink my windows-partition, how do I easiest do that?
> 
> Do knoppix have any programs for that?

 

Knoppix comes with qtparted. Make sure you backup your data first.

----------

## Hauser

The 2006.0 LiveCD comes out, it comes with Gnome-2.12, finally we have a Knoppix-equivalent liveCD, now we can install Gentoo in a graphical environment!  :Very Happy: 

Grub entry for harddisk boot:

```
title=Gentoo-2006.0-livecd

root (hd0,4)

kernel /isolinux/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/image.squashfs cdroot=/dev/hda5 vga=791 splash=silent,theme:livecd-2006.0 CONSOLE=/dev/tty1 quiet

initrd /isolinux/gentoo.igz
```

The funny thing is you need that empty file 'livecd' for the init to treat /dev/hda5 to be a cd!

P.S. It also works for the minimal install CD, but of course you won't get GUI.

----------

## planetsheinker

 *Hauser wrote:*   

> The 2006.0 LiveCD comes out, it comes with Gnome-2.12, finally we have a Knoppix-equivalent liveCD, now we can install Gentoo in a graphical environment! 
> 
> Grub entry for harddisk boot:
> 
> ```
> ...

 

What is this "empty file 'livecd'" you are talking about?

----------

## Hauser

 *planetsheinker wrote:*   

>  *Hauser wrote:*   The 2006.0 LiveCD comes out, it comes with Gnome-2.12, finally we have a Knoppix-equivalent liveCD, now we can install Gentoo in a graphical environment! 
> 
> Grub entry for harddisk boot:
> 
> ```
> ...

 

It's a file on the 2006.0 LiveCD.

----------

## hahaghost

The size of the live-cd is too big for me.

If I want to use the minimal-install-cd(2006.0),What should I do? How to write the Grub entry for harddisk boot?

thx  :Embarassed: 

I want to write like this:

```
title=Gentoo-2006.0-install-minimal 

root (hd0,4) 

kernel /isolinux/gentoo root=/dev/ram0 init=/linuxrc looptype=squashfs loop=/image.squashfs cdroot=/dev/hda5 vga=791 CONSOLE=/dev/tty1 quiet 

initrd /isolinux/gentoo.igz
```

Should I?

Any idea?

----------

## Hauser

 *hahaghost wrote:*   

> The size of the live-cd is too big for me.
> 
> If I want to use the minimal-install-cd(2006.0),What should I do? How to write the Grub entry for harddisk boot?  thx 
> 
> I want to write like this:
> ...

 

It looks correct, just give it a try.  :Smile: 

----------

## Hauser

Now you can boot the gentoo-based SystemRescueCD (at least 0.2.19) from harddisk. It's perhaps a better alternative to the official livecd, because it has all sorts of system tools and especially you can run qtparted with it,  All you need to do is to create a directory called "sysrcd" on a partition (with vfat or linux native filesystems) and copy over 3 files on the CD:

```
# mount /dev/hda5 /mnt/gentoo   #Suppose you use /dev/hda5

# mkdir /mnt/gentoo/sysrcd

# mount -o loop /path/to/systemrescuecd-x86-0.2.19.iso /mnt/cdrom 

# cd /mnt/cdrom

# cp -v sysrcd.dat isolinux/vmlinuz1 isolinux/initrd1 /mnt/gentoo/sysrcd

```

Then write a grub entry like this:

```
title    SystemRescueCD

kernel   (hd0,4)/sysrcd/vmlinuz1 root=/dev/ram0 vga=791 bootfrom=/dev/sda5 init=/linuxrc setkmap=us

initrd   (hd0,4)/sysrcd/initrd1
```

Then you're good to go!  :Smile: 

----------

## Hauser

Grub for dos also works for ntfs partitions. Download the zip file here: http://sarovar.org/projects/grub4dos/. Extract it somewhere, then copy grldr and a sample boot\grub\menu.lst to the directory C:\. To run GRUB from Windows' bootloader, append the following line to your C:\boot.ini file:

 *Quote:*   

> C:\grldr="Start GRUB"

 

To edit this file,

1. Right-click My Computer, and then click Properties. 

2. On the Advanced tab, click Settings under Startup and Recovery.

3. Under System Startup, click Edit. This opens the file in Notepad ready for editing.

----------

## plq

trying this setup with 2006.1, the initrd is not able to boot the vfat partition, /dev/hda2 in my case. dmesg says that cp437 is not found.  2006.0 boots fine.

it is the default charset for a vfat partition, i think somebody just forgot to put it in.

also, -correct me if i'm wrong here- following this procedure, i think one should not forget that the filesystem of the partition that houses the contents of the livecd can't be changed until reboot. i'd allocate a gigabyte for the  temporary vfat and then use it as swap later.

----------

## shaumux

Hi

I tried this method using the 2006.1 cd but it isn't working

It says that it can't find the cd

Wat should i do

Plz HLP

THNX

----------

## Myelin

This method is not working for 2006.1. Root block device is not found by the Boot. 

Is there a way to start the installer by mounting manually into newroot from shell and then chroot into the newroot. Any way to extract and run the installer from image.squashfs from there?

Thanks for any help.

----------

## Myelin

I finally bought a CD-RW and installed Gentoo 2006.1 after unsuccessful search for Poor mans install for 2006.1.  :Smile: 

----------

