[YLUG] mv and cp to NAS via samba

Zoe Stephenson zrs1 at york.ac.uk
Fri Feb 20 10:17:36 UTC 2009


On Fri, Feb 20, 2009 at 08:17:18AM +0000, nigel white wrote:
> Thanks for these ideas Gary. Here's the results -
> 
> sudo mkdir -p /media/qserver/q
> worked fine. A new directory was created.
> 
> 
> sudo mount -o mode=666 smb://qserver/q /media/qserver/q
> got
> mount: wrong fs type, bad option, bad superblock on smb://qserver/q,
>        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
> 
> All greek. What next?

Try:

sudo mount -t cifs -o mode=666 //qserver/q /media/qserver/q

That's the kind of command I used to set up my system initially.

> When we get this mounting process working smoothly, will it need to be
> done after each boot, or will it remember the mount?

It won't remember it on its own, it'll need to be done every mount.
There's a handy way to do this by adding a line to /etc/fstab - mine
has a line looking like:

//files0/zoe  /media/data cifs //credentials=/usr/local/etc/smb/credentials-zoe,uid=zoe,gid=zoe  0 0

(all one line)

The credentials file contains

username=zoe
password=********

But obviously with my real password in there.  Now it mounts on every
boot.

You'll need to start up an editor as root to be able to edit these
files.  I'm oldschool and do "sudo vi /etc/fstab" but vi isn't the best
way if you're not used to it.  You might have nano or joe installed,
which work in the terminal window, or you might do

gksudo gedit /etc/fstab

or

kdesu kate /etc/fstab

Let us know if you need more general info on editing system files.

> I've noticed that some wizardry seems to mount things on the fly - eg
> once I have browsed to /q once after each boot, using the gui file
> browser, an icon called "q on qserver" appears on my desktop, and also
> in the list of "places" in the gui sidebar. Something similar happens
> when there's a CD in the drive. Its a handy feature. Is this an example
> of a mount? Is this sambas' doing?

This is your desktop environment and its services to programs that
understand its protocols.  If you're using GNOME, there are GNOME-aware
programs like the file browser that communicate with the desktop
system, and similarly with KDE and possibly lots of other desktop
environments these days.  It might use mount and samba and all sorts in
the background to achieve what it does, or it might not.

The main point is that commands like mv and cp don't talk to your
desktop environment.  They'll work no matter what environment you're in.

-- 
 -- zoe



More information about the York mailing list