From owner-freebsd-doc Thu Oct 4 1:10:10 2001 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id E7A3D37B407 for ; Thu, 4 Oct 2001 01:10:00 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f948A0b10696; Thu, 4 Oct 2001 01:10:00 -0700 (PDT) (envelope-from gnats) Received: from guru.mired.org (okc-65-31-203-60.mmcable.com [65.31.203.60]) by hub.freebsd.org (Postfix) with SMTP id 7F04F37B401 for ; Thu, 4 Oct 2001 01:03:30 -0700 (PDT) Received: (qmail 44981 invoked by uid 100); 4 Oct 2001 08:03:24 -0000 Message-Id: <20011004080324.44980.qmail@guru.mired.org> Date: 4 Oct 2001 08:03:24 -0000 From: Mike Meyer Reply-To: Mike Meyer To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/31028: [PATCH] FAQ Instructions for moving system has a number of bogons Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 for details on this process. - 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 - /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;. - Although it is suggested that you move the data in single user - mode, it is not required. + 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 + /dev), 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. 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: &prompt.root; newfs /dev/ad1s1a -&prompt.root; mount /dev/ad1s1a +&prompt.root; mount /dev/ad1s1a /mnt &prompt.root; cd /mnt -&prompt.root; dump 0uaf - / | restore xf - +&prompt.root; dump 0af - / | restore xf - + Rearranging your partitions with dump takes a bit more + work. To merge a partition like /var + 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: + + &prompt.root; newfs /dev/ad1s1a +&prompt.root; mount /dev/ad1s1a /mnt +&prompt.root; cd /mnt +&prompt.root; dump 0af - / | restore xf - +&prompt.root; cd var +&prompt.root; dump 0af - /var | restore xf - + + To split a directory from it's parent, say putting + /var 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: - 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 - /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 - do not 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 -). + &prompt.root; newfs /dev/ad1s1a +&prompt.root; newfs /dev/ad1s1d +&prompt.root; mount /dev/ad1s1a /mnt +&prompt.root; mkdir /mnt/var +&prompt.root; mount /dev/ad1s1d /mnt/var +&prompt.root; cd /mnt +&prompt.root; dump 0af - / | restore xf - - You might prefer &man.cpio.1;, &man.pax.1;, or cpdup - (in ports/sysutils/cpdup) to &man.tar.1;. + 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. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message