Showing posts with label network. Show all posts
Showing posts with label network. Show all posts

Tuesday, June 17, 2008

Better way to mount network share in Ubuntu

A while ago I posted about mounting my Maxtor NAS as a local drive in Kubuntu using smbfs. This did not work for pas\sword protected shares. Hello cifs! So linux guru at work sent me a sample cifs command and I searched and tweaked and ended up with all this.

1. Used this for the unprotected share. Gave an error if no "username=" and "password=" so if there's a better way than using blank username/password please leave me a comment because I didn't find it with a quick search. (watch the line wrap if you copy/paste this, each > should be one line)

> sudo mkdir /mnt/nas
> sudo mount -t cifs //[share name or IP]/[share directory] /mnt/nas -o username=,password=,iocharset=utf8,file_mode=0777,dir_mode=0777

- Same command to access protected share, just add username and password values.

2. Now we alias this in .bashrc so a single command will mount the network share. I was browsing through the file and noticed a recommendation to use .bashrc_aliases. Cool, something new, I'm game.

> vi .bashrc_aliases
Insert

alias mountnas='sudo mount -t cifs //[share name or IP]/[share directory] /mnt/nas -o username=,password=,iocharset=utf8,file_mode=0777,dir_mode=0777'

3. Next uncomment call in .bashrc for .bashrc_aliases.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

4. Run this to re-initialize .bashrc without restarting terminal
> . .bashrc

So now I can get my music down to the mini. Soon to come, Amarok configuration...

Monday, June 16, 2008

Automatically Mount local partition at boot in Ubuntu

You could double-click the drive icon in the GUI and Ubuntu would mount and open a drive window but I needed to automatically mount a data partition so media players can access the drive.

Make the destination with
> sudo mkdir /media/data

Copy fstab before editing
> sudo cp /etc/fstab /etc/fstab.bak

Edit fstab adding the new mount point (using vfat for fat32)
/dev/sda3 /media/data vfat defaults 0 0
(SEE BELOW FOR PERMISSIONS NOTE)

Run command to refresh fstab
> sudo mount -a

To see mounted partition
> df -k

Ubuntu puts a drive icon on the desktop for the drive...

PERMISSIONS NOTE (Added 2008-06-22):
Previously clicking icon in "Computer" mounted drive with full permissions. I finally got around to copying data over with the fstab mount and realized drive was RO! Came up with the following solution for fstab entry:

/dev/sda3 /media/data vfat user,rw,exec,umask=000 0 0

Friday, June 13, 2008

HP 2133 mini-note blue wifi light in Ubuntu

I just got home from work and booted the mini into Ubuntu and left it on the kitchen table. Later I was outside on the deck and what should I see through the window but the blue wifi indicator that isn't supposed to work with the standard Suse install... Guess it likes Ubuntu. Saweet!!

Friday, January 11, 2008

Mount network share from linux

Was able to mount a NAS drive share very easily.

1. Open the Adept Manager
2. Install smbfs (which installed samba-common)
3. At the command line use 'mount -t smbfs //[Share IP]/[path] /mnt/nas
4. Add alias in .bashrc file for quickly mounting share
alias mountnas='mount -t smbfs //[Share IP]/[path] /mnt/nas'

I'll add more on samba as I do more with it...