[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving Debian from one HD to another



I started to reply to this, but realized as I was going along that there
are more pitfalls here than you want to know about.  IF you have a good
bootdisk, you might be able to do it, but test out every stage of the
following procedure first, before you commit.  The basic problem is that
you have to umount / in order to mount the new partition as /, and you
can't do that and have _anything_ else mounted.  So:

either get a good SAR disk with the basic utilities, mount, umount, cp,
rm, vi, fdisk, e2fsck, mke2fs (and what else??  There are SAR
rescue-disk making scripts that are a good thing to have), or trust
everything to your bootdisk.

Will you bootdisk boot if it doesn't find things where it expects them?
It should, but I never tried it.  In that case, you can try simply:

copying everything in the original distrubution (assuming you have no
other partitions mounted, then mount your new partition, /dev/hdb1, say, 
on a blank directory /foobar/, by

mount -t ext2 /dev/hdb1 /foobar

and then run

cp /* /.* /foobar

cp --recursive /usr /var /etc /root /foobar

(this should give copies or everything in the standard distribution into
/foobar/.  I may have forgotten a directory, though).  Don't copy /proc.


Then, edit your /etc/fstab (and /foobar/etc/fstab)  to mount 
/dev/hdb1 on / instead of whatever partition is there now.

Use linux fdisk to mark /dev/hdb1 as bootable

I DON"T REALLY KNOW IF THIS WILL WORK. AND I MAY HAVE FORGOTTEN
SOMETHING.

This _might_ work.  You then re-boot using your trusted bootdisk, and
you should find your new copy of the distribution mounted on /.  You can
then re-run lilo (check the lilo.conf file) to get it to boot without a
disk.

Wait for someone else to tear me apart on this list before you try it.
Please, folks, what is wrong with this??

-- 

David L. Johnson         	dlj0@lehigh.edu  dlj0@netaxs.com
Department of Mathematics	http://www.lehigh.edu/~dlj0/dlj0.html
Lehigh University
14 E. Packer Avenue		(610) 758-3759
Bethlehem, PA 18015-3174



Reply to: