Home built NAS

I currently use a d-link NAS mostly for additional disc space. It also has a directory for sharing files with windoze users along with a couple of personal directories for them as well. I also sometimes log onto my directory from their machines. It works out rather well. The data rates through a gigabit lan line are surprisingly high. Probably a little faster than the hardware raided scsi set up on my machine. They aren’t bad over wi fi either.

I run a 2 disc mirrored raid on the nas which isn’t entirely satisfactory. I would rather run a raid 5 set up so I wonder about the feasibility of making up my own NAS. I use CIFS directly to link to the NAS and would like to do the same thing with anything I make up. I have no need for Samba. The d-link NAS runs linux so I would like to know what it uses as a server. I assume it’s Samba but am not sure if this will normally function with a machine that is using CIFS directly. Any one have any ideas on this aspect? I suppose that the NAS could run an NFS server as well but this would not be as efficient.

I have also had a look around for samba web interfaces for admin with the same range of facilities that are usually offered on home type NAS’s. Can’t find anything remotely like one so suppose it hasn’t been done - or maybe it has? There are some neat networks browsers etc about but I have no interest in sharing between pc’s and just want something for admin that hopefully completely removes the need for connecting a monitor at any time.

I have looked at freenas etc but suspect it possible to build something with more flexibility from near obsolete pc bits and pieces. I would also rather prefer that it ran opensuse.

John

CIFS for practical purposes is SMB which is why SAMBA is often installed.

If you want to implement that type of “network shares” then you install SAMBA on Linux.

Alternatives include NFS, http, ftp.

Sure, you can roll your own NAS. Many NAS are running Linux, anyway.

HTH,
TSU

There’s quite a lot of administrative web interfaces out there. But If your NAS runs openSUSE, you should give WebYAST a try. With apppropriate YaST modules, you will be able to manage users, Samba/NFS shares, etc.

For specifically Samba administration, you have also the SWAT web interface.

I sometimes think that there is some confusion about cifs. It’s basically a transport protocol implemented in the kernel that samba happens to use. Up to an early version of 11 it was a simple matter to use it directly. At some point people asked if cifs was secure. No one was prepared to do a security audit on it so the code was modified to prevent it’s direct use. This is the source section that does that, modified to allow it to function directly without samba.


/*
 * mount.cifs has been the subject of many "security" bugs that have arisen
 * because of users and distributions installing it as a setuid root program.
 * mount.cifs has not been audited for security. Thus, we strongly recommend
 * that it not be installed setuid root. To make that abundantly clear,
 * mount.cifs now check whether it's running setuid root and exit with an
 * error if it is. If you wish to disable this check, then set the following
 * #define to 1, but please realize that you do so at your own peril.
 */
#define CIFS_DISABLE_SETUID_CHECK 1

/*
 * By default, mount.cifs follows the conventions set forth by /bin/mount
 * for user mounts. That is, it requires that the mount be listed in
 * /etc/fstab with the "user" option when run as an unprivileged user and
 * mount.cifs is setuid root.
 *
 * Older versions of mount.cifs however were "looser" in this regard. When
 * made setuid root, a user could run mount.cifs directly and mount any share
 * on a directory owned by that user.
 *
 * The legacy behavior is now disabled by default. To reenable it, set the
 * following #define to true.
 */
#define CIFS_LEGACY_SETUID_CHECK 1

/*
 * When an unprivileged user runs a setuid mount.cifs, we set certain mount
 * flags by default. These defaults can be changed here.
 */
#define CIFS_SETUID_FLAGS (MS_NOSUID|MS_NODEV)

Actually the setuid aspect might be sufficient given root writes a script for a user to use it directly. With mount.cifs like this all I need to connect a directory on my desktop to to one on the NAS is this. Fstab which is supposed to be depreciated doesn’t enter into it. It seems it will disappear at some point.


/sbin/mount.cifs //192.168.xxx.xxx/Volume_1 /home/john/Desktop/NAS -o user=john,rw

This requests my nas password. I prefer it like that rather than passing a password directly. :XActually it takes me to the NAS’s // so that I can navigate to the shared or my own directory.

There are several reasons why I use it like this. Speed for one. It’s much faster than using it via samba. Also how my NAS is set up. One shared directory that can only be accessed by users only for exchanging files and several private password protected user directories. These are used for additional storage space. I could equally well add a media directory. The other reason relates to the NAS itself. Like many home type NAS’s NFS support can be enabled but as the docs point out this will slow it down as it has to load 2 servers at it’s end. Unfortunately there will always be windoze users in the house.

I also managed to get the NAS functioning using the KDE sharing set up but the behaviour when I launched files from the NAS was bizarre. Some worked some didn’t depending on the application. Also problems with reading files off the NAS, modifying them and writing them back. Boot up was also extremely slow as was directory navigation.

As far as sharing goes I have no interest in anything other than I have - a communal drop box on the NAS. The file locking cifs offers is adequate for this and also joint modification of files actually.

:(No answer to what a typical linux based home commercial NAS uses for a server though. I suspect it’s a stripped down Samba server but have no idea just how stripped down or where. They also clearly load a separate NFS server if needed.

Thanks for the WebYAST suggestion. I will have a look at that. The commercial NAS’s probably use a freely available simple web server to provide the admin interface. It seems Freenas offers this but reports on it are mixed. Possibly because it seems there is also a pay for version. It doesn’t run Linux either. Using a swear word it seems Ubuntu have done more in the line of home built Linux NAS set ups using Samba on the NAS but so far I haven’t found much info on it’s management. There is a USB stick type version available.

John

If anyone else has any interest in this area it is possible to obtain D-Link source for several of their DNS boxes. They include all of the GPL code used and make it all freely available. There are a number of pure object modules as well which of course they don’t provide source for. It can be found by googling d-link nas source. They use marvel nas for hardware on the simpler units including a simplified 4 bay business type nas.

They seem to use Samba, busybox, a linux kernal, nfs utilities and a simple log in app for basic functionality. I think I noticed a simple web server as well.

John

John_82 Nice description about CIFS.

But that was also why I stated “for practical purposes” and wasn’t willing to say “equals” or “is”

:slight_smile:

TSU

Yep I know :wink: The simple answer is probably to use NFS for my style of use. On the other hand if I built my own nas I would like to base it round an Atom board and the load running both CIFS and NFS might be too much. It’s the cost of the atom board that concerns me if I just assume that a normal samba server in a nas will function in the way I am currently using the d-link one. I suppose I will have to find out when my current desktop is replaced but had hoped that some one had already looked at the aspect that concerns me - just using cifs directly from a linux pc to a nas with a normal samba server. Security is more than adequate for my needs in much the same way as pointed out by some one else in another thread. Actually it’s very secure.

The code snippet is from 11.4 by the way. It seems that they (samba people) may have relented/changed things on 12.3. I bug reported it and even opened it again after some one closed it and eventually obtained an answer to why it had been done. Security audits take time and are difficult to do so the simple answer is to remove the concern even though there didn’t seem to be any direct proof of any problems. I’ve just loaded my new machine with 12.3 so will be looking at the current cifs code soon before I close this one down.

John