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

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

Post by Sasch » Fri, 14 Feb 1997 04:00:00



Hi there!

I unfortunately installed Linux (RedHat 4.0) on /dev/hdc which means I
can't use LILO.

I would like to "copy" the whole System onto another drive (/dev/hdb)
but I guess I have to change lots of files to get it work - if it will
work at all.

Has someone any experience with this?

Thanks!

Sascha.

 
 
 

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

Post by Pascal VERO » Fri, 14 Feb 1997 04:00:00



> Hi there!

> I unfortunately installed Linux (RedHat 4.0) on /dev/hdc which means I
> can't use LILO.

> I would like to "copy" the whole System onto another drive (/dev/hdb)
> but I guess I have to change lots of files to get it work - if it will
> work at all.

> Has someone any experience with this?

> Thanks!

> Sascha.

Try to simply use dd if=/dev/hdc of=/dev/hdb

 
 
 

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

Post by Uwe Bonne » Fri, 14 Feb 1997 04:00:00


: Hi there!

: I unfortunately installed Linux (RedHat 4.0) on /dev/hdc which means I
: can't use LILO.

: I would like to "copy" the whole System onto another drive (/dev/hdb)
: but I guess I have to change lots of files to get it work - if it will
: work at all.

: Has someone any experience with this?

Why don't you first ask some search engine like http://www.dejanes.com about
your problem. Your problem has been asked and answered many times
before. Even now there is such a thread going on.

I propose you boot from a rescue disk, so that none of the involved
filesystems gets active. Now mount both disks, perhaps as /mnt (old) oan
/mnt1 (new) Then "cp -a /mnt/* /mnt". To be sure you can to "diff -uwr /mnt
/mnt1 |& tee >diff.log" (tcsh) afterwards.  Check for differences, Mostly
some link which point to nowhere on an inactive disk will be wrong.

--

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

 
 
 

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

Post by Jurgen Exne » Sat, 15 Feb 1997 04:00:00


!!!!!!!! WARNING !!!!!

!!!!! Don't do that unless you know _exactly_ what you are doing !!!!

The dd command mentioned below is a low-level bitwise copy.
This means it will copy _EVERYTHING_ from /dev/hdc to /dev/hdb.
As these are the whole disks, it will copy the MBR as well as the partition
table as well as any bad blocks.
Imagine the effect, if the target disk is smaller than the source disk.
_ALL_ administration information will think, it's a large disk, but
writing/reading to those sectors behind the physical size will yield
unpredicable results, in the best case only a simple crash, in the worst
case a damaged HD.
If the target HD is larger, the remaining bytes will never be used, because
nothing will know about them (all old information in the partition table
and fs meta data will be overwritten).

Note: It's quite safe to use dd to copy between partitions of exactly the
same size, but don't use it on a HD as a whole.

jue

--
The opinions expressed in this message are my own personal views
and do not reflect the official views of Microsoft Corporation




> > Hi there!

> > I unfortunately installed Linux (RedHat 4.0) on /dev/hdc which means I
> > can't use LILO.

> > I would like to "copy" the whole System onto another drive (/dev/hdb)
> > but I guess I have to change lots of files to get it work - if it will
> > work at all.

> > Has someone any experience with this?

> > Thanks!

> > Sascha.
> Try to simply use dd if=/dev/hdc of=/dev/hdb

 
 
 

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

Post by Mikkel L. Ellerts » Sat, 15 Feb 1997 04:00:00




Quote:>Hi there!

>I unfortunately installed Linux (RedHat 4.0) on /dev/hdc which means I
>can't use LILO.

Why cann't you use LILO with /dev/hdc?  The boot code of LILO installs
on the MBR of /dev/hda, and unless you need to load some software to
access the secondary IDE controler, it should be able to load the kernel
from /dev/hdc and use it as the root device with no problems...

Quote:>I would like to "copy" the whole System onto another drive (/dev/hdb)
>but I guess I have to change lots of files to get it work - if it will
>work at all.

If by copy, you are planing on changing the drive with Linux on it from
being master on the secondary IDE to slave on the primary, the only file
you should have to change is the /etc/fstab file.  Change all the
references to hdc to read hdb and you should be all set.  Then make sure
you run LILO from Linux as root so LILO know the location of your kernel.

--


WWW:    http://www.execpc.com/~mikkel

 
 
 

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

Post by Jeff Pierc » Mon, 17 Feb 1997 04:00:00



> Hi there!

> I unfortunately installed Linux (RedHat 4.0) on /dev/hdc which means I
> can't use LILO.

> I would like to "copy" the whole System onto another drive (/dev/hdb)
> but I guess I have to change lots of files to get it work - if it will
> work at all.

> Has someone any experience with this?

> Thanks!

> Sascha.

I've done the exact thing before. I brought up a new Linux on a small
test partion and then copied it to my Linux partion with cpio.

Boot your new Linux, mount the target partition under something like
/mnt.

Delete all under /mnt.

The cpio command is:

find / | grep -v /mnt | cpio -pdmu /mnt

What this does is uses find as the input to cpio which is in the
passthru mode.  The grep filter keeps the /mnt directory, our target
from reaching cpio, this stops recursion from happening, a VERY BAD
thing!!!!!

Good luck.

Jeff Pierce

 
 
 

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

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

2. 3Com 3C905

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

4. WANTED

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

6. sds 4.2.1 on 8/7_01 help needed

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

8. Simple Cron Question

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

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

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

12. fsck -A -V -a only checks /dev/hdb* (but not hda*, hdc*)

13. Is #fdisk /dev/hdc possible for Linux 1.2.1?