[LBo] Moving /home

Brian Reichert rignes at pobox.com
Mon Apr 2 02:25:43 CEST 2007


* TerryJ <listmail at exemail.com.au> [2007-04-02 09:03:06+1000]
> Anita Lewis wrote:
> >On 04/01/2007 01:25 PM Jisao wrote:
> >  
> >>Chris F.A. Johnson wrote:
> >>    
> >>>man cp:
> >>>      
> >
> >  
> >>>...
> >>>-x, --one-file-system
> >>>stay on this file system
> >>>
> >>>      
> >>I see.
> >>
> >>However, I don't get the -x : stay on this file system. What does it mean?
> >>    
> >
> >My understanding is <snip>
> >I would expect <snip>
> >Anyone know more on this?
> >
> >Anita
> 
> Statements like "I understand" and "I would expect" make me nervous.  No 
> criticism intended because that's all I get out of so many man pages and 
> other Linux "howtos".  For what Jisao wants to do, I would use Midnight 
> Commander which leaves you in no doubt - there's an option to retain 
> attributes.
> 
> Also, I would log in as root and just move the /home directory.  Then do 
> whatever I need to do after that (Jisao does not specify his purpose) 
> and move it again - to its rightful place.
> 

If you are like me and try to do as much at the command line as possible than
this might be of interest.

# find /home -xdev -print0 | cpio -paOV /new/home/location

This should [reserve permissions, handle special files correctly, and prevent
it from spanning file systems which are typical things you want to do when
moving a big hunk of data like that.

Now, I can't take credit for this command.  I had to look it up.  It was in
Knoppix Hacks under hack #61: Migrate to a New Hard Drive which seems similar
to what you are trying to do.  Just, instead of moving an entire drive you are
moving a potentially large file tree.

For the specifics of what all the command line options do it's best to consult
the man pages for find and cpio.  I just looked them up and the descriptions
are reasonably clear.

This way is just one more option for you.  I've also seen tar used for such
things but I didn't find a good example to give.

-- 
Brian Reichert
http://rignesnet.tzo.com

You cannot achieve the impossible without attempting the absurd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://linuxbasics.org/pipermail/qna/attachments/20070401/397f59c8/attachment.pgp


More information about the QnA mailing list