LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-26-2012, 10:03 PM   #1
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Rep: Reputation: 1
rsync - problem connecting to network external drive


I have an external USB 350MB external drive connected to a Wireless Modem/Router. The drive is formatted ntfs and is almost empty. I can use Krusader or Dolphin to access and transfer files to and from the drive from any computers on the network. The address of the drive is smb://readyshare/USB_Storage/NetShare. The drive shows up correctly in Gigolo.

I want to set up an automatic backup procedure using rsync. I have the following code ;
Code:
#!/bin/bash
rsync -au --progress -s --exclude=.Trash-1000 /Common/.nts smb://readyshare/USB_Storage/NetShare/.nts
When I run this I get
Quote:

ssh: Could not resolve hostname smb: Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(605) [sender=3.0.9]
I have tried removing "smb" but it still doesn't work.

I am using bash in Xubuntu 12.04. rsynch works well across the network in all other cases but not to the USB drive.
 
Old 05-27-2012, 02:38 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,367

Rep: Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747
Try explicitly mounting your NTFS formatted external drive and using the mount point in place of smb://readyshare/USB_Storage/NetShare. This may help. https://help.ubuntu.com/community/Mo...dowsPartitions
 
Old 05-27-2012, 04:32 AM   #3
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Original Poster
Rep: Reputation: 1
I have already done this. I can use rsync to transfer files each way to the drive when mounted so the fact that it is ntsf does not seem to matter.

The modem will not recognise the drive if formatted to anything but ntfs or fat32.

I want the drive to be connected to the router so that it is a backup drive for each computer on the network and so that certain common files are available across the network.

Everything works fine when I use Dolphin, Thunar or Krusader. It is just rsync that it causing a problem.

Thanks for your reply

Alan
 
Old 05-27-2012, 09:11 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,367

Rep: Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747
I now have a better picture of your situation. You are going to need to rethink your strategy as rsync is not the tool to achieve your goal directly as it does not handle the SMB protocol.
Perhaps you could use rsync to build a directory on a computer on the network, then copy this directory to your external USB disk attached to the modem/router.
 
1 members found this post helpful.
Old 05-27-2012, 09:48 AM   #5
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Original Poster
Rep: Reputation: 1
Yes I will do that. I was hoping to use rsync in a script that could be run automatically under cron.

I will play around a bit more and try your strategy.

Thanks for your help
 
Old 05-27-2012, 11:54 AM   #6
sysfce2
Member
 
Registered: Jul 2009
Distribution: Slackware
Posts: 116

Rep: Reputation: 50
Is there any reason that you cannot mount the network share in your cron script just before running rsync and umounting it after?
 
Old 05-27-2012, 11:05 PM   #7
toothandnail
Member
 
Registered: Apr 2007
Location: Oxfordshire, UK
Distribution: Arch, Sparky, Salix64
Posts: 119

Rep: Reputation: 25
Quote:
Originally Posted by Polymorph View Post
Yes I will do that. I was hoping to use rsync in a script that could be run automatically under cron.
You can do that easily enough - use the script to mount and unmount the drive. If nothing else, it allows you to capture errors should the mount fail. I use something like this to run an rsync backup from cron:

Code:
mount -t cifs -o guest //192.168.0.225/bantam /mnt/smb
sleep 4
if [ -d /mnt/smb/backup ]; then
        <rsync commands go here....>
        sleep 20
        umount /mnt/smb; exit
else
        echo "`date +%m-%d-%H:%M` Mount failed, backup aborted" >> /var/log/rsync.log
fi
That works fine. In this instance, the backup is being done to a Zyxel NAS. Should the NAS be unavailable, I get a log entry so I can see that there has been a problem.

Paul.
 
Old 05-28-2012, 07:29 PM   #8
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Original Poster
Rep: Reputation: 1
@toothandnail
Thanks for your reply. I can not get the external drive to mount. I am using a Netgear DGND3700 wireless modem/router.
The IP address of the modem is 192.168.0.1 - that is what I use to get in from Firefox.

In the "USB Storage Advanced Settings" I have:
Network/Device Name: readyshare
Access Method: Network Connection: Link: \\readyshare
Available Network Folders: Shared Name: readyshare\USB
I assume that the back slashes are for Windows users and have used forward slashes instead.

I created a mount point mkdir USB - then I tried:

mount -t vfat -o guest //192.168.0.1//readyshare/USB USB
mount -t vfat -o guest //192.168.0.1//readyshare USB
mount -t vfat -o guest //192.168.0.1/readyshare/USB USB
mount -t vfat -o guest //192.168.0.1/readyshare USB

In all cases I get
Quote:
mount: special device //192.168.0.1//readyshare/USB does not exist
As I said earlier I can access the drive through Dolphin, Krusader and Thunar from each or the computers on the network.

Any other suggestions?

TIA

Alan

Last edited by Polymorph; 05-28-2012 at 07:33 PM.
 
Old 05-28-2012, 07:39 PM   #9
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,367

Rep: Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747Reputation: 2747
I have a Netgear DG834GUv5 wireless modem/router. The external USB drive is only accessible by FTP. I think that your Netgear DGND3700 wireless modem/router will be similar in that the external USB drive cannot be remotely mounted.
 
Old 05-28-2012, 07:46 PM   #10
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Original Poster
Rep: Reputation: 1
@toothandnail
Thank you for your reply and suggestion. I cannot get the drive to mount.
I am using a Netgear DGND3700 wireless Modem/Router. Its IP address is 192.188.0.1 which is what I use to access the modem from Firefox. For testing I am using a 4GB USB Flash drive formatted to fat32.

