home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / admin / 6777 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.7 KB  |  49 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!cs.utexas.edu!mercury.unt.edu!ponder.csci.unt.edu!jackson
  3. From: jackson@ponder.csci.unt.edu (Bruce Jackson)
  4. Subject: Re: How to move a filesytem?
  5. Message-ID: <1992Dec23.222707.28624@mercury.unt.edu>
  6. Sender: usenet@mercury.unt.edu (UNT USENet Adminstrator)
  7. Organization: University of North Texas, Denton
  8. References: <BzFBx0.ECD@encore.com> <1992Dec18.110817.6773@ghost.dsi.unimi.it> <1992Dec18.110958.25712@sei.cmu.edu>
  9. Date: Wed, 23 Dec 1992 22:27:07 GMT
  10. Lines: 37
  11.  
  12. >In article <1992Dec18.110817.6773@ghost.dsi.unimi.it>, serini@ghost.dsi.unimi.it (Piero Serini) writes:
  13.  
  14. >|> In single user mode:
  15.  
  16. >|> # cd /
  17. >|> # mkdir usr2
  18. >|> # mount /dev/newdisk /usr2
  19. >|> # cd usr
  20. >|> # tar cf - . | compress | (cd /usr2 ; uncompress | tar xf - )
  21.  
  22. In article <1992Dec18.110958.25712@sei.cmu.edu> kochmar@sei.cmu.edu (John Kochmar) writes:
  23.  
  24. >I always use -p option to the second tar, so that permissions and
  25. >ownerships are set correctly.  According to the man page, not using the
  26. >-p option will cause the files to be restored with the current umask,
  27. >and setUID and stickey information are also preserved.
  28.  
  29. >Note: the -p is only necessary on the extract, not on the corrosponding
  30. >create (the man page sez it is only useful with the -x option.)
  31.  
  32. I'll second using the `p' option to keep the current permissions
  33. intact.
  34.  
  35. For sh, ksh, or bash I'd also use '&&' instead of ';' like:
  36.  
  37. # tar cf - . | (cd /usr2 && tar xpf - )
  38.  
  39. This way the tar extracting from stdin will *ONLY* run if the cd in front
  40. of it is sucessful.  tar-ing overtop of the present files will cause them
  41. to be truncated.  In csh or tcsh the '&&' does not seem to be necessary
  42. since it drops out if the cd fails.
  43.  
  44. Bruce  -  jackson@cs.unt.edu
  45.  
  46.  
  47.  
  48.  
  49.