Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: Distribution: RHEL 5 with Pieces of this and that.
Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,697
Thanked: 6
Networking is not up at the time of running fstab file. I would change the auto to noauto in the fstab for the mount line and then add the mount command for the shares to run in /etc/rc.local. This is one of the last scripts to run.
An alternative is to use the _netdev option in /etc/fstab. It will defer mounting a share until the network is up.
You could still use noauto, and manually mount them with the command "mount -a -o _netdev". This will mount entries with the _netdev option.
I don't know if you were obfuscating the password= entry. You need "username=<a_user_name>" and "password=<a_password>". It would be better to use a credentials file and refer to it in /etc/fstab. Otherwise anyone can read the password. The "user" option allows the user to mount the share. The "uid=" option will determine the ownership of the mounted share. This won't supply the "username=" entry however.
When a samba share is mounted, the mount.cifs program is what performs the mount. So you can put the samba fstab entries in
/etc/samba/smbfstab instead.
For example:
Was the share mounted? Do you see files under the mount point as root? By the way, you can use your username after uid=.
Did you also use smbpasswd to add your username as a samba user? Are the permissions on the directory being shared OK? In other words, would the user represented by 501 be allowed to read from the directory. I'm not certain, but that may prevent it from being mounted with the user being the owner of the mounted partition.
I've been running nfs instead of samba. I just fired up samba on my desktop and mounted the service on my laptop without seeing your problem.
Yes, the share gets mounted, but under the root user. I did not use smbpasswd because the share does not require authentication (which is why I have a "password=" option to stop cifs from asking me for a blank password). Please let me know if you have further questions so I can get this mounted under the correct user.
I created a new user "testuser" so that I could try mounting my regular users profile/ on that computer.
Code:
sudo mount -t cifs //hpmedia/profiles hpmedia/ -o ro,uid=testuser,credentials=/home/jschiwal/.credentials
This was successful. I also tried it with the rw option. I used the credentials file of the user owning the service. I hadn't added "testuser" with smbpasswd. The "jschiwal" user was already added.
The username of the files and directories in /home/testuser/hpmedia was "testuser".
What is the configuration of the "backups" services on the two servers. Who owns the directories?
Since root mounts these directories it should be save to have a credentials file for that user or users in /root/. Only the root user would have access to the file. The user with the "504" uid won't need to enter a password because the share is already mounted.
The "amandabackup" user owns the directories, currently I do not have a credentials file because the share I am mounting does not require authentication. I just tried it again and here are the results:
Code:
[root@nvadmin amanda_backups]# umount test/
[root@nvadmin amanda_backups]# mount -t cifs //192.168.2.6/backups test/ -o rw,u
id=amandabackup,password=
[root@nvadmin amanda_backups]# ls -l
total 0
drwxrwxrwx 2 root root 0 Dec 3 00:44 cf_tera
drwxrwxrwx 3 root root 0 Dec 13 08:44 cr_tera
drwxrwxrwx 3 root root 0 Dec 13 08:44 test
[root@nvadmin amanda_backups]#
Thank you for the "_netdev" tip, that is handy! Also, thank you for the comment on the /etc/hosts file, I was trying to mount a share with a name rather than an IP and this helped me to solve my problem.
i have added entry in /etc/fstab
//x.x.x.x/netapps /usr/share cifs username=guest,password=,defaults 0 0
when i do mount -a
it mounts successfully but i looses my mount after i reboot.
I don't have username and password so i kept as guest.
If I don't give username and password it prompt and i have to press enter .
Can any one help on this??
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.