* Moving File Systems to Larger Disk?
@ 1995-10-11 4:00 Bruce B. Platt
1995-10-12 4:00 ` oberman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bruce B. Platt @ 1995-10-11 4:00 UTC (permalink / raw)
What's the best way to move a complete set of file systems to a new disk?
Specifically, the old disk has "a" and "g" partitions holding "/" and "/usr"
respectively.
I'd like to take this disk (which is actually new with factory installed
sw from Digital) and before I do anything else with the system, move it's
entire contents to a larger disk, and then use the larger disk in place
of the original one.
Is the best way to do this to dump to tape, make newfs on the new disk,
then restore from tape, Or is there is way to bypass the dumping and
restoring from tape?
I am concerned about losing any links which exist in the original file
systems, and also about how to make sure that the new,larger disk will
boot, so I can use it in place of the original one.
I apologize for asking what may seem a simple question, but any help
would be appreciated, especially examples of commands you believe would work.
Thanks,
Bruce
--
----------------
bbp@nic.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Moving File Systems to Larger Disk?
1995-10-11 4:00 Moving File Systems to Larger Disk? Bruce B. Platt
@ 1995-10-12 4:00 ` oberman
1995-10-13 4:00 ` Andrew Sheaff
1995-10-14 4:00 ` Tim W. Janes
2 siblings, 0 replies; 4+ messages in thread
From: oberman @ 1995-10-12 4:00 UTC (permalink / raw)
In Article <45he5q$769@news.nic.com>
bbp@nic.com (Bruce B. Platt) writes:
>What's the best way to move a complete set of file systems to a new disk?
>
>Is the best way to do this to dump to tape, make newfs on the new disk,
>then restore from tape, Or is there is way to bypass the dumping and
>restoring from tape?
Yes. dump to stdout and pipe it to restore. The restore man page has an
example. See the -f option.
-f dump_file
When an argument follows the -f modifier flag, it is used as the
name of the archive device, replacing the default tape device
/dev/rmt0h. When the argument is the character - (dash), restore
or rrestore reads from standard input. Thus, dump and restore or
rdump and rrestore may be used in a pipeline expression to copy
file systems with the following typical command:
dump -0f - /usr | (cd /mnt; restore -xf -)
R. Kevin Oberman
Energy Sciences Network (ESnet)
National Energy Research Supercomputer Center (NERSC)
Lawrence Livermore National Laboratory (LLNL)
Internet: koberman@llnl.gov +1 510-422-6955
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Moving File Systems to Larger Disk?
1995-10-11 4:00 Moving File Systems to Larger Disk? Bruce B. Platt
1995-10-12 4:00 ` oberman
@ 1995-10-13 4:00 ` Andrew Sheaff
1995-10-14 4:00 ` Tim W. Janes
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Sheaff @ 1995-10-13 4:00 UTC (permalink / raw)
I have moved filesystem around frequently. So we have a nice script using
gtar:
It will NOT cross mount points. Be sure to specify FULL pathnames for the
directories. For example copy /usr to a temp disk mounted on /mnt:
cpdir /usr /mnt
--
#!/bin/sh
#
# Shell script to recursively copy the contents of the FROMDIR directory
# to the TODIR directory without changing the permissions and ownership
# and not crossing filesystems in the FROMDIR directory.
#
FROMDIR=$1
TODIR=$2
echo "Recursively copy the contents of the directory ${FROMDIR}"
echo -n " to the directory ${TODIR} (y/n)? "
read ANS
case ${ANS} in
[yY]*)
echo -n "Copying... "
cd ${FROMDIR}; /usr/local/bin/gtar clf - . | (cd ${TODIR};
/usr/local/
bin/gtar xpf -)
echo " Done."
;;
*)
echo "Directory copy aborted by user."
;;
esac
--
Andy Sheaff - sheaff@eece.maine.edu
http://www.eece.maine.edu/Faculty/Sheaff.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Moving File Systems to Larger Disk?
1995-10-11 4:00 Moving File Systems to Larger Disk? Bruce B. Platt
1995-10-12 4:00 ` oberman
1995-10-13 4:00 ` Andrew Sheaff
@ 1995-10-14 4:00 ` Tim W. Janes
2 siblings, 0 replies; 4+ messages in thread
From: Tim W. Janes @ 1995-10-14 4:00 UTC (permalink / raw)
In article <45he5q$769@news.nic.com>, Bruce B. Platt <bbp@nic.com> wrote:
>What's the best way to move a complete set of file systems to a new disk?
>
>Specifically, the old disk has "a" and "g" partitions holding "/" and "/usr"
>respectively.
>
>I'd like to take this disk (which is actually new with factory installed
>sw from Digital) and before I do anything else with the system, move it's
>entire contents to a larger disk, and then use the larger disk in place
>of the original one.
Connect new disk to machine
use disklabel to partition it as required.
newfs on a and g partitions
cd /tmp
mkdir newroot
mount /dev/rz?a /tmp/newroot
mkdir newusr
mount /dev/rz?g /tmp/newusr
dump 0f - / | (cd /tmp/newroot; restore -rf - )
dump 0f - /usr | (cd /tmp/newusr; restore -rf - )
either
shut machine down and swap SCSI ID's of the two disks
reboot
or
edit /tmp/newroot/etc/fstab to be reflect new disk ID
change the link /sbin/swapdefault to point to the new disk
shutdown
change boot varaible at the console prompt
boot
Good luck
I have just done it twice. Once from internal disk onto a spare disk
then repartitioned the internal disk to give 512Mbyte swap and then
moved / and /usr back.
Tim.
PS I would have replied by email but our email is down at the moment
--
Tim Janes | e-mail : janes@signal.dra.hmg.gb
Defence Research Agency | tel : +44 684 894100
Malvern Worcs | fax : +44 684 894384
Gt Britain | #include <std/disclaim.h>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1995-10-14 4:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-10-11 4:00 Moving File Systems to Larger Disk? Bruce B. Platt
1995-10-12 4:00 ` oberman
1995-10-13 4:00 ` Andrew Sheaff
1995-10-14 4:00 ` Tim W. Janes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox