Date: Thu, 21 Sep 2000 14:17:47 -0700 From: Brooks Davis <brooks@one-eyed-alien.net> To: Ben Smithurst <ben@FreeBSD.ORG> 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> In-Reply-To: <200009211410.HAA68352@freefall.freebsd.org>; from ben@FreeBSD.ORG on Thu, Sep 21, 2000 at 07:10:02AM -0700 References: <200009211410.HAA68352@freefall.freebsd.org>
index | next in thread | previous in thread | raw e-mail
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 @@
</answer>
</qandaentry>
+ <qandaentry>
+ <question>
+ <para>How do I move my system over to my huge new disk?</para>
+ </question>
+
+ <answer>
+ <para>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.</para>
+
+ <para>Should you decide not to do a fresh install, you
+ need to partition and label the new disk with either
+ <filename>/stand/sysinstall</filename>, 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 <ulink
+ url="http://www.freebsd.org/tutorials/formatting-media/index.html">formatting-media
+ tutorial</ulink> for details on this process.</para>
+
+ <para>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
+ <filename>/dev</filename>) 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.</para>
+
+ <para>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:</para>
+
+ <procedure>
+ <step>
+ <para>newfs the new partition.</para>
+ </step>
+
+ <step>
+ <para>mount it on a temporary mount point.</para>
+ </step>
+
+ <step>
+ <para>cd to that directory.</para>
+ </step>
+
+ <step>
+ <para>dump the old partition, piping output to the
+ new one.</para>
+ </step>
+ </procedure>
+
+ <para>For example, if you are going to move root to
+ <filename>/dev/ad1s1a</filename>, with
+ <filename>/mnt</filename> as the temporary mount point,
+ it's:</para>
+
+ <screen>&prompt.root; <userinput>newfs /dev/ad1s1a</userinput>
+&prompt.root; <userinput>mount /dev/ad1s1a</userinput>
+&prompt.root; <userinput>cd /mnt</userinput>
+&prompt.root; <userinput>dump 0uaf - / | restore xf -</userinput></screen>
+
+
+ <para>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 <filename>/old</filename>
+ to <filename>/new</filename> for &man.tar.1; is:</para>
+
+ <screen>&prompt.root; <userinput>(cd /old; tar cf - .) | (cd /new; tar xpf -)</userinput></screen>
+
+ <para>If <filename>/old</filename> 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;:</para>
+
+ <screen>&prompt.root; <userinput>(cd /old; tar clf - .) | (cd /new; tar xpf -).</userinput></screen>
+
+ </answer>
+ </qandaentry>
+
</qandaset>
</chapter>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000921141747.A15371>
