ilia_kr Posted August 11, 2006 Report Share Posted August 11, 2006 (edited) Hi there. I have some shared folders on windows computer that i use a lot. Usually I access them by nautilus, but now I want to try to mout them on my Linux PC to watch if there is some difference. I never done this before so i dont know how to do that. How do i mount samba shares from a CLI? How do i make Linux to automount them at boot? Thanks. P.S. I'm using FC4 now. Edited August 11, 2006 by ilia_kr Quote Link to comment Share on other sites More sharing options...
aioshin Posted August 11, 2006 Report Share Posted August 11, 2006 (edited) its been asked here many times, if you search here, there wll be lots of results.. but hey, where here to answer questions :D ok, here's how Im mounting it on my box, using autofs, it uses automount, so regular users can mount thus M$ shared. here's how I did it: since you're using fedora...check if autofs has been already installed: as root: rpm -qa | grep autofs if installed then skip the next code, if not then install it #installing autofs via yum yum install autofs after it has been installed, run it as a service chkconfig autofs on then edit /etc/auto.master and comment all inside it then append on it the ff: below.. /mnt/samba /etc/auto.samba -t=10 -t=10 refers to 10 seconds duration time that autofs will auto unmount mounted share . then create the directory /mnt/samba defined on the entries of /etc/auto.master file mkdir /mnt/samba now create the /etc/auto.samba file and enter the ff: below windows -fstype=smbfs,username=user,password=microshaft ://192.168.1.1/shared_folder what? windows - name of the folder where the shared_folder of 192.168.1.1 will be mounted when someone access it. 192.168.1.1 - ip of windows with shared_folder username and password - the username/password in your windows box that has access on that shared_folder after all of the above, start autofs /etc/init.d/autofs start and everytime there's a changes on /etc/auto.master and /etc/auto.samba, issue command /etc/init.d/autofs reload now to check if it works ls /mnt/samba/windows/ if it will lists the files inside that folder, then sucessfull, if not, then check log files. note: makesure smbclient been installed already... note: /mnt/samba/windows folder is autocreated if successful, you dont need to create it manually. if all works fine, try also to browse on it using konqueror treating as ordinary folder. Or put a shortcut of it in your desktop :D have fun! Edited August 11, 2006 by aioshin Quote Link to comment Share on other sites More sharing options...
ilia_kr Posted August 11, 2006 Author Report Share Posted August 11, 2006 I'll definitly will try that, but I 've heard somewhere that the same can be done by editing fstab. Could it be? Well I foun this: https://mandrivausers.org/index.php?s=&...st&p=127325 The problem is that I don't have a password on my XP so I can't setup fstab without it. How can I ommit the username & password keys in fstab? Quote Link to comment Share on other sites More sharing options...
aioshin Posted August 12, 2006 Report Share Posted August 12, 2006 (edited) actually, mounting via fstab is one option... the problem with that, if the shared folder is not available, and you tried to access it, say you put a shortcut of it on your desktop, there's a tendency that it causes the system to hang. because its been considered as static mount point, and then only root can re-mount it when unmounted. while using autofs, it'll be mounted dynamically, only when a user tries to open it... and after the specified duration, when no one accessing the mount point, then it will auto unmount. and mounting via fstab is common, see, just by searching, you found one... at least now, there's another option to mount... Edited August 12, 2006 by aioshin Quote Link to comment Share on other sites More sharing options...
ilia_kr Posted August 12, 2006 Author Report Share Posted August 12, 2006 (edited) ... doesn't work auto.master: # $Id: auto.master,v 1.4 2005/01/04 14:36:54 raven Exp $ # # Sample auto.master file # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # For details of the format look at autofs(5). #/misc /etc/auto.misc --timeout=60 #/smb /etc/auto.smb #/net /etc/auto.net /mnt/mp3 /etc/auto.samba -t=10 auto.samba: windows -fstype=smbfs ://192.168.123.103/MP3 I have no password on XP so i omitted username & password string the result: [root@linux-fc4 mp3]# /etc/init.d/autofs reload Checking for changes to /etc/auto.master .... Reload map /usr/sbin/automount --timeout=10 /mnt/mp3 file /etc/auto.samba [root@linux-fc4 mp3]# ls /mnt/mp3 [root@linux-fc4 mp3]# Edited August 12, 2006 by ilia_kr Quote Link to comment Share on other sites More sharing options...
RikRas Posted August 13, 2006 Report Share Posted August 13, 2006 I am using the gui smb4k which I think is part of the KDE, to mount shares on my XP pc's. Quote Link to comment Share on other sites More sharing options...
aioshin Posted August 13, 2006 Report Share Posted August 13, 2006 you write [root@linux-fc4 mp3]# ls /mnt/mp3 [root@linux-fc4 mp3]# you should ls /mnt/mp3/windows/ Quote Link to comment Share on other sites More sharing options...
ilia_kr Posted August 14, 2006 Author Report Share Posted August 14, 2006 you write [root@linux-fc4 mp3]# ls /mnt/mp3 [root@linux-fc4 mp3]# you should ls /mnt/mp3/windows/ So what? I should have seen the 'windows' foder inside 'mp3', right? Checked in nautilus too, nothing there... Quote Link to comment Share on other sites More sharing options...
aioshin Posted August 14, 2006 Report Share Posted August 14, 2006 in your /etc/auto.samba you define windows -fstype=smbfs ://192.168.123.103/MP3 by that, you should have to access that defined folder first for it to be mounted on your system, since by default, there is no any mounted remote folders yet by automounter/autofs unless a file on that folder has been accessed. So what? I should have seen the 'windows' foder inside 'mp3', right? Checked in nautilus too, nothing there... no, you'll not be able to see it unless you specify that particular folder ls /mnt/mp3/windows If no avail, try to check your logs, might be a problem behind.. . and also, have'nt really tried to mount an XP share that does not have a password lately... so dunno if that one also might cause a problem on mounting. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.