• October 14, 2019, 09:49:12 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: [Solved] Mount shares from Linux  (Read 6302 times)

sioban

  • Level 1 Member
  • *
  • Posts: 13
[Solved] Mount shares from Linux
« on: June 03, 2010, 03:36:18 AM »

Hi,

I've mounted some of the NAS shares on my linux server.
The purpose is to backup some files using rsync.

The mount command line is the following :

Code: [Select]
mount -t cifs //aa.bb.cc.dd/Volume_1 /mnt/nas -o rw,nosuid,nodev,auto,lfs,iocharset=utf8,uid=0,gid=0,user=xxx,password=yyy

Then, I do a Rsync using this command :

Code: [Select]
rsync -va /home/save/dir1/ /mnt/saves/dir2
But I get two type of error.

Error 1 (I also get this error when I try to "touch" an empty file) :
Code: [Select]
rsync: failed to set times on "/mnt/saves/dir2/.": Invalid argument (22)
and error 2:
Code: [Select]
rsync: mkstemp "/mnt/saves/dir2/.dbbackup.sql.7z.k8d8KM" failed: Permission denied (13)
rsync: mkstemp "/mnt/saves/dir2/.dbbackup.sql.7z.old.LuwcNs" failed: Permission denied (13)
rsync: mkstemp "/mnt/saves/dir2/.dpkg.list.PIgsS8" failed: Permission denied (13)
rsync: mkstemp "/mnt/saves/dir2/.etc.tar.7z.j5vebc" failed: Permission denied (13)
rsync: mkstemp "/mnt/saves/dir2/.etc.tar.7z.old.rnw2lT" failed: Permission denied (13)

Ending with this message :
Code: [Select]
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7]
The result is partial synchronisation.
- Some new files = ok
- old files needed to be synchronized = not ok

Maybe my rsync command is wrong, I want to full backup /home/save/dir1 to /mnt/saves/dir2 :
- if file is not present in dir1 it must be copied to dir2
- if file in dir1 is newer than file in dir2 and they are not the same, file in dir1 must overwrite file in dir2
- no delete at all.

But I also think my mount command is missiing something because of Error1 and Error2, that's why I post there.

Any help ?

Thanks

EDIT : forgot to mention that I'm root on my linux server and I procede the rsync command as root, but I still thinks it's a perm problem in the mount options...
« Last Edit: June 04, 2010, 09:44:59 AM by sioban »
Logged

dosborne

  • Level 5 Member
  • *****
  • Posts: 598
Re: Mount shares from Linux
« Reply #1 on: June 03, 2010, 08:25:59 AM »

I use the following on linux:

mount -t smbfs //192.168.1.40/archive -o username=xxxxx,password=yyyyy /mnt/archive40/

"archive" is the share name I created.

My rsync command looks like:
/usr/bin/rsync -av --delete [source] [target]

where source looks like /home/user/dir/ and target looks like /mnt/archive40/
Logged
3 x DNS-323 with 2 x 2TB WD Drives each for a total of 12 TB Storage and Backup. Running DLink Firmware v1.08 and Fonz Fun Plug (FFP) v0.5 for improved software support.

sioban

  • Level 1 Member
  • *
  • Posts: 13
Re: Mount shares from Linux
« Reply #2 on: June 03, 2010, 08:43:48 AM »

Same results with smbfs :

Code: [Select]
# mount -t smbfs //aa.bb.cc.dd/saves /mnt/saves -o username=xxx,password=xxx

# rsync

But mount still want to mount it using cifs :
Code: [Select]
# mount -l
/dev/md1 on / type xfs (rw,nobarrier)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/md0 on /boot type ext2 (rw)
/dev/md9 on /home type xfs (rw,nobarrier)
/dev/md3 on /tmp type xfs (rw,nobarrier)
/dev/md4 on /usr type xfs (rw,nobarrier)
/dev/md5 on /var type xfs (rw,nobarrier)
/dev/md8 on /var/lib type xfs (rw,nobarrier)
/dev/md6 on /var/log type xfs (rw,nobarrier)
/dev/md7 on /var/spool type xfs (rw,nobarrier)
[b]//aa.bb.cc.dd/saves on /mnt/saves type cifs (rw,mand)[/b]

However the error is slightly different now :

Code: [Select]
# rsync -va /home/save/dir1/ /mnt/saves/dir2/
sending incremental file list
./
rsync: failed to set times on "/mnt/saves/dir2/.": Not a directory (20)
[...]
rsync: mkstemp "/mnt/saves/dir2/.file1.7z.RDs0WS" failed: Not a directory (20)
rsync: mkstemp "/mnt/saves/dir2/.file2.old.BMAQxp" failed: Not a directory (20)

Number of files: 30
Number of files transferred: 29
Total file size: 3631881375 bytes
Total transferred file size: 3631881375 bytes
Literal data: 3631881375 bytes
Matched data: 0 bytes
File list size: 660
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 3632326586
Total bytes received: 566

sent 3632326586 bytes  received 566 bytes  36142558.73 bytes/sec
total size is 3631881375  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7]

« Last Edit: June 03, 2010, 08:48:13 AM by sioban »
Logged

sioban

  • Level 1 Member
  • *
  • Posts: 13
Re: Mount shares from Linux
« Reply #3 on: June 03, 2010, 10:27:34 AM »

Ok it looks like that smbfs can't handly symbolic links, nor time/perm preservation

So I've changed my rsync command to :
Code: [Select]
rsync -vurD /home/save/dir1/ /mnt/saves/dir2
And now it works.
Logged