Copy whole filesystem to another filesystem over network

Copy whole filesystem to another filesystem over network

Post by kellyb » Sat, 01 Dec 2001 06:22:26



Here's my spec:

Server #1: (it's a Samba server)
/hda1 <-- "/"

/hdb1 <-- "/home"  it got plently of space...about 20G left

Server #2: (my linux workstation)

/hda1 <-- "/"
/hdb1 <-- "/home" a 40G 7200 HD.... only 5G are used while rest are
free....

I need to repartition /hdb (probably into 4 partitions 10G each).

I need to temporarily copy over the 5G worth of content on /hdb from
Server #2 to /hdb1 of Server #1. So I can repartition the /hdb and
then copy the content back from Server #1.

My question..what is the best way to do it?

rsync?  or just mount NFS and cp /home/* /home/server2?

want more efficient and safe and quicky way as possible without
stress...

thanks..

kellyboy

 
 
 

Copy whole filesystem to another filesystem over network

Post by Michael Heimin » Sat, 01 Dec 2001 07:35:22



22:22:

Quote:> Here's my spec:

> Server #1: (it's a Samba server)
> /hda1 <-- "/"

> /hdb1 <-- "/home"  it got plently of space...about 20G left

> Server #2: (my linux workstation)

> /hda1 <-- "/"
> /hdb1 <-- "/home" a 40G 7200 HD.... only 5G are used while rest are
> free....

> I need to repartition /hdb (probably into 4 partitions 10G each).

> I need to temporarily copy over the 5G worth of content on /hdb from
> Server #2 to /hdb1 of Server #1. So I can repartition the /hdb and
> then copy the content back from Server #1.

> My question..what is the best way to do it?

> rsync?  or just mount NFS and cp /home/* /home/server2?

> want more efficient and safe and quicky way as possible without
> stress...

It doesnt really matter, you could even create a tar file, pipe it
through ssh and untar it on the other side right on the disk, if you
use cp, try the -a switch, your command won't do much, 'man cp' for
more info.

Michael Heiming

 
 
 

Copy whole filesystem to another filesystem over network

Post by Eric P. McC » Sat, 01 Dec 2001 10:52:18



> I need to temporarily copy over the 5G worth of content on /hdb from
> Server #2 to /hdb1 of Server #1. So I can repartition the /hdb and
> then copy the content back from Server #1.
> My question..what is the best way to do it?

You could use `dump' (which may not exist for your type of FS) and
`restore', in addition to the typical tar/cpio solution.  If you are,
say, running XFS and making use of ACLs or EAs, you'll have to use
dump/restore to preserve that data.

Quote:> rsync?  or just mount NFS and cp /home/* /home/server2?

I've been doing this a lot, lately, generally like so:

  # tar -cl / | tar -C /mnt --same-owner -xkp

`-k' prevents you from overwriting existing files.  You may not need
it, but I did to keep tar from tromping all over my carefully-designed
symlinks.

Quote:> want more efficient and safe and quicky way as possible without
> stress...

If you use a generic ssh tunnel (or whatever; someone else suggested
it), definitely use gzip or bzip2.  It will reduce the amount of data
which goes across the network, which will probably halve or third the
total time.  Whether you use bzip2 or gzip depends on the CPU power on
both ends: probably you'll need a midrange P3 (at least) to keep from
swamping the CPUs.

--

"I woke up this morning and realized what the game needed: pirates,
pimps, and gay furries."  - Rich "Lowtax" Kyanka

 
 
 

Copy whole filesystem to another filesystem over network

Post by David Efflan » Sat, 01 Dec 2001 17:29:46



Quote:> Here's my spec:

> Server #1: (it's a Samba server)
> /hda1 <-- "/"

> /hdb1 <-- "/home"  it got plently of space...about 20G left

> Server #2: (my linux workstation)

> /hda1 <-- "/"
> /hdb1 <-- "/home" a 40G 7200 HD.... only 5G are used while rest are
> free....

> I need to repartition /hdb (probably into 4 partitions 10G each).

> I need to temporarily copy over the 5G worth of content on /hdb from
> Server #2 to /hdb1 of Server #1. So I can repartition the /hdb and
> then copy the content back from Server #1.

> My question..what is the best way to do it?

When I was repartitioning and installing SuSE 7.3 Pro in place of 7.1
personal, I went the nfs route and used 'cp -a' to copy /etc, /home and
/root to a dir on an 'archive' partition on my old Mandrake 7.0 box so I
could selectively transfer back what I wanted to or refer to previous
settings.  I didn't have anything in /usr/local I needed to keep.

--
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

Copy whole filesystem to another filesystem over network

Post by DanH » Sat, 01 Dec 2001 20:27:53




>>Here's my spec:

>>Server #1: (it's a Samba server)
>>/hda1 <-- "/"

>>/hdb1 <-- "/home"  it got plently of space...about 20G left

>>Server #2: (my linux workstation)

>>/hda1 <-- "/"
>>/hdb1 <-- "/home" a 40G 7200 HD.... only 5G are used while rest are
>>free....

>>I need to repartition /hdb (probably into 4 partitions 10G each).

>>I need to temporarily copy over the 5G worth of content on /hdb from
>>Server #2 to /hdb1 of Server #1. So I can repartition the /hdb and
>>then copy the content back from Server #1.

>>My question..what is the best way to do it?

> When I was repartitioning and installing SuSE 7.3 Pro in place of 7.1
> personal, I went the nfs route and used 'cp -a' to copy /etc, /home and
> /root to a dir on an 'archive' partition on my old Mandrake 7.0 box so I
> could selectively transfer back what I wanted to or refer to previous
> settings.  I didn't have anything in /usr/local I needed to keep.

Don't know about 'best' but I tend to mount the blank disk on the box to
back up and

mkdir /tmp/usrback
mount -f nfs othersystem:/blankusr /tmp/usrback
cd /usr; tar cfl - . | (cd /tmp/usrback; tar xfBp -)

I've backed up many a filesystem that way.

--
Air Cav Reference Board
http://www.veryComputer.com/
UNIX - Not just for vestal *s anymore

 
 
 

Copy whole filesystem to another filesystem over network

Post by Ron Grig » Sat, 01 Dec 2001 21:54:29





> >>Here's my spec:

> >>Server #1: (it's a Samba server)
> >>/hda1 <-- "/"

> >>/hdb1 <-- "/home"  it got plently of space...about 20G left

> >>Server #2: (my linux workstation)

> >>/hda1 <-- "/"
> >>/hdb1 <-- "/home" a 40G 7200 HD.... only 5G are used while rest are
> >>free....

> >>I need to repartition /hdb (probably into 4 partitions 10G each).

> >>I need to temporarily copy over the 5G worth of content on /hdb from
> >>Server #2 to /hdb1 of Server #1. So I can repartition the /hdb and
> >>then copy the content back from Server #1.

> >>My question..what is the best way to do it?

> > When I was repartitioning and installing SuSE 7.3 Pro in place of 7.1
> > personal, I went the nfs route and used 'cp -a' to copy /etc, /home and
> > /root to a dir on an 'archive' partition on my old Mandrake 7.0 box so I
> > could selectively transfer back what I wanted to or refer to previous
> > settings.  I didn't have anything in /usr/local I needed to keep.

> Don't know about 'best' but I tend to mount the blank disk on the box to
> back up and

> mkdir /tmp/usrback
> mount -f nfs othersystem:/blankusr /tmp/usrback
> cd /usr; tar cfl - . | (cd /tmp/usrback; tar xfBp -)

> I've backed up many a filesystem that way.

> --
> Air Cav Reference Board
> http://www.veryComputer.com/
> UNIX - Not just for vestal *s anymore

nfs takes about three times longer.  Try:

rsh othersystem "cd /blankusr ;tar cfp - ."|(cd /tmp/usrback; tar xvfp -)

Ron