[WNYLUG-Users] Accessing a NAS

Joe josephj at main.nc.us
Fri Jul 29 06:18:37 EDT 2011

I apologize in advance for the length of this email.  I'm just getting 
started with my NAS and networking in general, so I have a lot of questions.

I have a D-Link DNS-321 NAS.  I have configured it via the web 
interface.  It's setup to use an smb interface.
I need an smb for dummies.
I don't see the device anywhere on my guis in Linux or my XP vm.

I've been flailing a bit with some success:

The web interface shows a "root" of "Joes_NAS" with Volume_1 and 
Volume_2 representing the two 1TB drives in it.
I have a user (on the NAS) called maint who has r/w access to both volumes.
My workgroup is JPmicrosystems.
Name is Joes_NAS.

I have three other users: bigbird, shelelia, and guest (on the NAS).  
The first two each have their own directory with r/w access.  They are 
also part of a group that has r/w access to a shared storage directory.  
guest has r/o access to a public subdirectory  under the shared 
directory.  Right now his password is anonymous.  That way, all my other 
users can put things where they are available to the world read-only.

My notebook is connected to my gateway (Actiontec - FiOS) via wifi.  The 
NAS is connected to the Gateway by Ethernet cable.

Up to now, I have not gone into the gateway to do any port forwarding, etc..

In all the following, I substituted "password" for the actual password.

I just did a
/usr/bin/smbclient -U maint \\\\Joes_NAS\\Volume_1\\\\ password

and that worked. I was able to access the whole first drive.

next, I did a
/usr/bin/smbclient -U maint \\\\Joes_NAS\\Volume_2\\\\ password

and was able to access the whole second drive (which will be used as a 
copy of the first drive for redundancy - not RAID 1, manually/scripted 

Now, what I want to do is mount it so I can access it normally.  I tried

sudo mount -t cifs //Joes_NAS/Volume_1 -o 
username=maint,password=password /media/DNS-321
[sudo] password for bigbird:
mount: wrong fs type, bad option, bad superblock on //Joes_NAS/Volume_1,
        missing codepage or helper program, or other error
        (for several filesystems (e.g. nfs, cifs) you might
        need a /sbin/mount.<type> helper program)
        In some cases useful info is found in syslog - try
        dmesg | tail  or so

bigbird at sananda:/dev/disk$

dmesg (last few lines):
[131679.113829] ata1.00: configured for MWDMA2
[131679.228805] ata1: EH complete
[133792.273858]  CIFS VFS: cifs_mount failed w/return code = -22
[133896.354372]  CIFS VFS: cifs_mount failed w/return code = -22
bigbird at sananda:/dev/disk$

I got the same thing when I added a trailing / to it as well.

Essentially the same error with -t smbfs.

Same with
sudo mount -t cifs -o username=maint,password=password 
//Joes_NAS/Volume_1 /media/DNS-321

sudo mount -t cifs // /media/DNS-321 -o 
mount: // is not a valid block device
bigbird at sananda:~$

I finally got it to work with
kdesudo mount -t cifs // /media/DNS-321\

I'm not sure when the last four parameters are needed.  Even though I'm 
using samba, the filesystems on both ends (at the moment) are ext3 or 
ext4.  The file and dir modes are mostly for future work where there 
might be another user that could access the files if I didn't protect them.

Using kdesudo is appropriate for this user who can access the entire 
NAS, but how do I get rid of it when I just mount a user directory for 
my user?

Anybody know how to use cred= and/or .cifsrc, etc. to eliminate the need 
for clear text passwords in scripts?  I also tried creating 
/etc/sambapasswords, but that did nothing.

What do I have to do to access this when I'm not on the lan and cannot 
use  Do I need a dyndns account?

What do I have to do with my gateway so that this will work?

How can I make the NAS show up in dolphin places so I can mount the user 
shares from there?

How to I get this to connect to my XP vm?

How do I set things up so I can give out urls to things stored under 
guest and they'll just work without user and password?

Anyone have a d-link NAS that they've hacked?  I found a couple of web 
pages on how to do it, but I don't want to end up with a dead NAS if I 
screw it up.

Eventually, I want:
* The appropriate directories to be user mountable (show up in dolphin 
places and/or put in fstab and mount with pmount - with no sudo/root 
permission issues).
* To be able to access the NAS remotely when I have my notebook at 
another location.
* Transfer files back and forth by putting files on the NAS from one 
location and then downloading them at another location to another notebook.
* Put up pngs, jpgs, etc. so that I can create posts on forums with 
screen shots, etc. and not have to worry about dealing with crazy ISPs 
like Verizon which is about to cut off all ftp access to the webspace 
they give you and make you use their very weird web page creation tools 
that make it hard to do anything.

* I may also want to put some other small servers on it (like 
bittorrent), but only after everything else works smoothly.



More information about the Users mailing list