r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

How To: Mount a NAS in Linux (via Samba)

r3dux | February 25, 2009

Rehaul: CIFS is the new Samba – and while the below is still a good way, CIFS seems to be the way & the path – so glance at this lot to get the fundamentals, then read this article to change to mounting your NAS via CIFS.

First, get samba with the following command: sudo apt-get install samba smbfs

Now, create a folder to use as your mount point on your linux drive (I’m using /mnt/NAS – you can use whatever you’d like): sudo mkdir /mnt/NAS

Then edit your /etc/fstab file with: sudo gedit /etc/fstab

On my NAS I have two separate shares, one of which is called (unimaginatively enough) Share, so I’m going to add lines to /etc/fstab in the following format:

# Mount NAS share
//IP-OF-YOUR-NAS/NAS-SHARE-NAME /SHARE-MOUNT-POINT smbfs username=USER-NAME-OF-NAS-USER,password=PASSWORD-OF-NAS-USER,uid=YOUR-UID-NUMBER,gid=YOUR-GID-NUMBER 0 0

So  -  for my own personal setup, and because I’ve already created a username and password on the NAS [via the NAS' web interface - available at http://IP-OF-YOUR-NAS] called r3dux, I’d put:

# Mount NAS share
//192.168.1.100/Share /mnt/NAS smbfs username=r3dux,password=MyPasswordHere,uid=1000,gid=1000 0 0

There are other ways where you don’t have to put your password in plaintext in the fstab file, but as long as you’ve got it set to read/write only by the root account, no one else can even look at the file to read the password. To set permissions that way, just use: sudo chmod 600 /etc/fstab

Which gives read and write permissions to root, but denies groups and any other users any access whatsoever (even just looking at!)

Job done.

Update: When mounting a NAS there are two user acounts you’re using: 1.) Your linux user account which goes in the uid and gid fields, and 2.) The NAS user account (which is set up from the NAS’ web interface) which goes into the username and password fields.

So if you want to have write access to the NAS, then you’ll need to set up a user account from the NAS’ web interface | Users sections, and mount the NAS as the user the NAS knows about with required privileges. In the fstab line above we’re mounting with user (uid) and group (gid) permissions set to 1000, that is user id 1000 (the id number of the first user on a linux system) [your user id can be looked up in /etc/passwd] and group id 1000 (i.e. the first user on a linux system [in my case my own r3dux group] – your group id can be looked up in /etc/group) – if you want to use other users/group to mount as, feel free.

Update 2: Forgot to mention that this will mount the NAS on reboot, to force a mount using the fstab details you’ve just entered, simply run the command sudo mount -a

Update 3: Fixed the above uid/gid mentions to NOT say anything about linux file permissions – it’s user and group identifiers to mount the NAS by, and NOT standard linux file permissions, mea culpa – fixed.

Comments
1 Comment »
Categories
How-To, Linux
Tags
mount, NAS
Comments rss Comments rss
Trackback Trackback

The world will look up and shout ‘Save us!’ And I’ll look down, and whisper ‘No.’

r3dux |

whopacspic-1

Awesome t-shirt =D

Comments
No Comments »
Categories
Consumer Whore, Gaming, Humour
Tags
Pacman, Watchmen
Comments rss Comments rss
Trackback Trackback

The Three Envelopes

r3dux |

Read this in a slashdot comment today and it made me smile:

An IT manager starts a new position.

All goes well for a few weeks, then something big breaks. Lots of pressure. Rooting around in his desk, he finds 3 envelopes. The first is labeled “Open at the First Crisis”. On a whim, he opens it and the note inside reads “Blame it on your Predecessor”. He decides to take this advice and to his surprise, it works like a charm, management is satisfied, he is given time to fix things.

A few months go by and a something much bigger breaks, seriously disrupting operations. He is in trouble. At his desk, he decides to open the envelope labeled: “Open at the Second Crisis”. He’d been saving it for something big, and this is it. The note inside says: “Form a Committee to Study the Issue”. He does just that and, to his surprise, it works great. The committee wastes time and accomplishes nothing, but blame is diffused.

A few years go by. The third and final envelope is labeled: “Open at the Third Crisis”. He thinks about opening it many times, but he waits, saving it for a real disaster. One day, it comes. Catastrophic failure. He takes a deep breath, tears the envelope open and inside, finds a note that reads: “Prepare Three Envelopes”.

Comments
No Comments »
Categories
Humour, Life, Tech
Tags
Envelopes
Comments rss Comments rss
Trackback Trackback

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Error Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Problem PS3 Remix Retro script Slides Sound Systems Texture Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“Greer’s Third Law of Computing: A computer does what you tell it to do, not what you want it to do.”

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox