SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-07-25 01:33:17

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Need help adding cifs entries to rc.local

Heya folks!

I've got some networked mounts that I need on my laptop.  I've used fstab in the past, but hate it because more often than not, I have to sudo mount -a because it was processed before the network was up so I thought I would add them to rc.local, like my virtualbox mounts.  I'm having a problem converting an fstab entry into something usable by rc.local, however.

Here's my fstab entry:

//192.168.1.199/Audio  /home/schwim/mounted/audio  cifs  guest,uid=1000,iocharset=utf8  0  0

And here's the rc.local entry I use for my vbox mounts:

mount -t vboxsf -o uid=schwim,gid=schwim Win_Audio /home/schwim/mounted/audio

Can someone help me figure out how to mount my cifs shares in rc.local instead of fstab?

Thanks for your time!

Offline

Help fund CrunchBang, donate to the project!

#2 2013-07-25 02:02:21

pidsley
Window Mangler
Registered: 2012-05-23
Posts: 1,752

Re: Need help adding cifs entries to rc.local

(2) The option _netdev is always recommended for cifs mounts in fstab. Option _netdev delays mounting until the network has been enabled.

http://swerdna.dyndns.org/susesambacifs.html

Offline

#3 2013-07-25 02:12:24

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: Need help adding cifs entries to rc.local

Hi there pidsley,

I had seen that quite a while ago but thought:

_netdev is known to the command "mount" but not to the command "mount.cifs". Even though mount.cifs doesn't recognise _netdev, you should include it in your mount command anyway.

meant that it wasn't going to do me much good in fstab.

Offline

#4 2013-07-25 05:03:22

pidsley
Window Mangler
Registered: 2012-05-23
Posts: 1,752

Re: Need help adding cifs entries to rc.local

schwim wrote:

meant that it wasn't going to do me much good in fstab.

Did you try it in fstab, just to make sure?

Otherwise, please read the rest of that link. There is a lot of information there about constructing an appropriate "mount" command. It could be something as simple as

mount -t cifs -o guest //192.168.44.100/share /path_to/mount

But humor me at least, and try the _netdev option.

Last edited by pidsley (2013-07-25 05:04:22)

Offline

#5 2013-07-27 17:20:04

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 1,031
Website

Re: Need help adding cifs entries to rc.local

Heya Pidsley,

I gave it a bit to see if it worked.  Out of about 10 startups, I only had to manually mount once. That's a pretty good percentage.

It seems however _netdev didn't do a thing about unmounting before network is lost on shutdown, because I now have a 100% system hang on shutdown due to not being able to unmount the drives without a network connection.

Would either mounting them in another fashion or executing some kind of script save me from the dreaded 60 second freeze on shutdown?

Offline

#6 2013-07-27 17:32:50

pidsley
Window Mangler
Registered: 2012-05-23
Posts: 1,752

Re: Need help adding cifs entries to rc.local

OK then. Did you manage to put together a "mount" command that works from the command line after boot? (something like that command I posted just above your last post -- you may have to play around with the parameters to make it work) Once you get that working you can try putting the command in /etc/rc.local. I don't know if unmounting will be clean. You have reached the end of my (extremely limited) knowledge of cifs.

If you always boot into openbox, you could also give your user sudo privileges with no password for "mount" and put the mount command (with "sudo" prepended) in openbox autostart.

Last edited by pidsley (2013-07-27 17:34:03)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo