How to move existing linux install from /dev/hda --> /dev/hdb?

How to move existing linux install from /dev/hda --> /dev/hdb?

Post by Terry Tod » Sun, 31 Dec 1899 09:00:00



Hi:

I have had trouble recently adding two HDs (with linux/W95
installations) to a single pc:

1. At first I added the W95 HD as the slave HD on the IDE controller (It
appeared as /dev/hdb).

2. Then I installed linux (RH 6.1) on the first (master) HD (i.e.,
/dev/hda, with root on /dev/hda3). Linux worked fine.

3. I then discovered that to boot W95, it had to see itself on the "C"
drive. I then swapped the two HDs (i.e., we changed the slave/master
relationship between them.) This made the W95 HD /dev/hda which made W95
happy and it boots fine.

4. However, now I would like to know how to go about booting the linux
installation which was installed on /dev/hda but is now on /dev/hdb. We
are using the boot disk that was generated during the installation
process. I naively thought that at the lilo boot prompt I could say
something like:

boot: linux root=/dev/hdb3

But this has no effect. The boot fails when it tries to mount /dev/hda3
as root rather than /dev/hdb3. How can I make this work?

I was also unable to generate a separate boot disk on another pc, whose
image I tried to flag with the appropriate root device and swap device
parameters using the rdev utility. Does rdev not work anymore? I've done
this lots of times in the past.

Thanks,
Terry

--
T. Todd, Communications Research Laboratory
McMaster University, Hamilton, Ontario, Canada, L8S 4K1

 
 
 

How to move existing linux install from /dev/hda --> /dev/hdb?

Post by Tim Mile » Sun, 31 Dec 1899 09:00:00



Quote:> Hi:
> I have had trouble recently adding two HDs (with linux/W95
> installations) to a single pc:
> 3. I then discovered that to boot W95, it had to see itself on the "C"
> drive. I then swapped the two HDs (i.e., we changed the slave/master
> relationship between them.) This made the W95 HD /dev/hda which made W95
> happy and it boots fine.
> 4. However, now I would like to know how to go about booting the linux
> installation which was installed on /dev/hda but is now on /dev/hdb. We
> are using the boot disk that was generated during the installation
> process. I naively thought that at the lilo boot prompt I could say
> something like:
> boot: linux root=/dev/hdb3
> But this has no effect. The boot fails when it tries to mount /dev/hda3
> as root rather than /dev/hdb3. How can I make this work?
> I was also unable to generate a separate boot disk on another pc, whose
> image I tried to flag with the appropriate root device and swap device
> parameters using the rdev utility. Does rdev not work anymore? I've done
> this lots of times in the past.

I believe what you'll need to do is get linux up in rescue mode, mount the hard
drive, and edit the /etc/fstab.  It's likely to look like this:

/dev/hda6               /                       ext2    defaults        1 1
/dev/hda1               /boot                   ext2    defaults        1 2
/dev/hda2               /home                   ext2    defaults        1 2
/dev/hda5               swap                    swap    defaults        0 0
/dev/fd0                /mnt/floppy             ext2    noauto,user     0 0
/dev/cdrom              /mnt/cdrom              iso9660 noauto,ro,user  0 0
none                    /proc                   proc    defaults        0 0

In this case, you would probably need to change all instances of "/dev/hdaX" to
"/dev/hdbX".  It's the /etc/fstab file that is probably causing the problem.
When the system starts up, it opens that file and then tries to mount those
partitions, which (due to switching drives) do not exist anymore.

--

* Computer Science Senior           *that it requires you to be the agent of
* Western Michigan University       *injustice to another, then I say, break
*************************************the law."-Thoreau, Civil Disobedience
-----BEGIN GEEK CODE BLOCK-----
Version 3.12
GCS d? H s:+ g+ p3 au a w+ v C++ UL+ P-- L+++ 3 E--- N+ K- W-- M- V po--- Y+ t+
5 j- R- G? tv- b+++ D+ B--- e+ u h- f !r n---- !y+
-----END GEEK CODE BLOCK-----

 
 
 

How to move existing linux install from /dev/hda --> /dev/hdb?

Post by jim » Sun, 31 Dec 1899 09:00:00


If you get into rescue mode, try editing you /etc/lilo.conf file. This
is the file that lilo uses to dtermine where your root partition is
located. Change the references for /dev/hda<#> to /dev/hdb<#>.
Regards
Jim McIntyre

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

 
 
 

How to move existing linux install from /dev/hda --> /dev/hdb?

Post by QuestionExchang » Sun, 31 Dec 1899 09:00:00


Sounds like you forgot to update /etc/fstab to mount
/dev/hdb3 on /.  The easiest fix is probably to switch the
drives around again, edit fstab, halt, switch them back,
and reboot.

--
  This answer is courtesy of QuestionExchange.com
  http://www.questionexchange.com/showUsenetGuest.jhtml?ans_id=7931&cus...

 
 
 

1. Move my disk from /dev/hda to /dev/hdb

Hello, gurus!

I apologize, but for some perverted reason I want to install Win2000 on
my linux box. Mostly to run under VMware, but also as a separate boot
OS.

W2000 seems to need to write some files to what it thinks of as the C:
drive, and I cannot give it a suitable partition on hda without messing
up linux there. I know linux is smart enough to be able to boot from
anywhere.

Therefore I plan to switch my current drive to /dev/hdb and put a spare
drive in as /dev/hda .

My idea is to make another /etc/fstab with all the hda's changed to
hdb's, called fstab.hdb, and copy the original to fstab.hda . Then do
something similar with lilo.config but have one version with one version
each with all files/partitions on hda and hdb, with (at least) versions
of the latter with writing the boot sector on hda, hdb, and fd0 .

I know I need to think more about the transition process, but are there
other files I need to worry about?

TIA (and references to FM's welcome),

Gerry

2. Apache: Dynamic Shared Object (DSO) equivalent for windows?

3. LILO that does linux at /dev/hda and BEos at /dev/hdb

4. installing WordPerfect 7, still..

5. Multi boot: Linux [/dev/hda] and NT [/dev/hdb]

6. Closed Sockets?

7. Removing /dev/hda, Linux on /dev/hdb, how?

8. Legato NetWorker - Soft Errors on 8mm 3M Data tapes (replace tape!)

9. Moving Linux from /dev/hdc to /dev/hdb - possible?

10. cp dev/hda dev/hdb

11. BIOS-->hdb-->LILO-->{linux(hdb);windows(hda)}

12. Moving from /dev/hdb to /dev/hdd

13. Help Moving physical drive from /dev/hdc to /dev/hda