LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Installing linux completely from hard disk (https://www.linuxquestions.org/questions/linux-software-2/installing-linux-completely-from-hard-disk-646158/)

talkinggoat 05-31-2008 11:41 PM

Installing linux completely from hard disk
 
I have a laptop that has no cdrom or floppy and won't boot from usb. My only option is to install directly from the hard disk.

I have read and re-read the directions on how to do this, but they all involve using windows, which I don't use, or booting from an existing Grub/Fedora installation. I'm using a fresh hard disk, which I want to remove, then install into the laptop so the setup can continue on it.

I tried installing to the disk using a computer that has a cd-rom, but it didn't work, when I brought the drive back over. Why would it be that simple?

I've tried setting up the partitions /dev/hda1 with the /boot and /boot/grub directories. In the boot drive, I moved the vmlinuz and initrd.img files. In the grub folder, I made a menu.lst file. I set the /dev/hda1 partition as active using fdisk. I still get grub error 21.

All the help on this says to use grub-install /dev/hda, but that does nothing for me.

I know that microsoft built their installer to do this, It has to be possible; It's Linux.

r00tb33r 06-01-2008 12:41 AM

As I understood you have another machine that has a CD-ROM drive that allows you do an initial install on the laptop without removable drives.
What I would do is install a live type distro on the drive, because it does hardware detection on every boot, so it work on both of your machines from this drive. Either extract the image (iso?) of the final distro, you want Fedora I believe, or simply mount it, and run the installation script / installer of that distro. You might need 2 different linux partitions though because you might not be able to overwrite the live distro that runs your installer.
I'm not sure how you could merge the partitions afterwards with plain linux, but I would have used something like Partition Magic or Acronis Disk Director, since I don't know any linux tools that resize partitions.
Let us know if you get anywhere.
If you need a suggestion on a live distro that can run off a hard drive, there are plenty out there, but here are some of the ones I have used:
Knoppix (recommended)
Damn Small Linux (somewhat limited due to size, 2.4 kernel)
Backtrack 2 (offensive network security suite, I don't recommend version 3 beta just yet)

Good luck.

pinniped 06-01-2008 12:58 AM

You're right to install grub to 'hda1' rather than 'hda'. The partition needs to be marked as 'bootable', but that seems to be the case or else I wouldn't have expected to see a grub message at all. The next issue is setting up the 'menu.lst' correctly. Also, I would recommend a 'bare' system - only the kernel, GNU tools and libs, and bits that are absolutely necessary to get the machine to boot. Once you've got it booting, you can finish off the installation by adding other stuff.

In other words:
1. plug that HD in, and install just as if you were going to install to that computer - except you do a minimal install - no goodies yet.
2. Make sure that install machine boots nicely, then edit the 'menu.lst' file to hold values that you would expect on the final machine. For example, if I installed on a machine that also has 'hda' then the menu.lst will probably have 'hd(1,0)' (hdb1) or some such - you need to change all that before putting the HD back into the final machine.

blackhole54 06-01-2008 01:28 AM

As I interpret this, error 21 that you are describing would correspond to Selected disk does not exist. If you can get to the GRUB command prompt I suggest you use the find command to have GRUB tell you where it thinks your installation is (using the computer that is giving you the errror). Perhaps look for menu.lst or grub.conf (you will have one or both in you grub directory. You have to give the full path from the root of the partition. So the command will depend on how you partioned the disk. If you have a separate /boot partition, the command would look like one of:

Code:

find /grub/menu.lst
find /grub/grub.conf

If you don't have a separate /boot partition then you would need to add /boot to the beginning of those paths.

Normally you can get to the GRUB command line by hitting the "c" key while the menu is displaying. However, when it gives you that error, it might dump you into the command line w/o doing anything. I've never had the dubious "pleasure" of finding out. If the menu doesn't display automatically, you can make it visible by pressing the escape key immediately after the powerup tests. Or you can remove hiddenmenu from menu.lst/grub.conf.

EDIT: If you can find out where GRUB thinks the partition is, you should be able to boot it from the GRUB command line using the same commands that are in menu.lst/grub.conf after adjusting for the new location. If you get the computer booted then you can can make the changes permanent by editing menu.lst/grub.conf.

jschiwal 06-01-2008 01:43 AM

Can you get into the grub shell when you try to boot up? If you can, you can manually enter the "kernel " & "initrd " lines and use tab completion to locate the kernel. By the way, without usb booting or a floppy or cdrom, the windows installer won't do you any good either.

Your best bet may be to run the installation with the drive installed on a second computer. Use the MBR of the new drive for booting. You will need to adjust the /boot/grub/menu.lst file so that the references refer to (hd0) instead of (hd1), and don't let the install process use the swap partition of the host computer (on hd0 during the installation).

By the way, in a TWiT FLOSS Weekly interview with "Mad Dog" Hall, he mentioned meeting Linus. Linus helped a co-working install Linux on a machine and it was the first time he had installed Linux from a CDROM. His computers didn't have one and he would install Linux on a hard drive and then install the hard drive on the host machine.

Yet another option in your case is if the computer supports PXE lan booting. You could load the installer from an tftp server. Many distro's have instructions to do this on their websites. There is work to be done on the system that already has Linux on it to do this but it would allow installing over the network on a machine with a totally blank hard drive.

talkinggoat 06-03-2008 02:58 PM

I made a set of directions and put them on my company website for anyone to download here

IsaacKuo 06-03-2008 03:51 PM

I recently did a Debian 4.0 install like this for an old Toshiba Libretto 70CT. This micro-laptop had no floppy, no CD-ROM, no USB, nothing like that.

I simply removed the hard drive from the Libretto and put it in another laptop. I did the install, as normal. Then I put the hard drive back into the Libretto.

There were a couple things that needed to be reconfigured. Namely, I had to reconfigure X and I had to reconfigure sound. I manually edited xorg.conf, rather than use the xorg configuration utility, because that's what I'm used to. For sound, I just ran "alsaconf".

Whenever I want to install more software, I simply remove the hard drive and put it in the other laptop. Then I use "apt-get" to install whatever software I want.

talkinggoat 06-03-2008 05:09 PM

I had tried doing that, but it didn't work. The 2 machines were too dis-similar. Thanks.

IsaacKuo 06-03-2008 05:22 PM

The two laptops I used were extremely dis-similar. Fortunately, they both used x86 compatible processors (neither was an old MacBook). Other than that, there was no commonality. The old Libretto had no PCI or AGP; all of the on board hardware was ISA based.

That does remind me of one other thing I had to do. By default, the Debian installer detected the processor type as something non-ancient and defaulted to the 686 kernel (Pentium II and above). However, my Libretto was an older Pentium, so I had to manually install the 486 kernel.

Generally, I find Debian rather forgiving about moving between hardware configurations.

pinniped 06-03-2008 05:34 PM

"I had tried doing that, but it didn't work. The 2 machines were too dis-similar. Thanks."

How dissimilar? If you install only a base system with an i386 kernel, you can run on any Intel family CPU from 386 onwards. You can always install the other goodies after transferring the HD back to the other computer. If the other computer has no networking, you can even install and image of the CD on the HD and effectively continue installing all the goodies like the GUI from the CD image later.

So - once you get the thing booting to a command prompt, everything else is trivial; you just have to get that thing booting and you can come back and ask us about other tricks.


All times are GMT -5. The time now is 08:36 AM.