LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-31-2008, 11:41 PM   #1
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Rep: Reputation: 15
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.
 
Old 06-01-2008, 12:41 AM   #2
r00tb33r
Member
 
Registered: Feb 2007
Distribution: Vector
Posts: 318

Rep: Reputation: 31
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.

Last edited by r00tb33r; 06-01-2008 at 12:43 AM.
 
Old 06-01-2008, 12:58 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 06-01-2008, 01:28 AM   #4
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
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.

Last edited by blackhole54; 06-01-2008 at 01:32 AM.
 
Old 06-01-2008, 01:43 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 06-03-2008, 02:58 PM   #6
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
I made a set of directions and put them on my company website for anyone to download here
 
Old 06-03-2008, 03:51 PM   #7
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
Old 06-03-2008, 05:09 PM   #8
talkinggoat
Member
 
Registered: Sep 2003
Location: lafayette, la
Distribution: RHL 6.2, FC 3, Ubuntu 14.04, Ubuntu 16.04
Posts: 112

Original Poster
Rep: Reputation: 15
I had tried doing that, but it didn't work. The 2 machines were too dis-similar. Thanks.
 
Old 06-03-2008, 05:22 PM   #9
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
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.
 
Old 06-03-2008, 05:34 PM   #10
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
"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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Linux on seperate hard disk Priyanshu Linux - Laptop and Netbook 2 04-19-2007 02:48 PM
Installing linux on empty hard disk lngmn7 Linux - Networking 4 04-15-2005 06:24 AM
installing linux from hard disk phoenix7 Linux - Distributions 5 03-04-2005 09:51 AM
installing linux in an external hard disk Arythan Linux - Newbie 1 08-31-2004 05:22 AM
installing linux onto second hard disk fobius Linux - Software 2 02-22-2004 01:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration