 | mounting a share at boot How do you get a network share to be automatically mounted at boot up? I am thinking of having a remote share that will place an icon on my desktop and act as an hard drive. I know it can be done and I did it before but I can't find the commands on google anymore and if I find them I all ways get an error.  It's my usb stick on my router and it is a unix server. Would I have to use SMB or CIFS? or whatever that thing is. |
|
 | all I remember is that I had to edit the fstab file. |
|
 | man fstab man mount
Careful not to attempt to mount the system before the network is up. -- Keep It Safe, Stupid! Yes, I CanChat. Can You? |
|
 | How would I make the mount happen after the network is up? Maybe thats why it says 'error: can not resolve host address.' |
|
 | Use noauto in the fstab and use mount /your/smbfs/share in rc.local or another script that runs after the network is already up.
-- Keep It Safe, Stupid! Yes, I CanChat. Can You? |
|
|
|
 1 edit | so in fstab //READYSHARE/usb_storage /home/rob/Stuff smbfs noauto would that work? and rc.local mount /home/rob/Stuff |
|
 | nope nothing. still won't work. |
|
 | reply to robman50 sudo mount.cifs //192.168.0.1/usb_storage /home/Stuff/ Password: mount error(115): Operation now in progress Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
thats a strange error. |
|
 koitsuPremium,MVM join:2002-07-16 Mountain View, CA kudos:19 | Aren't CIFS/SMB shares referenced by DOS-style pathname conventions, e.g. \\hostname\sharename, not UNIX-style pathname conventions? The example given to you by Black Box (re: mount /your/smbfs/share) implies you have an /etc/fstab entry for /your/smbfs/share as the local mount point, not the CIFS/SMB share path.
Not all CIFS/SMB implementations work with \\ipaddress\sharename, so that's something to keep in mind too.
mount.cifs probably does not use the same code that something like Samba's smbclient would use, so if someone tells you to use something like smbclient \\ipaddress\sharename to see if it works, be aware that isn't using the same underlying code as what mount.cifs and surrounding bits do.
Also, the error you receive is listed on Google (on some Gentoo forums) as being a possible indicator of mounting the wrong server (i.e. server is not a Windows machine which supports CIFS/SMB mounting). -- Making life hard for others since 1977. I speak for myself and not my employer/affiliates of my employer. |
|
 Bill_MIBill In MichiganPremium,MVM join:2001-01-03 Royal Oak, MI kudos:1 Reviews:
·WOW Internet and..
·Comcast
1 edit | reply to robman50
I'll offer the solution I've been running for a while in fstab. I use the _netdev option to tidy-up the network at boot issue. The key package to install is smbfs (even though it handles pretty much all cifs these days) - at least on Debian distros. //172.23.34.50/C$ /mnt/Will-W2K/C$ cifs credentials=/home/bill/.smbcredentials,iocharset=utf8,_netdev,uid=bill,gid=bill,file_mode=0644,dir_mode=0777,noserverino 0 0
I chose a command with most the bells and whistles. I keep the file .smbcredentials in my home directory but the permissions are only for root. It's just 2 lines: username=(username) password=(password) You can just add these lines in the long option string, too. This happens to be a Windows 2000 share and "noserverino" was to shut up some message. I don't even remember the details, it's not mandatory. I'd love to hear any critique. Been awhile since I visited this. HTH |
|
 | reply to robman50 I'm used to the simple way: Tools -> Map network drive-> Select the drive letter and share path. Make sure 'Reconnect at logon' is checked.  |
|
 | Huh? Drive letter? Were you trying to mount a samba share on a windows box? |
|
 | That's what I do on my windows boxes. I have no idea what to do for a Linux system though. |
|
 | Oh. Allright. Have you tried either any approach suggested here?
The _netdev option is a more elegant alternative to the noauto, provided your distro's startup system supports it. Take a look at both in man mount.
I'd say, first find a fstab line that will allow you to manually mount and umount the remote share specifying only the mount point. 's example is a good starting point. Read and understand all options, make sure they make sense for you. You'll need to change at least uid and gid. Once this is working, chip away at the boot time automation.
-- Keep It Safe, Stupid! Yes, I CanChat. Can You? |
|
 | No idea what all that means but okay I'll try it. Meanwhile I will continue to scratch my head and go huh? lol I'm not really that smart when it comes to the Linux command line.  |
|
 1 edit | Well, what is your level with Linux administration? Do you know about the man command? Don't worry about the command line, it's nothing to it. I've learned Linux having only an install CD and a German magazine. I don't speak German and I had only a pocked dictionary. No internet access back then.
Anyway, type man fstab and see what each field in the example provided by means. Then type man mount and look up the specific options. You can search inside the regular pager used to display the manual by typing /, typing the search term and then hitting enter.
Read again the prior posts, change the sample to suit your situation and append it to your /etc/fstab. Make sure that the directory where you want to mount the share exists ant it has the proper permissions. If everything is right, using the example,
mount /mnt/Will-W2K/C$
will mount thr share under /mnt/Will-W2K/C$.
Report back when this works. |
|
 | said by Black Box:Well, what is your level with Linux administration? Do you know about the man command? Don't worry about the command line, it's nothing to it. I've learned Linux having only an install CD and a German magazine. I don't speak German and I had only a pocked dictionary. No internet access back then.
Well I know how to reboot and power down the system at the command prompt and man is sort of like help. :) I used to play around with Knoppix to learn some of the basics. |
|
 Bill_MIBill In MichiganPremium,MVM join:2001-01-03 Royal Oak, MI kudos:1 Reviews:
·WOW Internet and..
·Comcast
1 edit | I wonder if you've tried a GRAPHICAL/GUI method of any kind? If your file manager is Nautilus, it's similar to Windows...
Find "Network" and you should be able to browse "Windows Network", find your Workgroup/Domain then share name. You can create a bookmark to it. It will prompt for login info and present options.
What distro/flavor of Linux are you using? Someone may be able to get more specific with menus and the like. Menus and names for things do vary. "Bookmark" can be "Places", "Shortcut", Launcher" or something else. THIS is why Linux users tend towards the commandline - it doesn't change much.  |
|
 MaxoYour tax dollars at work.Premium,VIP join:2002-11-04 Tallahassee, FL | said by Bill_MI:I wonder if you've tried a GRAPHICAL/GUI method of any kind? If your file manager is Nautilus, it's similar to Windows... I would second this. Doing an actual mount into the filesystem is probably overkill for what you want to accomplish. Creating bookmarks is probably going to be both easier and more stable. |
|
 | reply to Bill_MI I am using Ubuntu and yes I see the 'Windows Network'. What I am looking for is a way to have a hard drive icon on the desktop so when I click on it than I get the network share. So the one hard drive icon would be my hard drive and the other will act like it is a hard drive but its on the network. I know its possible because I did it before than I had my email client store the inbox on that share. |
|