From nobody@FreeBSD.org  Fri Mar 31 03:18:26 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E2AD716A425
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Mar 2006 03:18:26 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id AEA8E43D46
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Mar 2006 03:18:26 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k2V3IQZB014149
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 31 Mar 2006 03:18:26 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k2V3IQqH014148;
	Fri, 31 Mar 2006 03:18:26 GMT
	(envelope-from nobody)
Message-Id: <200603310318.k2V3IQqH014148@www.freebsd.org>
Date: Fri, 31 Mar 2006 03:18:26 GMT
From: Doug Hawkins <illusion65@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: FAQ to move filesystem to new disk fails: incorrect permissions
X-Send-Pr-Version: www-2.3

>Number:         95139
>Category:       docs
>Synopsis:       FAQ to move filesystem to new disk fails: incorrect permissions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pgj
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 31 03:20:16 GMT 2006
>Closed-Date:    Tue Mar 10 06:31:18 UTC 2009
>Last-Modified:  Tue Mar 10 06:31:18 UTC 2009
>Originator:     Doug Hawkins
>Release:        FreeBSD 6.0-RELEASE
>Organization:
N/A
>Environment:
FreeBSD soho.localhost.net 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Fri Mar 31 14:40:20 NZST 2006
doug@soho.localhost.net:/usr/src/sys/i386/compile/GBDEKRNL  i386
NOTE: I was using GENERIC from the 6.0 ISO's when this problem occurred
>Description:
I needed to move my /var, and /usr partitions to a different slice, so I followed the directions on:

<http://www.freebsd.org/doc/faq/disks.html#NEW-HUGE-DISK>

dump 0af - /var | restore xf -

but that did not properly restore the file permissions.

I later used:

dump 0f - /var | restore rf -

note the 'r' option instead of the 'x' for restore.

Even though the documentation states that 'restore x' will attempt to restore file permissions, it did not work for my system.  This could be very frustrating for someone who doesn't notice until later that many system services do not run properly (e.g.: MySQL cannot run because it's /var/db/mysql directory is no longer accessible {700 root:wheel} instead of {755 mysql:mysql}).
>How-To-Repeat:
Follow directions in FAQ to create a newfs & copy a partition, then compare the permission, owner, group for destination files & directories.
>Fix:
use 'restore r' instead of 'restore x'
>Release-Note:
>Audit-Trail:

From: Marc Silver <marcs@draenor.org>
To: bug-followup@FreeBSD.org, illusion65@gmail.com
Cc:  
Subject: Re: docs/95139: FAQ to move filesystem to new disk fails: incorrect permissions
Date: Thu, 10 Jan 2008 11:49:19 +0200

 --98e8jtXdkpgskNou
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hi there,
 
 I wasn't able to replicate the error you encountered using dump.  One
 thing I did notice is that the man page for restore indicates that the
 -x flags will restore owner, modification time and mode 'if possible'.
 
 That said, according to the restore man page, the -r flag was
 speficially intended to be used to restore and rebuild a file system
 that has been created with newfs, thus making it a more favourable
 choice over the -x flag.
 
 Assuming this is correct, I've included a minor patch for the FAQ to
 correct this.
 
 Cheers,
 Marc
 
 --98e8jtXdkpgskNou
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="faq.patch"
 
 --- book.sgml.orig	2008-01-10 11:47:27.000000000 +0200
 +++ book.sgml	2008-01-10 11:47:29.000000000 +0200
 @@ -5068,7 +5068,7 @@
            <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></screen>
 +&prompt.root; <userinput>dump 0f - / | restore rf -</userinput></screen>
  
            <para>Rearranging your partitions with dump takes a bit more
              work. To merge a partition like <filename>/var</filename>
 @@ -5080,9 +5080,9 @@
            <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>dump 0f - / | restore rf -</userinput>
  &prompt.root; <userinput>cd var</userinput>
 -&prompt.root; <userinput>dump 0af - /var | restore xf -</userinput></screen>
 +&prompt.root; <userinput>dump 0f - /var | restore rf -</userinput></screen>
  
  	  <para>To split a directory from its parent, say putting
  	    <filename>/var</filename> on its own partition when it was not
 @@ -5096,7 +5096,7 @@
  &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>
 +&prompt.root; <userinput>dump 0f - / | restore rf -</userinput></screen>
  
            <para>You might prefer &man.cpio.1;, &man.pax.1;,
              &man.tar.1; to &man.dump.8; for user data. At the time of
 
 --98e8jtXdkpgskNou--
Responsible-Changed-From-To: freebsd-doc->pgj 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Tue Dec 23 02:24:22 UTC 2008 
Responsible-Changed-Why:  
Over to Gabor - he's our FAQ guy :P 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95139 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: docs/95139: commit references a PR
Date: Tue, 10 Mar 2009 06:02:13 +0000 (UTC)

 pgj         2009-03-10 06:01:59 UTC
 
   FreeBSD doc repository
 
   Modified files:
     en_US.ISO8859-1/books/faq book.sgml 
   Log:
   Update Question 9.2 (new-huge-disk):
   - Use the correct flags for restore(8)
   
   PR:             docs/95139
   Submitted by:   Doug Hawkins <illusion65 (at) gmail (dot) com>
   
   Revision  Changes    Path
   1.1110    +4 -4      doc/en_US.ISO8859-1/books/faq/book.sgml
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: pgj 
State-Changed-When: Tue Mar 10 06:27:21 UTC 2009 
State-Changed-Why:  
Flags for restore has been fixed, but flags for dump remained the same 
(a difference from the patch added later on).  Thank you for your 
submission, and sorry for closing the PR so belatedly! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=95139 
>Unformatted:
