rsync across disks

openSuse V12.3 64

from a command line, how do you rsync from 1 disk to another?

the name of the second disk is Eight

rsync -v -r -u -p -W -x --delete --progress --stats --log-file=rsync.log /David/ /Eight/David/

thank you

The basic format would be:

sudo rsync -av --delete /Directory1/ /Directory2/

Use sudo to backup files owned by root. You can can combine single dash commands together. You may want to add the --exclude= command for root or other backups:

sudo rsync -av --delete / /director2. --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

Thank You,

Great, I’ll include sudo, but my problem is identifying the destination disk.

Using gnome, applications, disks, I can see the first disk has 3 partitions, /dev/sda1 (swap), /dev/sda2 (bootable), /dev/sda3 (my files), and the second disk is /dev/sdb1 (more files).

From a terminal command line, an ls command will display directories on /dev/sda3, and I assume rsync doesn’t need the disk info if source and destination are both on that disk.

Here is my question: Whats the syntax to include the disk info in the destination, is it something like.

sudo rsync -av --delete /Directory1/ /dev/sda3/Directory2/  

or is it

sudo rsync -av --delete /Directory1/ /dev/sda3:Directory2/ 








Thank you.

‘df -l’ will show you the mountpoint of the device. That will be your target directory.

On Wed 16 Oct 2013 10:46:02 PM CDT, rih5342 wrote:

Great, I’ll include sudo, but my problem is identifying the destination
disk.

Using gnome, applications, disks, I can see the first disk has 3
partitions, /dev/sda1 (swap), /dev/sda2 (bootable), /dev/sda3 (my
files), and the second disk is /dev/sdb1 (more files).

From a terminal command line, an ls command will display directories on
/dev/sda3, and I assume rsync doesn’t need the disk info if source and
destination are both on that disk.

Here is my question: Whats the syntax to include the disk info in the
destination, is it something like.

Code:

sudo rsync -av --delete /Directory1/ /dev/sda3/Directory2/

or is it

sudo rsync -av --delete /Directory1/ /dev/sda3:Directory2/


Thank you.

Hi
It’s the mount point not the dev(ice) partition.

If you own the directories as your user there is no need for sudo.

I use the following to rsync various data directories to an external
device;


/usr/bin/rsync -rlLtuzi --stats --progress --delete \
/data/$X/* $TARGET_DEV/$HOST_DEV/$X/

X is a list of directories I want backed up, TARGET_DEV is the mount
point and HOST_DEV is a directory on the target device owned by me.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 12.3 (x86_64) GNOME 3.8.4 Kernel 3.7.10-1.16-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

I’m all set, thank you.

Guess I spoke too soon.

How do I delete directories on the rsync’d disk?

All file’s and folders have X’s and locks on the icons, I can’t change permissions.

When I login as root, the second disk doesn’t appear.

Thank you.

Hi
Can you post the output from the command (with the second disk attached);


lsblk

Can you cd to the second disk and post the output from;


ls -la

Here’s my problem, I’m a new linux user and the disk mount paradigm makes no sense ( to a windows user).

Here’s what I did since my last post.

  1. login as root, go find the second disk (using gnome, applications, disk), delete the files and directories, logout.
  2. login as me, can’t find the disk, logout, login as root, unmount the disk, logout.
  3. login as me, mount the disk, redo the rsync with better source and destinations, which now works as follows ( JOY !)


rsync -vlLrtp --delete --progress --stats --log-file=Eight_Copy_Log.txt  /home/david/___David/  /var/run/media/david/Eight_Copy/___David/


You asked for…



david@linux-kr5n:~> lsblk
NAME                      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                         8:0    0 465.8G  0 disk  
├─sda1                      8:1    0     2G  0 part  [SWAP]
├─sda2                      8:2    0    20G  0 part  /
└─sda3                      8:3    0 443.8G  0 part  
  └─cr_ata-TOSHIBA_DT01ACA050_Y2HMH8YFS-part3 (dm-0)
                          253:0    0 443.8G  0 crypt /home
sdb                         8:16   0 465.8G  0 disk  
└─sdb1                      8:17   0 465.8G  0 part  
  └─luks-96faa79c-9797-400e-9d80-723d048dd598 (dm-1)
                          253:1    0 465.8G  0 crypt /run/media/david/Eight_Copy


and



david@linux-kr5n:~> ls -la 
total 7572
drwxr-xr-x 50 david users    4096 Oct 17 09:39 .
drwxr-xr-x  4 root  root     4096 Aug 18 14:18 ..
drwx------  4 david users    4096 Apr  6  2013 .adobe
-rw-------  1 david users    5074 Oct 17 09:35 .bash_history
-rw-r--r--  1 david users    1177 Jan 13  2013 .bashrc
drwxr-xr-x  3 david users    4096 Sep 28 15:39 bin
drwxr-xr-x 22 david users    4096 Sep  9 21:54 .cache
drwxr-xr-x  7 david users    4096 Mar 14  2013 .cddb
drwx------ 25 david users    4096 Oct 15 19:12 .config
drwxr-xr-x 37 david users    4096 Oct 17 09:44 ___David
drwx------  3 david users    4096 Jan 13  2013 .dbus
.
.
.


Again I think I’m all set, alot of work to make a copy of a directory from 1 disk to another.

Thank you.

On 2013-10-17 17:36, rih5342 wrote:
>
> Here’s my problem, I’m a new linux user and the disk mount paradigm
> makes no sense ( to a windows user).

Well, Linux and Windows are different. In linux, there are no “disks”,
all are directories. You do not “rsync across disks”, instead you “rsync
across directories”; only that you know that the directories happen to
belong to different disks.

>
> Here’s what I did since my last post.

> Again I think I’m all set, alot of work to make a copy of a directory
> from 1 disk to another.

It looks very simple to me :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Also note: never ever log into a GUI as root. It can cause odd damage that you as a new user will not know how to fix. You can log to a terminal as root you can become root in a GUI but never ever log in as root in a GUI.

Linux is not Windows. there is no concept of 'Drives" what there is is a single directory tree on which you can mount any partition you want as a directory. The Window idea of ‘Drives’ is flawed what Windows calls drives are actually partitions which may or may not be on the same disk drive.

On Thu 17 Oct 2013 03:36:02 PM CDT, rih5342 wrote:

Here’s my problem, I’m a new linux user and the disk mount paradigm
makes no sense ( to a windows user).

Here’s what I did since my last post.

  1. login as root, go find the second disk (using gnome, applications,
    disk), delete the files and directories, logout.
  2. login as me, can’t find the disk, logout, login as root, unmount the
    disk, logout.
  3. login as me, mount the disk, redo the rsync with better source and
    destinations, which now works as follows ( JOY !)

/run/media/david/Eight_Copy

Hi
It’s a learning curve and changing your mindset as others have noted.

The only thing I do with disks connected externally is to label them,
else they can mount under different names.

I’m guessing the ‘Eight_Copy’ is the disk label?

Anyway, looks like you have it sorted, onward and upward into the linux
world and enjoy :slight_smile:


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 12.3 (x86_64) GNOME 3.8.4 Kernel 3.7.10-1.16-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!