Read on full site | Join TechSpot! (it's free) | Bookmark / Share this



Changing Linux on Slave Drive to Master Drive

wheninrome
09-16-2005, 10:53 PM
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?

jobeard
09-17-2005, 03:25 PM
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

Ad
09-17-2005, 03:25 PM
  

Nodsu
09-17-2005, 05:01 PM
Excellent :)

I knew someone would write this thing better than I ever could.

Post a reply, see related topics & more

Tip: Download Advanced SystemCare 3 Free - Clean, Repair, Protect & Optimize your PC.



 Top Technology News

TechSpot Blog: Disable Windows automatic check for solutions after a program crashes

Weekend Open Forum: Google Chrome OS and the future of cloud computing

Tech Tip of the Week: Unearth Region-Specific Windows 7 Themes

Sony: PlayStation 3 to be 3D-capable via firmware update

iSuppli: DDR3 to account for over half of DRAM shipments by Q2 2010

Facebook named third most popular video website behind YouTube and Hulu

Patriot introduces new PS-100 SSD series

Sony working on digital store for music, movies, books

More Tech News

  
 Software Downloads

Norton Virus Definitions 2003-07 November 20, 2009

AVG Anti-Virus Updates November 20, 2009

Norton Virus Definitions 2008-09 November 20, 2009

avast! Virus Definitions November 20, 2009

McAfee SuperDAT Update 5808

Kaspersky Anti-Virus Update November 20, 2009

Google SketchUp 7.1.6087

More Downloads



Copyright © 1998-2009 TechSpot.com. TechSpot is a registered trademark. All Rights Reserved.