Skip site navigation (1)Skip section navigation (2)
Date:      4 Oct 2001 08:03:24 -0000
From:      Mike Meyer <mwm@mired.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   docs/31028: [PATCH] FAQ Instructions for moving system has a number of bogons
Message-ID:  <20011004080324.44980.qmail@guru.mired.org>

next in thread | raw e-mail | index | archive | help

>Number:         31028
>Category:       docs
>Synopsis:       [PATCH] FAQ Instructions for moving system has a number of bogons
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 04 01:10:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Mike Meyer
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Meyer Consulting
>Environment:
System: FreeBSD guru.mired.org 4.4-STABLE FreeBSD 4.4-STABLE #8: Sun Sep 30 17:21:29 CDT 2001 mwm@guru.mired.org:/sharetmp/obj/usr/src/sys/GURU i386

>Description:

	The FAQ entry on moving your system to a huge new disk has a few
	bogons, and a bit of bad advice. In particular, the mount commands
	don't list the mount point, you probably don't want to update
	/etc/dumpdates during this process, and there are problems using
	tar that aren't mentioned.

>How-To-Repeat:

	Try following the old directions.

>Fix:

	The attached patch fixes the english version to correct all
	the above. It replaces the examples that used tar with examples
	that use dump. It adds tar to the list of other things to consider
	for moving data, but mentions the known problem. It drops cpdup from
	that list, as I don't know if that has problems or not.

--- book.sgml.orig	Thu Oct  4 02:36:12 2001
+++ book.sgml	Thu Oct  4 02:58:21 2001
@@ -6953,14 +6953,14 @@
             formatting-media tutorial</ulink> for details on this
             process.</para>
 
-          <para>Now you have got the new disk set up, and are ready
-            to move the data.  Unfortunately, you cannot 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;.
-	    Although it is suggested that you move the data in single user
-	    mode, it is not required.</para>
+          <para>Now you have the new disk set up, and are ready to move
+            the data.  Unfortunately, you cannot just blindly copy the
+	    data.  Things like device files (in
+	    <filename>/dev</filename>), flags and links tend to screw
+	    that up.  You need to use tools that understand these
+	    things, which means &man.dump.8;.  Although it is suggested
+	    that you move the data in single user mode, it is not
+	    required.</para>
 
           <para>You should never use anything but &man.dump.8; and
             &man.restore.8; to move the root file system.  The
@@ -6995,31 +6995,42 @@
             it is:</para>
 
           <screen>&prompt.root; <userinput>newfs /dev/ad1s1a</userinput>
-&prompt.root; <userinput>mount /dev/ad1s1a</userinput>
+&prompt.root; <userinput>mount /dev/ad1s1a /mnt</userinput>
 &prompt.root; <userinput>cd /mnt</userinput>
-&prompt.root; <userinput>dump 0uaf - / | restore xf -</userinput></screen>
+&prompt.root; <userinput>dump 0af - / | restore xf -</userinput></screen>
 
+          <para>Rearranging your partitions with dump takes a bit more
+            work. To merge a partition like <filename>/var</filename>
+	    into it's parent, create the new partition large enough for
+	    both, move the parent partition as described above, then
+	    move the child partition into the empty directory the first
+	    move created:</para>
+	  
+          <screen>&prompt.root; <userinput>newfs /dev/ad1s1a</userinput>
+&prompt.root; <userinput>mount /dev/ad1s1a /mnt</userinput>
+&prompt.root; <userinput>cd /mnt</userinput>
+&prompt.root; <userinput>dump 0af - / | restore xf -</userinput>
+&prompt.root; <userinput>cd var</userinput>
+&prompt.root; <userinput>dump 0af - /var | restore xf -</userinput></screen>
+
+	  <para>To split a directory from it's parent, say putting
+	    <filename>/var</filename> on it's own partition when it wasn't
+	    before, create both partitions, then mount the child partition
+	    on the approriate directory in the temporary mount point, then
+	    move the old single partition:</para>
 
-          <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 cannot 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
-            do not 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>
+          <screen>&prompt.root; <userinput>newfs /dev/ad1s1a</userinput>
+&prompt.root; <userinput>newfs /dev/ad1s1d</userinput>
+&prompt.root; <userinput>mount /dev/ad1s1a /mnt</userinput>
+&prompt.root; <userinput>mkdir /mnt/var</userinput>
+&prompt.root; <userinput>mount /dev/ad1s1d /mnt/var</userinput>
+&prompt.root; <userinput>cd /mnt</userinput>
+&prompt.root; <userinput>dump 0af - / | restore xf -</userinput></screen>
 
-          <para>You might prefer &man.cpio.1;, &man.pax.1;, or cpdup
-            (in ports/sysutils/cpdup) to &man.tar.1;.</para>
+          <para>You might prefer &man.cpio.1;, &man.pax.1;,
+            &man.tar.1; to &man.dump.8; for user data. At the time of
+            this writing, these are known to lose file flag information,
+            so use them with caution.</para>
         </answer>
       </qandaentry>
 

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011004080324.44980.qmail>