In the Modem I have:
Quote:
USB Storage: Advanced Settings: Network/Device Name: readyshare
Access Method: Network Connection: \\readyshare
Available Network Folders: Shared Name: \\readyshare\USB
I assume the backslashes are for Windows users and have used forward slashes instead.

I created a mount point in my home directory - mkdir USB - then I tried
Quote:
sudo mount -t vfat -o guest //192.168.0.1//readyshare USB
sudo mount -t vfat -o guest //192.168.0.1//readyshare/USB USB
sudo mount -t vfat -o guest //192.168.0.1/readyshare/USB USB
sudo mount -t vfat -o guest //192.168.0.1/readyshare/USB USB
In each case I got -
Quote:
mount: special device //192.168.0.1/readyshare/USB does not exist
As I said earlier, I can access the drive through Thunar, Dolphin and Krusader from each of the computers on the network. The address in Krusader is
Quote:
smb://readyshare/USB
What am I doing wrong?

TIA, Alan

Last edited by Polymorph; 05-28-2012 at 07:52 PM.
 
Old 05-28-2012, 08:44 PM   #11
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Original Poster
Rep: Reputation: 1
Sorry about the double post - I don't know what went wrong!!

@allend
As I said I can access the drive through the file managers and the address in there is smb://readyshare/USB. I can transfer files each way by dragging and dropping them without using ftp

Within the modem settings there are optioins and addresses for accessing the drive directories directly, through http (directly), https (over the Internet), ftp (directly) and ftp (over the internet). Since the file managers find the drive directly using smb, I want to do the same by mounting it and accessing it.

Last edited by Polymorph; 05-28-2012 at 08:46 PM.
 
Old 05-28-2012, 09:46 PM   #12
sysfce2
Member
 
Registered: Jul 2009
Distribution: Slackware
Posts: 116

Rep: Reputation: 50
Try using mount -t cifs.
 
Old 05-28-2012, 10:11 PM   #13
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Original Poster
Rep: Reputation: 1
This is what I get -
Quote:
sudo mount -t cifs -o guest //192.168.0.1//readyshare/USB USB

Retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
The man pages didn't give me anything useful.
 
Old 05-29-2012, 01:34 AM   #14
toothandnail
Member
 
Registered: Apr 2007
Location: Oxfordshire, UK
Distribution: Arch, Sparky, Salix64
Posts: 119

Rep: Reputation: 25
Looking at what you've posted, I think you're addressing the device incorrectly:

Code:
USB Storage: Advanced Settings: Network/Device Name: readyshare
Access Method: Network Connection: \\readyshare
Available Network Folders: Shared Name: \\readyshare\USB
From that, I would think the mount command you should be using would be either of these:

Code:
mount -t smb //readyshare/USB USB -o guest
or

Code:
mount -t smb //192.168.0.1/USB USB -o guest
Though it both instances, I would use an absolute path to your share directory. I would also use cifs rather than smb. smb is deprecated and has a file size limit of 2GB.

I've not used a Netgear router for a while, but from what I remember, it should provide local DNS, so you could check it. If you've got Samba installed, try entering 'smbtree' from the command line. Hit return when it prompts for a password, and see what the command shows for your network. If it shows the readyshare name, you should be able to mount it using the name direcdtly, if not, you will need to use the IP. But using both is most likely the reason the network can't locate the device.

Edit/ Sorry, just had a closer look at your first mount command. '-t vfat' is definitely wrong. When you're accessing the device over the network, it will be either 'smb' or 'cifs', the latter being the best option. /Edit

Paul.

Last edited by toothandnail; 05-29-2012 at 01:37 AM. Reason: Extra facts noticed
 
1 members found this post helpful.
Old 05-29-2012, 01:47 AM   #15
Polymorph
LQ Newbie
 
Registered: Dec 2010
Location: NSW, Australia
Distribution: Xubuntu 12.40
Posts: 18

Original Poster
Rep: Reputation: 1
Fantastic!!!!
From your example I got
Quote:
mount: unknown filesystem type 'smb'
So I tried smbfs after consulting man mount.

Quote:
sudo mount -t smbfs //192.168.0.1/USB USB -o guest
The above works perfectly - I get the Warning message
Quote:
Warning: mapping 'guest' to 'guest,sec=none'
but the drive is mounted.

So I tried without -o guest and it mounted without the Warning message

I am going to try it in fstab

In fstab I tried
Quote:
//192.168.0.1/USB USB smbfs defaults 0 0
. It did not work. I can live with that and can mount it in a script as in your first post - thanks

Is there any startup script that I could put the mount statement into to get the drive mounted on startup? I have tried ~/.profile and /etc/bash.bashrc but I am just guessing


Thanks for all your help

Last edited by Polymorph; 05-29-2012 at 02:15 AM.
 
  


Reply

Tags
externalharddrive, router, rsync


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rsync'd my entire drive to an external drive, grub-installed and FAILED to load GUI rootaccess Linux - General 1 03-15-2012 01:09 PM
[SOLVED] rsync problem. Lucid Lynx backing up to Samsung external drive karmicnoob Linux - Desktop 6 10-27-2010 03:44 AM
[SOLVED] rsync to an external usb drive anon091 Linux - General 8 01-28-2010 02:40 PM
[SOLVED] Still having rsync errors to external drive anon091 Linux - General 23 01-28-2010 02:39 PM
Problem connecting external hard drive Findus Linux - Hardware 9 03-01-2009 05:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration