|
mounting a share at bootHow 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. |
|
robman50 |
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. |
|
|
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. |
|
1 edit |
so in fstab //READYSHARE/usb_storage /home/rob/Stuff smbfs noauto would that work? and rc.local mount /home/rob/Stuff |
|
robman50 |
nope nothing. still won't work. |
|
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. |
|
koitsu MVM join:2002-07-16 Mountain View, CA Humax BGW320-500
|
koitsu
MVM
2012-Sep-2 11:55 pm
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). |
|
Bill_MIBill In Michigan MVM join:2001-01-03 Royal Oak, MI TP-Link Archer C7 Linksys WRT54GS Linksys WRT54G v4
1 edit |
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 |
|
|
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. |
|
|
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 Michigan MVM join:2001-01-03 Royal Oak, MI TP-Link Archer C7 Linksys WRT54GS Linksys WRT54G v4
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 Member join:2002-11-04 Tallahassee, FL |
Maxo
Premium Member
2012-Sep-4 10:21 am
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. |
|
|
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. |
|
MaxoYour tax dollars at work. Premium Member join:2002-11-04 Tallahassee, FL |
Maxo
Premium Member
2012-Sep-4 10:33 am
Try this. » help.ubuntu.com/communit ··· manently I used to have this setup on my work machine. |
|
|
hang on I got to switch the o/s. stupid unity desktop. |
|
Bill_MIBill In Michigan MVM join:2001-01-03 Royal Oak, MI TP-Link Archer C7 Linksys WRT54GS Linksys WRT54G v4
1 edit |
I couldn't find any way to do it on the Unity desktop I've been playing with, but I'm still lost with it. But Ubuntu 10.04 was doable with a little fanageling... On the desktop I right-click->Create Launcher. Set TYPE to "Location". There was a browse option that was next to useless so I put in the location "smb://Hostname/Sharename/" without quotes. Works! But that's Gnome 2 (sigh). Maybe that's how you did it before? I saw no desktop Launcher of ANY kind in Unity. Again, the exact distro/desktop you're using is a must. Is it Unity? I've been trying to give it a chance - nice hot-key support if I didn't have to redo them all. EDIT: Maxo posted the what must be what I initially used a few years ago. Maxo, it looks familiar! The best way I can think of helping is to make you aware how the fstab mount method differs in details how Nautilus mounts things. Nautilus uses a different method which has a buzzword "fuse" and it differs in sometimes-gotcha ways. |
|
|
Well before when I did it I was all over Google and I copied and pasted the command to the correct files but I forgot to bookmark that site and backup the fstab and .smbcredentials. I was using lubuntu 12.04 at the time, than I switched to Ubuntu 12.04 LTS and hated it. So I found an older xubuntu 10.10 cd and it wanted to upgrade to 11.04. So now I am running xubuntu 11.04. |
|
Bill_MIBill In Michigan MVM join:2001-01-03 Royal Oak, MI TP-Link Archer C7 Linksys WRT54GS Linksys WRT54G v4
|
Well, I have a bunch of distros loaded while I play seeker, too. But Xubuntu 12.04, not 11.04, and it may make a huge difference as XFCE has been changing a lot. This works GREAT in Xubuntu 12.04 like this... Right-click desktop -> Create URL link. Name it what you like and under URL use "smb://Hostname/Sharename". It can permanently store credentials, too. Viola! Why do I have this nagging feeling it won't work in Xubuntu 11.04? |
|
|
said by Bill_MI:Why do I have this nagging feeling it won't work in Xubuntu 11.04? Something worked. I now have an icon and when I open it it brings up a window that shows everything on my network share. |
|
robman50 |
to Bill_MI
said by Bill_MI:This works GREAT in Xubuntu 12.04 like this... Should I climb the ladder up from 11.04 to 11.10 and up to 12.04? Or should I just burn a CD and install xubuntu 12.04? |
|
robman50 |
How could I get the share listings under the 'Places' tab? Like where it says 'Desktop, File System' and all that stuff on the left side and all the files in the right side, could I get that also? I'm trying to setup Thunderbird to store my inbox on the share so I selected the 'Browse' button under message storage and it says 'Select local directory'. So how can I chose the network share? Maybe that will help you guys help me. |
|
KearnstdSpace Elf Premium Member join:2002-01-22 Mullica Hill, NJ |
to robman50
on my Gentoo system, The fstab mounts the shared folders/drives. But then the Samba process starts up after the file systems have been mounted and I have never had an issue. my boot order at least mounts all the file systems first. |
|
MaxoYour tax dollars at work. Premium Member join:2002-11-04 Tallahassee, FL |
to Bill_MI
said by Bill_MI:On the desktop I right-click->Create Launcher. Set TYPE to "Location". There was a browse option that was next to useless so I put in the location "smb://Hostname/Sharename/" without quotes. Works! But that's Gnome 2 (sigh). Maybe that's how you did it before? In the latest Ubuntu you can do something similar. Either from the desktop or a Nautilus click File->Connect to Sever. Then fill out the information regarding your Windows share. Or in Nautilus just presl Ctrl-L then type the smb://Hostname section and press enter. Once in your share choose Bookmarks->Add Bookmark. The lack of the "Create Launcher" has nothing to do with Unity and is instead based on configurations in Gnome/Nautilus. |
|