LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 12-01-2007, 09:58 PM   #1
JOnkka
LQ Newbie
 
Registered: Dec 2007
Distribution: SUSE 10.2
Posts: 11

Rep: Reputation: 0
How to install system to a drive to be used on another machine.


I am trying to build a Linux system on a drive to be used on a laptop that I cannot as yet boot. I need to be able to build the boot sector and then the whole system. I have access to the drive as a USB. The 2.5 - 3.5 adapter I got does not work. So at the moment I am stuck with the USB.

Help.
 
Old 12-02-2007, 04:32 AM   #2
DragonSlayer48DX
Registered User
 
Registered: Dec 2006
Posts: 1,454
Blog Entries: 1

Rep: Reputation: 75
Will the laptop boot from CD? It should, unless it's pretty old. Once you boot from the Linux install CD, the installer will set up the boot sector, boot loader, etc. for you. Installing via another computer is not a good idea... you'll have all the wrong drivers installed as the installer will configure the OS for the machine from which the CD booted, and it most likely won't even work.
 
Old 12-02-2007, 08:28 AM   #3
JOnkka
LQ Newbie
 
Registered: Dec 2007
Distribution: SUSE 10.2
Posts: 11

Original Poster
Rep: Reputation: 0
The bios will let it boot from hdd or fdd. That reads floppy. I do not have the floppy drive. A floppy does not interest me. I do not have an hdd drive to boot from as yet.

It is a Toshiba Tecra 500cdt. It has a CD drive. No boot. I have a 100GB drive to fit into it. Just got to load SUSE onto it so I have a way to boot. 2.5 USB drive adapter. Really cool.

Last edited by JOnkka; 12-02-2007 at 08:29 AM.
 
Old 12-02-2007, 08:49 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Go to the SuSE 10.3 wiki. There is a way to install a boot image on the drive, and an image in it's own partition. Then you can install the drive in the target machine, and boot to start the installation process using the dvd image as the installation source. The image could be setting on the network share instead as well. I keep an image of the 10.3 dvd on my system and use that as an installation source. My DVD drive is flackey. In your case, you don't have a dvd drive on the second computer. If you do on your first, having a single dvd image downloaded may be more convenient.

---

I think that if you followed the boot from usb drive, but used this hard drive instead, you could pop it in the other machine and power up to start the installation process.
Quote:
This assumes that the usb stick is /dev/sda with an active partition /dev/sda1 and 12 megs of available space.

i386

umount /dev/sda1
mount -o loop openSUSE-10.3-GM-i386-mini.iso /mnt
/mnt/boot/i386/mkbootdisk --32 --partition /dev/sda1 /mnt

x86_64

umount /dev/sda1
mount -o loop openSUSE-10.3-GM-x86_64-mini.iso /mnt
/mnt/boot/x86_64/mkbootdisk --64 --partition /dev/sda1 /mnt

Boot the stick and follow other directions in 'Running the Setup' to load a network card driver and specify network settings to reach a network-hosted copy of the install media.


At the end of the install, the grub boot loader mbr may be written to the stick instead of the hard disk. Just leave the stick in and reboot the machine. It will boot into the new installed OS instead of the miniboot install menu. Go into yast, system, boot loader, boot loader installation. Select the appropriate device for your installation, Finish. Now the machine will boot itself without the stick installed.
http://en.opensuse.org/Installation_without_CD

Another thing you could try is to mount the drive in the first machine, and then to to YaST2 and select Install into Directory. Make sure you make the drive bootable if it isn't. ( I think the installation will allow you to do that. It's what you would to to install to a bootable removable device such as a usb or usb-pen drive.

Last edited by jschiwal; 12-02-2007 at 09:11 AM.
 
Old 12-02-2007, 09:14 AM   #5
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 116Reputation: 116
The distros I have seen tend to place every driver they have on the hard drive. The distros that tend to be easier to use (Ubuntu, Mandriva for instance) will autodetect hardware on startup and will both load the relevant drivers AND adjust the relevant configuration files (I find this to be often quite annoying). This makes it simple enough to move the drive to a different machine; the distro will handle the details.

The one place you'll have any difficulties will be with the bootloader. If you install the system on a USB HD, then move that HD into the laptop, the pointers in menu.lst will be wrong and grub won't start.

