( crossing with John's post, and largely consistent with it... :-)

Ralph's right that you can probably use 'cp' rather than rsync, but it's
not a great overhead and would mean that you could then do the same another
time to keep b up to date with a. You need to have the 'recursive' option
set for 'cp', but -a includes that so you're  OK.

If you use rsync you have to watch out for the distinction between a
directory as a file in itself and a directory as a directory as a folder of
other files. The command you give above:
sudo rsync -r -a sda3/home sdb4/home

(from root directoiry '/' presumably)
will give you a destination structure /sdb4/home/home/user1 and
/sdb4/home/home/user2
if sdb4/home already exists.

On the other hand,

sudo rsync -r -a sda3/home/ sdb4/home
should give you a destination structure /sdb4/home/user1 and /
sdb4/home/user2

as will
sudo rsync -r -a sda3/home/* sdb4/home

On 21 July 2015 at 12:42, Ralph Corderoy <[email protected]> wrote:

> Hi Clive,
>
> > sudo rsync -r -a sda3/home sdb4/home
>
> Since source and destination are on the same machine, and you're not
> trying to update an old copy to match an original that's since changed,
> you may as well use cp(1).
>
> Probably,
>
>     sudo cp -a --preserve=all --sparse=always /home /mnt/sdb4/home
>
> assuming /dev/sdb4 is mounted at /mnt/sdb4, adjust to suit, and that
> /mnt/sdb4/home doesn't already exist, e.g. another home will be put
> inside it.  (Please correct me if I'm wrong, everyone else.  :-)
>
> > Reason is a partial upgrade of the operating system which is on sda1
> > of the first disc.
>
> So is this just a backup in case things go awry?
>
> > Will using rsync take long to move 52Gb of data? (1 or 2 hrs?)
>
> Quite a bit less than that, I'd have thought.
>
> > Is it safe to do this while sda is mounted or should I do it from a
> > live disc?
>
> You need /dev/sda3 mounted so /home is visible as a bunch of directories
> and files.  From a live disk you could copy the sda3 partition to a
> partition on sdb;  that would be a byte for byte copy, not caring that
> it has a filesystem on it.  Depends what your end aim is.
>
> Cheers, Ralph.
>
> --
> Next meeting:  Bournemouth, Tuesday, 2015-08-04 20:00
> Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
> New thread:  mailto:[email protected] / CHECK IF YOU'RE REPLYING
> Reporting bugs well:  http://goo.gl/4Xue     / TO THE LIST OR THE AUTHOR
>



-- 
best regards,
웃
Victor Churchill,
Bournemouth
--
Next meeting:  Bournemouth, Tuesday, 2015-08-04 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread:  mailto:[email protected] / CHECK IF YOU'RE REPLYING
Reporting bugs well:  http://goo.gl/4Xue     / TO THE LIST OR THE AUTHOR

Reply via email to