moving /home [Solved - Corrected HowTo]

Jeff Vian jvian10 at charter.net
Tue Dec 6 02:33:03 UTC 2005


On Mon, 2005-12-05 at 17:46 -0500, Tony Nelson wrote:
> At 2:31 PM -0600 12/5/05, Jeff Vian wrote:
> >On Tue, 2005-12-06 at 00:41 +0500, Sergey wrote:
> >> Claude
> >>
> >> This is a prolix but a valid step-by-step instruction. You may want to
> >>publish
> >> it in a faq.
> >>
> >> One note: your command 'cp -a/home/* /mnt/mynewhome' would not copy
> >> the /home/.* entries. I don't really think there are chances such entries
> >> exist, however having such a job to do you've got to ensure.
> >>
> >You are correct *if* there were any .xxx entries in /home.  I have never
> >seen any there, only within the users actual home directory
> >(/home/user), and the command he gives will handle all of those. It is
> >important when doing something like this to make sure all the
> >possibilities are covered so another way to do it and verify everything
> >was copied could be:
> ># cp -a /home/* /home/.[!.]* <dest/directory>
> >In this command it explicitly asks for anything beginning with a '.',
> >but since both '.' and '..' match they need to be excluded, thus the
> >[!.] (not dot) part. For clarity read up on regexps.
> >
> >Tim's recommendation is (I believe) actually a better command.
> ># cd /home
> ># cp -a . <dest/directory>
> >This form of the command will handle even the .xxx files in the current
> >directory properly.
> 
> While we're beating this to death, doesn't:
> 
>     # cp -ar /home /mnt/mynewhome
> 
> do the job, copying everything, even stuff that "*" wouldn't match, without
> having to try to force it?

not quite.
It will create a directory home at /mnt/mynewhome/home and put all the
contents of /home there. It copies the named directory and all its
contents.  Also the -r is redundant when using -a.

> ____________________________________________________________________
> TonyN.:'                       <mailto:tonynelson at georgeanelson.com>
>       '                              <http://www.georgeanelson.com/>
> 




More information about the fedora-list mailing list