The way you handle this is to do your install to the USB drive, make sure grub is installed on that drive, then manually edit the file /mountpoint/boot/grub/menu.lst (you might also need to edit /mountpoint/boot/grub/device.map - we'll get to that in a minute). In this example, /mountpoint is the place in your system where the usb drive is mounted, of course.

The menu.lst file may have multiple entries, pointing to your currently running linux installation as well as your new installation. You would want to completely delete the references to your current running installation.

Let us assume that your USB 2.5" drive is a PATA drive. In the usb case, it will be known on your system as, say, sdc (this assumes your system has two other drives, either SCSI or SATA, that are known respectively as sda and sdb). Therefore, your USB drive is the third drive in your system. In grub-speak, it will be known as drive 2 because grub starts counting at zero, thus sda is drive 0.

Since your 2.5" drive is PATA, it will become known as hda when it is installed in your laptop. Further, since your laptop will have only one drive, it will be drive 0 in grub-speak.

So, when you edit menu.lst, you will find lines that looks something like this:
Code:
title linux
kernel (hd2,0)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/sdc1 devfs=mount hda=ide-cd hdb=ide-cd acpi=off resume=/dev/sdc2
initrd (hd2,0)/boot/initrd.img
These lines assume your linux installation is in the first partition on the usb drive, with swap in the second partition on that drive (the resume= option).

Given that you have configured your drive that way, you would change these lines like this:
Code:
title linux
kernel (hd0,0)/boot/vmlinuz BOOT_IMAGE=linux root=/dev/hda1 devfs=mount hda=ide-cd hdb=ide-cd acpi=off resume=/dev/hda2
initrd (hd0,0)/boot/initrd.img
After you make this change and save it on the USB drive, you then should take a look at the device.map file (if it exists). It should have only one line in it, and that line should say:

Code:
(hd0) /dev/hda
When you change device.map to say just this, then save it, your drive should be ready to go into the laptop. Do whatever BIOS things are required to mark it as a boot device, and you should be good to go.

When the system comes up, if there are driver issues you'll know about it and can do the appropriate things then.
 
Old 12-02-2007, 11:07 AM   #6
JOnkka
LQ Newbie
 
Registered: Dec 2007
Distribution: SUSE 10.2
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks.

That sounds fairly doable. The laptop does not have USB but making the drive in USB adapter bootable and then placing the drive in the laptop to go sounds good.

May be a couple days.
 
Old 12-04-2007, 08:51 AM   #7
JOnkka
LQ Newbie
 
Registered: Dec 2007
Distribution: SUSE 10.2
Posts: 11

Original Poster
Rep: Reputation: 0
OK. I've been studying on this a bit now and I think I'm missing a piece.

How do I build the boot sector?

In DOS(damned old system) the command was:FORMAT /S D:\

Then edit autoexec.bat.

I'm seeing how to build the autoexec.bat portion but not where/how I actually build the boot sector.

I can partition the drive with swap and ext3 and copy files to it. Edit files. What all files and directories will it need to start up the install?

You may have stated it, but I'm not seeing it.

Some days you need to hit me up the side of the head with a 2X4.

Here' what I'm seeing:

Build boot sector. How do I get grub into it?
Make partitions swap and ext3.
Copy in files. Those being the basic start files. Copy in the install iso.
# cp /path/to/source/boot/loader/initrd /boot/inst-initrd
# cp /path/to/source/boot/loader/linux /boot/inst-linux

/boot/grub/menu.lst
title Install SUSE
root (hd0,1)
kernel /boot/inst-linux
initrd /boot/inst-initrd

Is that close?

I will probably use konqueror. I was using UNIX 25 years ago. Back before vi came out. I still remember the ed commands. The GUIs today are much more intuitive. I started playing in Linux about ten years ago as a LAN administrator looking for a better workstation. Windows was a pain. I never learned the startup pieces. Just played with the installs.
 
Old 12-04-2007, 02:37 PM   #8
JOnkka
LQ Newbie
 
Registered: Dec 2007
Distribution: SUSE 10.2
Posts: 11

Original Poster
Rep: Reputation: 0
Look what I found:
Installing the grub boot record:
# cd /usr/lib/grub/i386-pc
# dd if=stage1 of=/dev/fd0 bs=512 count=1
1+0 records in
1+0 records out
# dd if=stage2 of=/dev/fd0 bs=512 seek=1
153+1 records in
153+1 records out
#


It's starting to make sense.

Information found in "info grub"
"man dd" showed what was happening. This is starting to look like fun.

Last edited by JOnkka; 12-04-2007 at 02:47 PM.
 
  


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
RedHat 9 Install Problems on system with Serial ATA Hard Drive thad.ponchak Linux - Newbie 3 10-17-2006 08:14 AM
Can't boot with SUSE 9.3 - trying to install on system with IDE drive and SADA drive tbering Linux - Kernel 1 05-30-2006 11:35 AM
Linux install on XP system(2nd drive) Does the Recycle Bin get blown away? traindo1 Linux - Newbie 4 05-04-2005 10:38 AM
How to install a new hard drive on to existing system ksgill Linux - Newbie 3 02-07-2005 12:17 AM
install fedora with "L:" drive on Winxp machine linuxcharlie Fedora - Installation 5 02-01-2004 11:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 04:32 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