From owner-freebsd-doc Thu Sep 21 14:17:56 2000 Delivered-To: freebsd-doc@freebsd.org Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by hub.freebsd.org (Postfix) with ESMTP id BE0E737B42C; Thu, 21 Sep 2000 14:17:47 -0700 (PDT) Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.11.0/8.11.0) id e8LLHlJ15642; Thu, 21 Sep 2000 14:17:47 -0700 Date: Thu, 21 Sep 2000 14:17:47 -0700 From: Brooks Davis To: Ben Smithurst Cc: freebsd-doc@FreeBSD.ORG Subject: Re: docs/21443: I'm tired of telling people how to copy a disk. Message-ID: <20000921141747.A15371@Odin.AC.HMC.Edu> References: <200009211410.HAA68352@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200009211410.HAA68352@freefall.freebsd.org>; from ben@FreeBSD.ORG on Thu, Sep 21, 2000 at 07:10:02AM -0700 Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Thu, Sep 21, 2000 at 07:10:02AM -0700, Ben Smithurst wrote: > It would be really nice if you could send this as an SGML diff to the > FAQ, with correct indentation and everything. ("correct" means what the > FDP Primer says, not what most of the FAQ is. Some of the questions in > the FAQ are correct though, mostly the recent additions.) I've enclosed a diff below. It's also online at: http://www.one-eyed-alien.net/~brooks/FreeBSD/diskcopy-faq.diff -- Brooks -- Any statement of the form "X is the one, true Y" is FALSE. Index: book.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO_8859-1/books/faq/book.sgml,v retrieving revision 1.92 diff -u -r1.92 book.sgml --- book.sgml 2000/09/18 19:50:21 1.92 +++ book.sgml 2000/09/21 21:09:08 @@ -5453,6 +5453,99 @@ + + + How do I move my system over to my huge new disk? + + + + The best way is to reinstall the OS on the new + disk, then move the user data over. This is highly + recommended if you've been tracking -stable for more + than one release, or have updated a release instead of + installing a new one. You can install booteasy on both + disks with &man.boot0cfg.8;, and dual boot them until + you are happy with the new configuration. Skip the next + paragraph to find out how to move the data after doing + this. + + Should you decide not to do a fresh install, you + need to partition and label the new disk with either + /stand/sysinstall, or &man.fdisk.8; + and &man.disklabel.8;. You should also install booteasy + on both disks with &man.boot0cfg.8;, so that you can + dual boot to the old or new system after the copying + is done. See the formatting-media + tutorial for details on this process. + + Now you've got the new disk set up, and are ready + to move the data. Unfortunately, you can't just blindly + copy the data. Things like device files (in + /dev) and symbolic links tend to + screw that up. You need to use tools that understand + these things, which means &man.dump.8; and &man.tar.1;. I + recommend doing the data moves in single user mode, + but it's not required. + + You should never use anything but &man.dump.8; and + &man.restore.8; to move the root file system. The + &man.tar.1; command may work - then again, it may not. + You should also use &man.dump.8; and &man.restore.8; if + you are moving a single partition to another empty + partition. The sequence of steps to use dump to move + a partitions data to a new partition is: + + + + newfs the new partition. + + + + mount it on a temporary mount point. + + + + cd to that directory. + + + + dump the old partition, piping output to the + new one. + + + + For example, if you are going to move root to + /dev/ad1s1a, with + /mnt as the temporary mount point, + it's: + + &prompt.root; newfs /dev/ad1s1a +&prompt.root; mount /dev/ad1s1a +&prompt.root; cd /mnt +&prompt.root; dump 0uaf - / | restore xf - + + + If you are going to rearrange your partitions - + say, splitting one into two, or combing two into one, + you may find yourself needing to move everything under + a subdirectory to a new location. Since &man.dump.8; works + with file systems, it can't do this. So you use &man.tar.1;. + The general command to move /old + to /new for &man.tar.1; is: + + &prompt.root; (cd /old; tar cf - .) | (cd /new; tar xpf -) + + If /old has file systems + mounted on that, and you + don't want to move that data or unmount them, you just + add the 'l' flag to the first &man.tar.1;: + + &prompt.root; (cd /old; tar clf - .) | (cd /new; tar xpf -). + + + + To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message