I have an older machine with a failing cdrom drive. Because of this I'm having a hard time installing Gentoo on the system. I wanted to run a proposed work around past you and see if it makes sense.

Using another Linux machine (running Ubuntu) I was going to install Gentoo into a folder on that machine. By that I mean: create a folder and put stage 3 files in it along with the portage snapshot, chroot into the folder, build the kernel (with Genkernel), install system tools, and basically everything in a standard install short of writing to the MBR.

Once I have that environment set up I would throw it into a tarball. Then I would boot up the target machine via a Linux boot disk (it can do this for short periods of time), setup the partitions, deploy that tarball, and write out to the MBR.

In my head this all seems to make sense. What do you think? Would I run into problems with any of the compiles of the kernel or system tools?

Thanks in advance!

Update 5/11: The target machine is a laptop from 1997. While it does have a USB port it cannot boot from it. The cdrom drive is difficult to remove and does not have a standardized connector. While the hard drive is easily removable I do not have a way to connect a 2.5" IDE drive to any of my other computers.

Some of these issues can be solved by throwing a little bit of money at the machine but I rather not put any money into a machine this old.

And, before you ask, I plan on using this machine mostly as a typewriter--the keyboard has a great feel to it.

5 Answers
5

You can do this without problems if you know what you're doing. You only need to watch about partition sizes (don't use more space then you have on your target machine's hdd), you have to compile the kernel for the target machine (select the drivers etc. for the target machine, not the machine you're using to compile it), and don't forget to check the /etc/fstab and fix it, if necessary on the target machine.

After you unpack the tarball, don't forget to install the bootloader.

You wont have any problems compiling your programs, as long as the same architecture is used (x86, x86_64,...).

I did something similar a couple of years ago, when I migrated the Gentoo install from one PC to another. I needed to recompile the kernel, since it was built for the first PC (didn't have correct SATA controller drivers compiled in), but everything worked.

If you find it easier, you can also take the HDD from the target machine and put it into another machine an directly work there. You can also install the bootloader that way (just watch out, since you're probably booting from /dev/sda, target HDD will be /dev/sdb, and you want to write the MBR to /dev/sdb, while it's root=/dev/sda1 (or whatever it will be called on the target machine)

It does make sense. You could run into problems of course, due to the hardware being different for one. You could have the wrong modules loaded, or you could have the wrong partition order in /etc/fstab, or you could compile your system with the wrong CFLAGS preventing binaries from running on the older machine after copying. But as long as you know what you are doing, I don't see why it should not be possible.

No, this solution does not make sense. If you're serious about getting things to work the right way, look into acquiring a USB DVD drive or simply replacing the existing media drive in the system. That is what I would do for the sake of time and it's probably he least complicated option.

I'm not familiar with Gentoo but most distributions allow you to install from disk, PXE as was proposed by @ewwhite, or if you can boot from USB you could use a Live USB stick.

But I agree that you're probably better off getting a replacement CDrom or even DVD drive. You can get a CDrom drive for as little as $30. The time you would spend trying to get your proposed solution to work is probably much more valuable than that.

If you know what you are doing (get the hardware parts right and don't mess up with compiler flags), all of that should go OK. Actually that's quite near what I have experimented in the past with Gentoo.