On Thu, Apr 04, 2002 at 12:46:23AM +1000, Paul Robinson wrote:
Hi guys,
What I was planning to do was install the new drives and mount them as
/mnt/temp and /mnt/temp2 for example and then run cp -a / /mnt/temp so
as to copy everything form the root structure across.. but I got to thinking.
wouldn't it eventually try to copy the /mnt/temp content into itself and
start a really bad loop? What is the best way to upgrade hard drives in
a Linux box?
Try using;
# ( cd /src; tar lcpf - . ) | ( cd /dst; tar xf - )
instead which will preserve permissions, owners, device nodes
and won't cross filesystem boundarys. Actually you could probably
simply that to (after confirming 'l' did what I thought)
# ( tar -C /src lcpf - . ) | ( tar -C /dst xf - )
but I've never tried that version.
Is there any software which will just write out the contents of an actual
partition to another? ie copy /dev/hda1 to /dev/hdc1 or something like
that.. ignoring the mount points etc.
dump/restore, cpio and dd could all be used instead. I just happen
to like the tar version
I also realise I'm going to need to make a boot disk and boot off that the
first time to run lilo to write to the boot sector of the new hard disk
when it is moved to /.
It has been a while since I've used lilo but I believe either
# lilo -M /new/device
or
# lilo -b /new/device
ought to do the trick. I don't even have the manpages installed to
check so confirm with those.
Anand
--
`` We are shaped by our thoughts, we become what we think.
When the mind is pure, joy follows like a shadow that never
leaves. '' -- Buddha, The Dhammapada
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug