🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

11 total messages Started by Darren Walsh Fri, 01 Oct 1999 00:00
Copying
#640
Author: Darren Walsh
Date: Fri, 01 Oct 1999 00:00
8 lines
1282 bytes
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))

Darren
Re: Copying
#647
Author: john
Date: Thu, 30 Sep 1999 00:00
17 lines
1386 bytes
Darren Walsh 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))
>
> Darren

Try cp -rfp /usr target/dir



--
Please remove *NOSPAM* for Email reply...
Re: Copying
#641
Author: Richard Zack
Date: Fri, 01 Oct 1999 00:00
27 lines
1700 bytes
> 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))
>

I'd make a "tarball"!

cd /usr
tar -cvv -f newfile.tar *
cp newfile.tar /newusr
rm -rf /usr
mv /newusr /usr


Richard Zack     <richard@pantek.com>
Red Hat Certified Engineer (RHCE)

Pantek Incorporated  -  www.pantek.com
---------------------------------------------------
Commercial Linux Support and Solutions Center
Network Consulting and Network Security
Internet Access Solutions
440-708-1855
---------------------------------------------------
Re: Copying
#642
Author: Steve Oxley
Date: Fri, 01 Oct 1999 00:00
24 lines
1834 bytes
In article <37F433E9.D6C97D1@pantek.com>, Richard Zack wrote:
>I'd make a "tarball"!
>cd /usr
>tar -cvv -f newfile.tar *
>cp newfile.tar /newusr
>rm -rf /usr
>mv /newusr /usr
>Richard Zack     <richard@pantek.com>

Or better still, mount the new disk under /mnt, and then:
cd /usr
tar cf - . | (cd /mnt;tar xvf - )

two lines, much faster, no copying dirty great big tar balls around.

Steve

-- 
+------------------------------------------------------------------------+
| Stephen Oxley, Shared Systems,                    Tel: +61-3-990-55738 |
| Computer Centre, Monash University,               Fax: +61-3-990-54746 |
| Clayton, Victoria,            ICBM: S37 54' 38.8" E145 07' 47.1" +200m |
| Australia, 3168.               E-Mail: Stephen.Oxley@its.monash.edu.au |
+------------------------------------------------------------------------+
Re: Copying
#643
Author: loki
Date: Fri, 01 Oct 1999 00:00
28 lines
1603 bytes
Steve Oxley <viking@valhalla.cc.monash.edu.au> wrote unto us:
>In article <37F433E9.D6C97D1@pantek.com>, Richard Zack wrote:
>>I'd make a "tarball"!
>>cd /usr
>>tar -cvv -f newfile.tar *
>>cp newfile.tar /newusr
>>rm -rf /usr

  I think removing the old /usr so fast is probably a bad idea, it's better
to keep it around, possibly reboot to make sure everything works fine, and
then think about deleting it.

>>mv /newusr /usr
>>Richard Zack     <richard@pantek.com>
>
>Or better still, mount the new disk under /mnt, and then:
>cd /usr
>tar cf - . | (cd /mnt;tar xvf - )

  This is less line and doesn't use disk space for a temp file, but isn't it
possibly going to use a heck of a lot of RAM?


-- 
    loki
eloki/at/zip.com.au

Dare I disturb the universe?  You bet I do! :)
Re: Copying
#644
Author: Thorfinn
Date: Fri, 01 Oct 1999 00:00
41 lines
2894 bytes
In aus.computers.linux, on 1 Oct 1999 05:21:57 GMT
loki <eloki@zip.com.au-nospam> wrote:
> Steve Oxley <viking@valhalla.cc.monash.edu.au> wrote unto us:
> >In article <37F433E9.D6C97D1@pantek.com>, Richard Zack wrote:
> >>mv /newusr /usr

Eek.  No.  Just use the tar trick below, then change your /etc/fstab
to mount the new disk on /usr instead of the old partition... then
reboot (and make *sure* you've got some sort of fully bootable rescue
disk so you can mount the root filesystem and change /etc/fstab *back*
if you need to), and check it worked.

> >Or better still, mount the new disk under /mnt, and then:
> >cd /usr
> >tar cf - . | (cd /mnt;tar xvf - )

Yeps.

>   This is less line and doesn't use disk space for a temp file, but isn't it
> possibly going to use a heck of a lot of RAM?

Nope.  It's a pipe.  Unix pipes DON'T store everything from the input
process then push the whole thing through to the next process.  That's
msdog pipes (which use temporary disk files, blech!).

Both processes run (look ma!  multitasking! :)), output from the first
one gets piped through to the second one, while they're both running.
Usually the first process will use blocking output calls, which means
that if the second process isn't pulling stuff out of the pipe fast
enough, the first process will wind up blocking on its output...

It's all very sexy stuff. :)

ook,

  Thorfinn

-- 
<a href = "http://netizen.com.au/~thorfinn/">thorfinn@netizen.com.au</a>
I cannot believe that God plays dice with the cosmos.
    -- Albert Einstein, on the randomness of quantum mechanics
Re: Copying: What I did
#645
Author: Darren Walsh
Date: Fri, 01 Oct 1999 00:00
56 lines
3429 bytes
I "cp -a * /mnt" with the new usr mounted on /mnt

Then changed fstab to include new mount to mount to /usr
rebooted, all worked perfectly. So I commented out the line mounting the new
/usr and rebooted
deleted to old /usr
manually mounted the new /usr into /usr, then I uncommented fstab and
rebooted
All worked fine EXCEPT when I had no usr directory, but manually mounting
the new one was no prob.


