🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.linux
Article #635

Re: Copying

#635
From: Paul Colquhoun
Date: Sat, 02 Oct 1999 00:00
35 lines
2388 bytes
On Fri, 1 Oct 1999 12:50:20 +1000, Darren Walsh <theq@bigpond.net.au> wrote:
|I have a new hard drive. And want to basically take the /usr directory, and
|throw it on that drive, and then mount the new drive under /usr.
|
|How do I get a copy of /usr , with all the links done properly?
|
|(cp -R didnt copy links properly (copied the file it was pointing too))


partition the new drive, make a file system on the partition
( mke2fs ) and mount the new /usr as something like /newusr

Now run the following commandi (as root):

cd /usr
tar clf - . | ( cd /newusr && tar xpf - )

This makes a tar archive of the /usr directory and passes it directly
to another tar which is runninf in a sub-shell that has it working
directory changed to the new partition. The second tar extracts all the
files.

The 'l' in the first tar limits it to the one filesystem ( so if
/usr/local is a diferent partition it won't get copied ), the 'p'
in the secont tar is to extract all permission data. ( it might
be needed on the first as well. I've never had any problems
not using it at all ).


-- 
Reverend Paul Colquhoun,      postmaster@andor.dropbear.id.au
Universal Life Church    http://andor.dropbear.id.au/~paulcol
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
xenaphobia: The fear of being beaten to a pulp by
            a leather-clad, New Zealand woman.
Technical Details
Message-ID: <slrn7vauqu.803.postmaster@tux.andor.dropbear.id.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7t17hd$nel$1@m2.c2.telstra-mm.net.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 100c5f,aff733d416733c45
X-Google-Attributes: gid100c5f,public
X-Google-Thread: 136b98,aff733d416733c45
X-Google-Attributes: gid136b98,public
X-Google-Thread: 102983,aff733d416733c45
X-Google-Attributes: gid102983,public
X-Google-Thread: fb7a0,aff733d416733c45
X-Google-Attributes: gidfb7a0,public
From: postmaster@andor.dropbear.id.au (Paul Colquhoun)
Subject: Re: Copying
Date: 1999/10/02
Message-ID: <slrn7vauqu.803.postmaster@tux.andor.dropbear.id.au>
X-Deja-AN: 531790603
References: <7t17hd$nel$1@m2.c2.telstra-mm.net.au>
X-Complaints-To: abuse@telstra.net
X-Trace: nsw.nnrp.telstra.net 938835602 139.130.41.199 (Sat, 02 Oct 1999 13:40:02 EST)
Organization: Customer of Telstra Big Pond Direct
User-Agent: slrn/0.9.5.4 (UNIX)
Reply-To: <postmaster@andor.dropbear.id.au>
NNTP-Posting-Date: Sat, 02 Oct 1999 13:40:02 EST
Newsgroups: alt.linux,aus.computers.linux,bigpond.cable.tech.linux,linux.debian.user