site Search:


 
    All Forums Hot Topics Gallery






how-to block ads


 
Search Topic:
Uniqs:
2348
Share Topic
Posting?
Post a:
Post a:
Links: ·Forum FAQ ·Attitude Adjustment ·Linux docs ·DistroWatch ·OPLM
page: 1 · 2 · 3
AuthorAll Replies

robman50

join:2010-12-14

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.

robman50

join:2010-12-14

all I remember is that I had to edit the fstab file.



Black Box

join:2002-12-21

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?


robman50

join:2010-12-14

How would I make the mount happen after the network is up?
Maybe thats why it says 'error: can not resolve host address.'



Black Box

join:2002-12-21

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?


robman50

join:2010-12-14

1 edit

so in fstab //READYSHARE/usb_storage /home/rob/Stuff smbfs noauto
would that work?
and rc.local
mount /home/rob/Stuff


robman50

join:2010-12-14

nope nothing. still won't work.


robman50

join:2010-12-14

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.



koitsu
Premium,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 See Profile (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_MI
Bill In Michigan
Premium,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

robman50

join:2010-12-14

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.



Black Box

join:2002-12-21

Huh? Drive letter? Were you trying to mount a samba share on a windows box?


robman50

join:2010-12-14

That's what I do on my windows boxes. I have no idea what to do for a Linux system though.



Black Box

join:2002-12-21

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?


robman50

join:2010-12-14

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.



Black Box

join:2002-12-21

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.

robman50

join:2010-12-14

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_MI
Bill In Michigan
Premium,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.



Maxo
Your 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.

robman50

join:2010-12-14

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.


Saturday, 25-May 22:49:32 Terms of Use & Privacy | feedback | contact | Hosting by nac.net - DSL,Hosting & Co-lo
over 13.5 years online © 1999-2013 dslreports.com.
Most commented news this week
Hot Topics