[Durham] rsync

Richard Mortimer richm at oldelvet.org.uk
Tue Apr 3 00:04:40 UTC 2012



On 02/04/2012 22:56, Andrew Glass wrote:
>
> Anyway, Id like to create an lvm group as now have 3 x 1tb drives and id like to create a big pot that I can expand for future use etc.
Think about what you are doing carefully. I use
LVM a lot and really like it but if you are effectively just
using it to concatenate drives then you may be storing up
future trouble.

Basically if one drive fails then the other 2 are useless and
you've lost the lot. Some form of raid may be a better option.
I often just use mirroring (normally only 2 drives). But I do
break each disk up into smaller partitions and mirror those.
That way if you get a transient fault (OS crash etc.) then
only a portion of the drive needs syncing.

>
> Would it therefore be better to create an lvm group on 2 of the 3 1tb drives,
 > then rsync the data from the main drive to that?
 > Then format and add the final drive to the lvm pot?
That's along the right lines depending on how you decide to
raid/stripe/concat the drives.

>
> Im not sure how to go about it?  Any suggestions?
>  Im just reading the lvm tutorial on howtoforge at the moment.
>

rsync itself if really quite easy. At its simplest copying from one 
directory to another on the same machine (i.e. what you are talking 
about above) use something like the following as root

rsync -va /src /dest

But there are a few gotchas:

1 - make sure that you don't copy the contents of things like /proc and 
/sys  --exclude /proc
2 - make sure that you don't have any network mounted drives present (or 
exclude them explicitly as per /proc)
3 - exclude /dest from the source files/directories else you could get 
into a mess.
4 - --dry-run is a good thing to add until you are happy that you have
the right commandline!

A decent starting point would be

rsync -va --dry-run --exclude /dest --exclude '/proc/*' --exclude 
'/sys/*' / /dest

Once you have got the rsync command right you can re-run it any number 
of times to refresh your dest with the lastest source.

There's an art to switching the boot drive over and making sure that
things get mounted properly. I'm not gonna go into that at the mo. I'm 
sure others can fill in the gaps.

Richard

P.S. I'm very interested to hear others ideas for partitioning the 
drives etc. I've found something that seems to work for me but you never 
know. Of course the coming of BTRFS will render all this obsolete but 
that's been almost ready for a few years now :-)





> Cheers
>
> Andy
>
>
> On 2 Apr 2012, at 22:45, Richard Patterson wrote:
>
>> rsync can do lots of stuff... even over SSH - I use it to do backups of a couple of servers over SSH...
>>
>> If you say exactly what you want to do, I can probably tell you the best way to do it...
>>
>> I like LVM it has many possibilities, it can do snapshots, etc... it's only really great if you don't want to allocate your entire drive in one go, or if you think you'll want to add extra drives and expand volumes later...
>>
>> Again it's one of those things that you don't realise how powerful it is until you start using it...
>>
>> Let me know...
>>
>> Regards
>>
>> Richard
>>
>> --
>> Richard Patterson
>> HelpQuick Limited
>>
>> Sent from my Android Phone
>>
>> Andrew Glass<andrewglass3 at gmail.com>  wrote:
>>
>>
>> Hey guys :)
>>
>> Ive never used rsync before but I think it can accomplish what I require??
>>
>> Id like to ssh into my server and copy everything from one drive to a new drive.
>>
>> Would this be the best option?  What options would you use to do this?
>>
>> I was also considering going lvm with my storage too... Anyone got any good or bad experiences with LVM? Whats your thoughts on it?
>>
>> Cheers as always
>>
>> Andy
>>
>>
>> _______________________________________________
>> Durham mailing list   -   Durham at mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/durham
>> http://www.nelug.org.uk/
>>
>> _______________________________________________
>> Durham mailing list   -   Durham at mailman.lug.org.uk
>> https://mailman.lug.org.uk/mailman/listinfo/durham
>> http://www.nelug.org.uk/
>
>
> _______________________________________________
> Durham mailing list   -   Durham at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/durham
> http://www.nelug.org.uk/



More information about the Durham mailing list