Equal Access to files on a NAS form Debian and Windows?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Equal Access to files on a NAS form Debian and Windows?
I have purchased a Turn Key NAS device and successfully added it to my home network. I have a directory on this devices which I have mapped via windows to an old Windows machine. I am attempting to mount this same directory to a folder in my Debian 4.0.1 machine so that I can also read, write, and erase files. I have managed to make the mounting automatic on boot up, and I can see and open any of the files there.
Problem: I cannot alter any of the files on the NAS from my Debian box, nor can I create a new file and store it there.
Question: How do I configure the system so that I have full access to the NAS directory from both of the Debian machine and the Windows machine?
Did you try changing permissions? Open up a terminal and switch to the path that the device is in
cd /path/to/device
Then try typing ls-l and it'll give you a list of the files with their respective permissions. Make sure that read, write, and execute privileges are enabled. To do so, you can try
chmod u+rwx
I believe that's the correct code. Let me know if you need any clarification.
P.S. This is from a newbie to a newbie, so don't be too harsh on me
If it is an NTFS filesystem, then I don't believe Linux permissions (and therefore, the chmod solution) would be applicable. The problem is more likely that the drive is mounted read-only rather than read-write. To remedy that, try mounting the drive using the 'rw' modifier.
I have tried this function, but it didn't work. I think the issue has something to do with how the sharing or file access is setup on the NAS. I will continue to work in this, but thank you very much for your assistance. I will remember this command and figure out how to use it properly.
I do not know what file system the NAS uses. It is capable of supporting both windows, and Linux. The information page of the NAS setup indicates that the OS is Embedded Linux. The NAS is a Promise Technology SmartStor NS4300N. Unfortunately, the only access I have to the NAS setup, is through the manufacturer's setup window, so I am at a loss when it comes to gaining access the the low level operation of the system. I have check, though, and when I mount the directory to my local drive, I am using the -rw switches.
Thanks for your help. I will keep looking.
BruceAM
Quote:
Originally Posted by es0teric
What filesystem is the NAS formatted as? NTFS?
If it is an NTFS filesystem, then I don't believe Linux permissions (and therefore, the chmod solution) would be applicable. The problem is more likely that the drive is mounted read-only rather than read-write. To remedy that, try mounting the drive using the 'rw' modifier.
I have the same NS4300N as you and I have the same problem trying to create and copy and move files on my Ubuntu box. It seems I can copy files from my Ubuntu machine to the shared NAS mount but if try to copy a folder I get permission denied errors. Did anyone find a solution this problem? When I ls -l /media/NAS/ I notice this:
Does the NAS box support NFS? If not it may support the cifs filesystem, which would allow you to use Linux permissions and acls.
The permissions on a vfat or ntfs filesystem doesn't support Linux permissions, and you need to set the permissions with how it is mounted. Either through the properties tag on the desktop icon, or by mounting it and including permissions with the mount.
dmask
sudo mount -t cifs //nas-device/share /mnt/mount_point -o rw,uid=<your_usernmame>,gid=<your_group>,fmask=0117,dmask=0007,utf8
If the device supports cifs, and a Linux filesystem like ext3 is used inside the device, then you can change permissions on files and directories, and even use setfacl & getfacl. If a windows filesystem is used and/or only smbfs is supported, then the uid,gid,fmask,dmask options are fallbacks and determine the permissions of the files and directories. For security reasons, don't set the 'x' bit for files on mass storage filesystems; but you need the 'x' bit for directories. Hence, fmask & dmask are used instead of simply umask.
You can also create an fstab entry and even be able to mount it as a normal user:
//nas-device/share /mnt/mount_point cifs rw,uid=<your_username>,gid=<your_group>,fmask=0117,dmask=0007,noauto,user,utf8
---
Running nmap to see which ports the NAS device has open will tell you if both windows smb (or cifs) and nfs are supported.
Code:
tarting Nmap 4.75 ( http://nmap.org ) at 2009-02-27 07:54 CST
Interesting ports on hpmedia.jesnet (192.168.1.104):
Not shown: 994 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
2049/tcp open nfs
3306/tcp open mysql
Ports 111 & 2049 are used for NFS. Ports 139 & 445 are used by Samba/Windows.
Older 98 & 95 hosts used 137-139 & 445 for windows.
If you see ports 111 and 2049, then use NFS instead.
I believe this NAS uses the ext3 file system. I am going to double check how I have the NAS mounted. On the NAS box I had to create a user name and password. The username happens to be the same as what I use on my linux box. Would this pose any problems? I will look into this when I get home this evening.
PORT STATE SERVICE
21/tcp open ftp
80/tcp open http
111/tcp open rpcbind
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
515/tcp open printer
837/tcp open unknown
839/tcp open unknown
850/tcp open unknown
1024/tcp open kdm
2049/tcp open nfs
Still no such luck. Strange thing is I commented out this entry in my NAS and it still mounted so I am not sure where and how the NAS is being mounted now. Also, I created a new linux user that had a userid of 1001 and was able to copy files without problems.
EDIT: I think the problem is solved. I thought logging out and logging back in would remount the drives. I rebooted instead and things seem better.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.