« SocialText import tools | Main | Fuse for perl on FreeBSD »

tar gotcha when migrating disk

Over the years, I have changed 2.5" hard-drives in laptop more often than I want to remember. Last one lasted only year and a half, which is noticably less than previous ones which managed to survive for two and half years at least.

But, this time, I didn't manage to find two 2.5" HD adapters for desktop PC, so I opted to use netcat and tar like this:

new$ nc -w 5 -l -p 8888 | tar xvfSp -
old$ tar cfvSp - / | nc new 8888

Can you see the touble here? (No, I'm not thinking about redundant S in one of tars -- hack, I'm not even sure it's redundant, man page didn't tell me anything useful).

If you couldn't guess, I didn't have completly same /etc/group and /etc/passwd on both machines. Life sucks. I should have used --numeric-owner for tar and all would be well, thus here is a blog post...

Update: if you are using framebuffer, leaving v flag will slow down transfer considerably because screen scrolling is slow. So, faster and correct alternative is:

new$ nc -w 5 -l -p 8888 | tar --numeric-owner -xSpf -
old$ tar --numeric-owner -cSpf - / | nc new 8888

TrackBack

TrackBack URL for this entry:
http://blog.rot13.org/mt/mt-tb.cgi/537

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on December 17, 2006 4:12 PM.

The previous post in this blog was SocialText import tools.

The next post in this blog is Fuse for perl on FreeBSD.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 4.1