Bug 95139

Summary: FAQ to move filesystem to new disk fails: incorrect permissions
Product: Documentation Reporter: Doug Hawkins <illusion65>
Component: Books & ArticlesAssignee: Gabor Pali <pgj>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
faq.patch none

Description Doug Hawkins 2006-03-31 04:20:16 UTC
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}).

Fix: 

use 'restore r' instead of 'restore x'
How-To-Repeat: Follow directions in FAQ to create a newfs & copy a partition, then compare the permission, owner, group for destination files & directories.
Comment 1 Marc Silver 2008-01-10 09:49:19 UTC
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
Comment 2 Tom Rhodes freebsd_committer freebsd_triage 2008-12-23 02:24:22 UTC
Responsible Changed
From-To: freebsd-doc->pgj

Over to Gabor - he's our FAQ guy :P
Comment 3 dfilter service freebsd_committer freebsd_triage 2009-03-10 06:02:13 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"
Comment 4 Gabor Pali freebsd_committer freebsd_triage 2009-03-10 06:27:21 UTC
State Changed
From-To: open->closed

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!