Re: clone a disk

2015-07-19 Thread Simon Hobson
Thierry Granier th.gran...@free.fr wrote:

 the backup is created on the source machine
 i don't see how to get this backup on the destination machine and how to boot 
 on this machine (for this backup)

By specifying user@address:path you are telling rsync to copy the files ot a 
remote machine - that's how the backup gets to the other machine.
To make it bootable, you'll need to arrange that the root of the remote path is 
the root of it's own filesystem, then you can do some stuff with chroot and 
install grub on the appropriate disk.

I don't normally bother trying to keep backups bootable. I'll just prepare a 
system to restore to, create the filesystems, create the mointpoints and mount 
all the filesystems, and then rsync all the files back. This can be done while 
booted from a live-CD environment - or for virtual machines, by mounting the 
filesystems on the host (but be careful not to restore your backup to the wrong 
place and wipe the host filesystem, it's inconvenient !)

NB - please keep replies to the list.



Kevin Korb k...@sanitarium.net wrote:

 I would add --numeric-ids and --itemize-changes.

Rats, yes you *must* specify numeric-ids or the backup is usually a bit 
broken as ownership information will get mangled.

 Also, I prefer to do backups by filesystem so I would add
 - --one-file-system and run one rsync per filesystem.  This means you
 don't have to exclude things like /proc and /dev and any random thing
 that isn't normally connected but sometimes is but it also means you
 have to list all the filesystems that you do want to backup.

Yeah, that's a bit 6 of one, half a dozen of the other.
I prefer to have a backup that is a complete image of the source directory tree 
- rather than several backups, one per filesystem. You can do the former while 
doing one sync per filesystem, but you have to be a bit clever with your 
excludes to avoid the sync of the root deleting all the other filesystems 
before the next step puts them back again.
And I sometimes re-arrange my volumes during a restore - and then it's easier 
to have one backup tree rather than one per filesystem.


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: clone a disk

2015-07-17 Thread Larry Irwin (gmail)

Hi TG,
You can keep an up-to-date copy of the files/folders/pipes/etc. in the 
100GB space using rsync, but not a true clone of the partition.
To get a true clone of the boot partition, you'd need to boot from a 
rescue CD, mount the other machine's 100GB space and dd the boot 
partition device to a file on the 100GB space.
You'd also probably want to get the Master Boot Record by grabbing the 
first 2K of the raw boot device into a separate file...

i.e. something like:
dd bs=512 if=/dev/sda1 of=/mnt/u/backup/jessie_sda1
dd bs=512 count=4 if=/dev/sda of=/mnt/u/backup/jessie_mbr_sda
The device names might be different - the mount folder may be different 
- etc...
But the idea works. - With a new, blank drive, you could recreate the 
partitions using fdisk, reverse the dd commands, boot and then work on 
getting the second partition back up and running.


--
Larry Irwin

On 07/17/2015 01:40 PM, Thierry Granier wrote:

Hello
i have a machine A with 2 disks 1 et 2 running Debian Jessie
on 1 is the system and the boot and the swap
on 2 different partitions like /home /opt ETC.

i have a machine B with 1 disk running kali-linux and *100G free*

Can i clone the disk 1 of machine A on the 100G free on machine B with 
rsync?


If it is possible, how to do that?
Many thanks
TG




-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: clone a disk

2015-07-17 Thread Simon Hobson
Thierry Granier th.gran...@free.fr wrote:

 i have a machine A with 2 disks 1 et 2 running Debian Jessie
 on 1 is the system and the boot and the swap
 on 2 different partitions like /home /opt ETC.
 
 i have a machine B with 1 disk running kali-linux and 100G free
 
 Can i clone the disk 1 of machine A on the 100G free on machine B with rsync?
 
 If it is possible, how to do that?

Yes, it's easy to do, I do that for the primary backup on all my systems.

Lets say you are doing it from machine a, and backing up to directory /backup_a 
on b. Logged in as root then you could do it with :
rsync -avH --delete --exclude-from=/etc/rsync_excludes / root@b:/backup_a/
-a means archive and sets several parameters, v simply makes things verbose, 
H means correctly handle hard linked files. --delete means delete files from 
the destination that have been removed from the source, and --exclude-from 
specifies a file containing a list of exclusions to omit.
You need to exclude a bunch of stuff, things like /dev/*, /proc/*, /sys/*, and 
so on. You can also exclude things you don't want to copy such as log files.

However, this is interactive and also needs permission to log in as root on the 
destination (which I block for security). Far better, for regular backups, to 
use rsync as a service on the destination which only needs a few more steps.

Also note that trailing /s on source and destination are significant. 
root@b:/backup_a/ will produce different results to root@b:/backup_a !


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


clone a disk

2015-07-17 Thread Thierry Granier

Hello
i have a machine A with 2 disks 1 et 2 running Debian Jessie
on 1 is the system and the boot and the swap
on 2 different partitions like /home /opt ETC.

i have a machine B with 1 disk running kali-linux and *100G free*

Can i clone the disk 1 of machine A on the 100G free on machine B with 
rsync?


If it is possible, how to do that?
Many thanks
TG
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Re: clone a disk

2015-07-17 Thread Kevin Korb
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

This is good info for backing up the MBR (which includes the partition
table).

However, if you are going to image a partition use either ddrescue
(does the same thing but has a status screen, can resume, and works
around read errors) or partimage (has a status screen and it
understands (most) filesystems so it can leave the empty space sparse).

On 07/17/2015 02:48 PM, Larry Irwin (gmail) wrote:
 Hi TG, You can keep an up-to-date copy of the
 files/folders/pipes/etc. in the 100GB space using rsync, but not a
 true clone of the partition. To get a true clone of the boot
 partition, you'd need to boot from a rescue CD, mount the other
 machine's 100GB space and dd the boot partition device to a file on
 the 100GB space. You'd also probably want to get the Master Boot
 Record by grabbing the first 2K of the raw boot device into a
 separate file... i.e. something like: dd bs=512 if=/dev/sda1
 of=/mnt/u/backup/jessie_sda1 dd bs=512 count=4 if=/dev/sda
 of=/mnt/u/backup/jessie_mbr_sda The device names might be different
 - the mount folder may be different - etc... But the idea works. -
 With a new, blank drive, you could recreate the partitions using
 fdisk, reverse the dd commands, boot and then work on getting the
 second partition back up and running.
 
 -- Larry Irwin
 
 On 07/17/2015 01:40 PM, Thierry Granier wrote:
 Hello i have a machine A with 2 disks 1 et 2 running Debian
 Jessie on 1 is the system and the boot and the swap on 2
 different partitions like /home /opt ETC.
 
 i have a machine B with 1 disk running kali-linux and *100G
 free*
 
 Can i clone the disk 1 of machine A on the 100G free on machine B
 with rsync?
 
 If it is possible, how to do that? Many thanks TG
 
 
 
 
 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
- -*~
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
- -*~
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlWpV+kACgkQVKC1jlbQAQc47gCeNqRbq5PGVmvC61Qby2saHo9z
Q3wAn2ZSoBM080XyQ8j7DXJn7TBeEL6A
=EhNc
-END PGP SIGNATURE-

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: clone a disk

2015-07-17 Thread Kevin Korb
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I would add --numeric-ids and --itemize-changes.  Up to you if you
need --xattrs or --acls.

Also, I prefer to do backups by filesystem so I would add
- --one-file-system and run one rsync per filesystem.  This means you
don't have to exclude things like /proc and /dev and any random thing
that isn't normally connected but sometimes is but it also means you
have to list all the filesystems that you do want to backup.

On 07/17/2015 02:21 PM, Simon Hobson wrote:
 Thierry Granier th.gran...@free.fr wrote:
 
 i have a machine A with 2 disks 1 et 2 running Debian Jessie on 1
 is the system and the boot and the swap on 2 different partitions
 like /home /opt ETC.
 
 i have a machine B with 1 disk running kali-linux and 100G free
 
 Can i clone the disk 1 of machine A on the 100G free on machine B
 with rsync?
 
 If it is possible, how to do that?
 
 Yes, it's easy to do, I do that for the primary backup on all my
 systems.
 
 Lets say you are doing it from machine a, and backing up to
 directory /backup_a on b. Logged in as root then you could do it
 with : rsync -avH --delete --exclude-from=/etc/rsync_excludes /
 root@b:/backup_a/ -a means archive and sets several parameters, v
 simply makes things verbose, H means correctly handle hard linked
 files. --delete means delete files from the destination that have
 been removed from the source, and --exclude-from specifies a file
 containing a list of exclusions to omit. You need to exclude a
 bunch of stuff, things like /dev/*, /proc/*, /sys/*, and so on. You
 can also exclude things you don't want to copy such as log files.
 
 However, this is interactive and also needs permission to log in as
 root on the destination (which I block for security). Far better,
 for regular backups, to use rsync as a service on the destination
 which only needs a few more steps.
 
 Also note that trailing /s on source and destination are
 significant. root@b:/backup_a/ will produce different results to
 root@b:/backup_a !
 
 

- -- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
- -*~
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
- -*~
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlWpWJ8ACgkQVKC1jlbQAQfL5ACfT0vOkim+7HE53/pqfsSzaA1U
KN8AoOKGhNGI2xzZrco9Li9jv9Y/6cFi
=+mSP
-END PGP SIGNATURE-

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html