Thorfinn <thorfinn@netizen.com.au> wrote in message
news:slrn7v8jk8.cj.thorfinn@netizen.com.au...
> In aus.computers.linux, on 1 Oct 1999 05:21:57 GMT
> loki <eloki@zip.com.au-nospam> wrote:
> > Steve Oxley <viking@valhalla.cc.monash.edu.au> wrote unto us:
> > >In article <37F433E9.D6C97D1@pantek.com>, Richard Zack wrote:
> > >>mv /newusr /usr
>
> Eek.  No.  Just use the tar trick below, then change your /etc/fstab
> to mount the new disk on /usr instead of the old partition... then
> reboot (and make *sure* you've got some sort of fully bootable rescue
> disk so you can mount the root filesystem and change /etc/fstab *back*
> if you need to), and check it worked.
>
> > >Or better still, mount the new disk under /mnt, and then:
> > >cd /usr
> > >tar cf - . | (cd /mnt;tar xvf - )
>
> Yeps.
>
> >   This is less line and doesn't use disk space for a temp file, but
isn't it
> > possibly going to use a heck of a lot of RAM?
>
> Nope.  It's a pipe.  Unix pipes DON'T store everything from the input
> process then push the whole thing through to the next process.  That's
> msdog pipes (which use temporary disk files, blech!).
>
> Both processes run (look ma!  multitasking! :)), output from the first
> one gets piped through to the second one, while they're both running.
> Usually the first process will use blocking output calls, which means
> that if the second process isn't pulling stuff out of the pipe fast
> enough, the first process will wind up blocking on its output...
>
> It's all very sexy stuff. :)
>
> ook,
>
>   Thorfinn
>
> --
> <a href = "http://netizen.com.au/~thorfinn/">thorfinn@netizen.com.au</a>
> I cannot believe that God plays dice with the cosmos.
>     -- Albert Einstein, on the randomness of quantum mechanics
Re: Copying
#635
Author: 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.
Re: Copying
#631
Author: Celestial Wizard
Date: Wed, 06 Oct 1999 00:00
45 lines
2268 bytes
do you how big /usr is????

--

Celestial Wizard

President
South East Brisbane Linux Users Group
http://merlin.hatfields.com.au/seblug/

Linux - Where You WANT To Be!


Richard Zack <richard@pantek.com> wrote in message
news:37F433E9.D6C97D1@pantek.com...
> > 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))
> >
>
> I'd make a "tarball"!
>
> cd /usr
> tar -cvv -f newfile.tar *
> cp newfile.tar /newusr
> rm -rf /usr
> mv /newusr /usr
>
>
> Richard Zack     <richard@pantek.com>
> Red Hat Certified Engineer (RHCE)
>
> Pantek Incorporated  -  www.pantek.com
> ---------------------------------------------------
> Commercial Linux Support and Solutions Center
> Network Consulting and Network Security
> Internet Access Solutions
> 440-708-1855
> ---------------------------------------------------
>
>
Re: Copying
#632
Author: Bill Unruh
Date: Wed, 06 Oct 1999 00:00
23 lines
1670 bytes
In <arAK3.430$Nr6.831@news2.usenetserver.com> "Celestial Wizard" <celestialwizard@merlin.hatfields.com.au> writes:

]do you how big /usr is????

]Richard Zack <richard@pantek.com> wrote in message
]news:37F433E9.D6C97D1@pantek.com...
]> > I have a new hard drive. And want to basically take the /usr directory,
]> > 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?
]> I'd make a "tarball"!
]>

cd /usr
tar -cf - . |(cd /newusr; tar -xpf - )
is the standard way metioned at the end of man tar.

]> cd /usr
]> tar -cvv -f newfile.tar *
]> cp newfile.tar /newusr
]> rm -rf /usr

This uses up a huge amount of space in newfile.
]> mv /newusr /usr
Re: Copying
#634
Author: Richard Zack
Date: Thu, 07 Oct 1999 00:00
60 lines
2610 bytes
Then look at either dd, cpio or cp -R :)

Celestial Wizard wrote:

> do you how big /usr is????
>
> --
>
> Celestial Wizard
>
> President
> South East Brisbane Linux Users Group
> http://merlin.hatfields.com.au/seblug/
>
> Linux - Where You WANT To Be!
>
> Richard Zack <richard@pantek.com> wrote in message
> news:37F433E9.D6C97D1@pantek.com...
> > > 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))
> > >
> >
> > I'd make a "tarball"!
> >
> > cd /usr
> > tar -cvv -f newfile.tar *
> > cp newfile.tar /newusr
> > rm -rf /usr
> > mv /newusr /usr
> >
> >
> > Richard Zack     <richard@pantek.com>
> > Red Hat Certified Engineer (RHCE)
> >
> > Pantek Incorporated  -  www.pantek.com
> > ---------------------------------------------------
> > Commercial Linux Support and Solutions Center
> > Network Consulting and Network Security
> > Internet Access Solutions
> > 440-708-1855
> > ---------------------------------------------------
> >
> >

--
Richard Zack     <richard@pantek.com>
Red Hat Certified Engineer (RHCE)

Pantek Incorporated  -  www.pantek.com
---------------------------------------------------
Commercial Linux Support and Solutions Center
Network Consulting and Network Security
Internet Access Solutions
440-708-1855
---------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads