Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Login to participate.

Go Back   TechSpot OpenBoards > OS & Software > The Alternative OS

Changing Linux on Slave Drive to Master Drive

Reply
Bookmark / Share this page
Thread Tools
  #1  
Old 09-16-2005
wheninrome's Avatar
Newcomer, in training
 
Member since: Aug 2005, 20 posts
Changing Linux on Slave Drive to Master Drive

I have Windows XP installed as the master drive (hda) and Mandriva 10.2 Linux on the slave drive (hdb). I want to physically remove the WinXP hard drive from my computer and make Linux the only drive. I boot up the computer using LILO, which is installed on hda. So how do I do all of this without messing up the bootloader settings?
Reply With Quote
  #2  
Old 09-17-2005
jobeard's Avatar
TechSpot Evangelist
 
Location: Southern Calif.
Member since: Apr 2005, 6,612 posts
First, save the existing /etc/lilo.conf; cp /etc/lilo.conf /etc/lilo.0901705.conf

Second, read manpage re mkbootdisk. you may need this to recover the as-is configuration

Third, I found it a lot safer to work out my LILO configuration using a floppy boot disk rather than my hard disk. To do this, you must replace the boot=/dev/hda with boot=/dev/fd0 in the lilo.conf file. That way, if I messed up any of the configuration in my lilo.conf file, I could take out the boot disk and boot into Linux as before. Once I was happy everything booted fine using the floppy disk, I then changed my lilo.conf back to use boot=/dev/hda and ran /sbin/lilo a final time to upload my changes.

man 8 lilo explains the program options
man 5 lilo.conf explains each line in the conf file

before you make changes, issue the following as documentation
...mount
later, this command will show /dev/hda? on / type ext2 (r/w)
when you're successful

Your existing LILO config should be at /etc/lilo.conf and will contain
items like:
boot = /dev/hdb? (first HD, some partition number suffix)
... bunch of stuff best left alone
image = ... whatever it says
.label = ... your lilo prompt at boot time
.root = ... /dev/hdb? (note it matches line 1)
other = /dev/hda1 (first HD, 1 partition)
.label = WinXP (the lilo prompt for XP)
.table = /dev/hda

delete the lines from OTHER to the bottom,
change hdb? to hda? (ie the same partition number, just different drive)
save the modification to disk

create the LILO floppy: try the -t option to see what it would do before doing it,
and use boot= /dev/fd0 until you're pleased with the result.

power down and move the 2hd to the end of the cable (cable select)
and set as master if needed. the first hd can be used later via /etc/fstab

insert the floppy and boot from it (you may need to change BIOS)

if all is well, you will see your full system running and the command mount
will verify the results.
Now you can change the boot= /dev/fd0 back to boot= /dev/hda?
and do the update for real.

booting from the HD should be safe and give you what you want.

ISSUE: /etc/fstab lines containing HDxy will need adjusting
If you have several MOUNTABLE devices, this table may interfer with your
results.
Until booting the HD works, rename this file with the 'mv' command.

Moving the cable connector will swap hda and hdb notations.
When you recable the original HD, you have two options:
use the space as DOS FAT or reformat as Linux ext{2,3}
If you reformat the original, then all hda entries can be deleted.
Any hdb entries in the saved fstab file need to become hda

Modifications to /etc/fstab can be utilized immediately via
login as root or the su command

The new hdb will need a mount-point, so cd /
mkdir /originalHD
and then you can mount eg 'mount /dev/hdb /originalHD'
Another typical location for mounts is /var/mnt/xxx
Reply With Quote
You can remove this banner by registering, join the TS Community for free.
  #3  
Old 09-17-2005
Nodsu's Avatar
TS Special Forces
 
Location: Estonia
Member since: Feb 2002, 9,430 posts
System specs
Excellent

I knew someone would write this thing better than I ever could.
Reply With Quote
Reply
Thread Tools

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Problem with detecting the primary slave drive tepster Storage & Networking 12 05-10-2008 10:25 PM
IDE devices do not show up with ATA enabled innominate CPUs, Chipsets and Mobos 4 05-05-2008 01:49 AM
Dual booting XP on 2 hard drives jsshackel Windows OS 10 10-19-2005 03:39 AM
Master Hard drive no longer detecting properly - why? lizannel Storage & Networking 16 09-01-2005 07:44 PM
hard drive problems... newbie help please! degeneration Storage & Networking 13 01-03-2004 01:35 PM


All times are GMT -4. The time now is 04:13 PM.