Re: Mount samba shares with utf8 encoding using cifs
Quote:
Originally Posted by
jeff8356
Any comments/suggestions?
I spent a good deal of time reading bug reports on this today. While wireless may still be a problem, you can try configuring network-manager to use "system setting" mode instead of user mode.
1) Right click on the nm-applet icon on the gnome panel and select "edit connections"
2) Select your network adapter and click "edit".
3) Make sure that "Available to all users" is checked.
4) Click apply.
If that doesn't work, despite FrustratedWithChanges ranting post, it does come with good advice. You could add an init script to mount and unmount your drives.
Try this:
1) Create the file with this command:
Code:
sudo nano /etc/init.d/cifs-mount
2) Paste the following into the file:
Code:
#! /bin/sh
# /etc/init.d/cifs-mount
#
# Some things that run always
touch /var/lock/cifs-mount
case "$1" in
start)
echo "Starting script cifs-mount"
mount /mnt/NASdocs
mount /mnt/NASdownload
mount /mnt/NASphotos
mount /mnt/NASbackup
;;
stop)
echo "Stopping script cifs-mount"
umount /mnt/NASdocs
umount /mnt/NASdownload
umount /mnt/NASphotos
umount /mnt/NASbackup
;;
*)
echo "Usage: /etc/init.d/cifs-mount {start|stop}"
exit 1
;;
esac
exit 0
3) Make the script executable with this command:
Code:
sudo chmod +x /etc/init.d/cifs-mount
See if that works.
Re: Mount samba shares with utf8 encoding using cifs
Quote:
Originally Posted by
dmizer
I spent a good deal of time reading bug reports on this today. While wireless may still be a problem, you can try configuring network-manager to use "system setting" mode instead of user mode.
1) Right click on the nm-applet icon on the gnome panel and select "edit connections"
2) Select your network adapter and click "edit".
3) Make sure that "Available to all users" is checked.
4) Click apply.
Already had that set from the start, before my first post............
My wifi has been working pretty good. No more errors in dmesg and no lost connections. I found a solution here and modified it for my hardware.
I installed these two backports:
Quote:
linux-backports-modules-headers-lucid-generic
linux-backports-modules-wireless-lucid-generic
Then did this:
Code:
sudo modprobe -rv ath5k
sudo modprobe hp-wmi
sudo modprobe -v ath5k
It has worked fine since...........
Quote:
If that doesn't work, despite
FrustratedWithChanges ranting post, it does come with good advice. You could add an init script to mount and unmount your drives.
I tried the script but it didnt solve the long shutdown. It works fine manually in terminal but not on shutdown or restart. So I am still stuck with my roundabout way of doing it.
It seems as if something is stopping scripts from running that is not part of the original system setup. Changing the /etc/rc#.d numbers should have made everything work but it seems to ignore any manual changes. Something to do with "Upstart" maybe??? Other non-Ubuntu distros also use upstart but seem to have fixed the problem. Its just very strange that all these scripts seem to be ignored by the system on shutdown/restart.
My Linux skills are very rusty. its been about 15 years since I have worked on any type of *nix (Novell Netware 3.?? and early Slackware) so this has been a re-learning experience for me and I appreciate the help.
Any other suggestions?
Re: Mount samba shares with utf8 encoding using cifs
dmizer, I just wanted to say thanks for this tutorial. I am new to Linux, and just installed Ubuntu on my new netbook earlier tonight. By following your instructions, I was able to get all of my Windows 7 machine's shared files mounted up in less that half an hour.
You rock!
Re: Mount samba shares with utf8 encoding using cifs
Quote:
Originally Posted by
jeff8356
Any other suggestions?
What kind of wireless security does the client computer in question have?
Re: Mount samba shares with utf8 encoding using cifs
Quote:
Originally Posted by
dmizer
What kind of wireless security does the client computer in question have?
WPA/WPA2 Personal with passphrase
Just to satisfy my own curiosity I installed 3 other distro's to check on this long shutdown problem. Two were RPM (non Ubuntu) based and one was BSD.
For all three I followed the directions on page 1 and set-up everything as before. All were clean installs. The BSD worked fine, no long shutdown problem. One of the RPM's worked flawlessly, no long shutdown. The second RPM was problematic to start, but also suffered the same long shutdown problem. So the problem is not limited to Ubuntu based distro's. It all appears to revolve around the shutdown sequence and rc#.d dropping out the wifi before the shares are unmounted.
As I said in an earlier post, renaming or re-ordering the the files in rc#.d seemingly had no effect for some odd reason. Unfortunately I did not think to try renumbering/re-ordering rc#.d in my test distro's.
Just to clarify for others, this "How to" works just fine and is well written and maintained. My particular situation seems to revolve around some other issue(s).
If this is getting a little too "off topic" please let me know. I can post it up in the networking forum.
Re: Mount samba shares with utf8 encoding using cifs
Quote:
Originally Posted by
jeff8356
WPA/WPA2 Personal with passphrase
Just to satisfy my own curiosity I installed 3 other distro's to check on this long shutdown problem. Two were RPM (non Ubuntu) based and one was BSD.
For all three I followed the directions on page 1 and set-up everything as before. All were clean installs. The BSD worked fine, no long shutdown problem. One of the RPM's worked flawlessly, no long shutdown. The second RPM was problematic to start, but also suffered the same long shutdown problem. So the problem is not limited to Ubuntu based distro's. It all appears to revolve around the shutdown sequence and rc#.d dropping out the wifi before the shares are unmounted.
As I said in an earlier post, renaming or re-ordering the the files in rc#.d seemingly had no effect for some odd reason. Unfortunately I did not think to try renumbering/re-ordering rc#.d in my test distro's.
Just to clarify for others, this "How to" works just fine and is well written and maintained. My particular situation seems to revolve around some other issue(s).
If this is getting a little too "off topic" please let me know. I can post it up in the networking forum.
If you are ambitious, you could ditch network-manager and configure your wireless manually -> http://ubuntuforums.org/showthread.php?t=571188
I think the real issue here is that network-manager, samba, and Linux inits are all partly to blame. Because of this it is extremely difficult to get everyone to work together for a proper fix.
Re: Mount samba shares with utf8 encoding using cifs
Quote:
Originally Posted by
dmizer
I thought about doing that but it detracts from my original reason of trying Ubuntu on a development machine. I wanted to find a distro that I could deploy on friends/family computers that works without me having to do much tweaking (or any at all. I am tired of fixing everyone's broken M$ boxes!!!). Many have some type of Media Server/NAS so as it stands now Ubuntu's (Canonical's) anomalies are a deal-breaker for me.
Quote:
I think the real issue here is that network-manager, samba, and Linux inits are all partly to blame. Because of this it is extremely difficult to get everyone to work together for a proper fix.
Which brings us back to "Upstart". Its supposed to be backwards compatible for older sysv scripts in rc?.d, but apparently they don't play well together. The one rpm distro that DID work was F13. Ironically they are dumping Upstart in their next release. IMHO 10.04 should have never been released as an LTS, it is a beta at best, as is Upstart!
Its a shame. I really liked Ubuntu and its spins and offshoots (Mint). Hopefully the dev's will get these problems worked out in the near future.
Thanks for your help......
Re: Mount samba shares with utf8 encoding using cifs
Just want to say thanks to dmizer for maintaining such a great thread, and doing it so well. I subscribed years ago, and I come back to it every time I "Ubuntify" another computer and need to mount a network drive.
Just a quick question/suggestion. I have simply followed the first post and things have worked for me every time I've needed this. For the last few setups, I have been mounting samba shares without passwords. All I've needed to use is the command:
sudo mount -t cifs //netbiosname/sharename /media/sharename -o guest,rw
or add the corresponding line to my fstab, and I have full read/write access. I must admit, I don't know what the last bit you add with all the "charset" and "0777" really means, but this shortened command makes a lot of sense to me, and I wonder if it would work for most people.
Thanks again for the outstanding thread.
Peace.
Re: Mount samba shares with utf8 encoding using cifs
Quote:
Originally Posted by
shakma
I must admit, I don't know what the last bit you add with all the "charset" and "0777" really means, but this shortened command makes a lot of sense to me, and I wonder if it would work for most people.
This depends on what kind of machine the samba server is running. If the samba server is a Linux machine, the 0777 gives the correct local permissions to the folder so it mounts as read/write. The charset option mounts the share with the utf8 character set so that filenames with international characters will display correctly.
Having these permissions doesn't hurt anything when they are not used, but they can help in a variety of situations so I added them to cover the most possibilities.
If you want to learn more about what all the options do, you can look at
Glad it's been working for you!
Re: Mount samba shares with utf8 encoding using cifs
I have a samba mystery that I can't figure out. For several years I mounted shares on my Windows desktop with a shell script with lines like smbmount //paule6500/docs /home/paul/pauldocs -o username=xxxx,password=xxxxx in it. Then suddenly on 8/23/2010, my scripts didn't work. http://ubuntuforums.org/showthread.php?t=764319 The only way I could make the mounts was to add sudo in front of the lines, as if Ubuntu suddenly decided that a user didn't have sufficient permissions to make mounts.
However, now I realize that these mounts are stubbornly read only. Can't copy or create files or directories on the mounted directories. ls -lt shows me that now the mount points are owned by root, while "myusername" is tying to write to the mounted directory. Doesn't seem to make any difference if I use the "smbount" or the "mount -t cifs" syntax or if I add the "rw" option. Doesn't seen to make a difference if I try another Windows PC.
Running 10.04 now.
Update: I was able to make read/write mounts to my PC's shares by editing fstab as explained on page one. But I was unable to make a writable mount manually, even when I tried adding the file_mode=0777, dir_mode=0777 as one page one. Tried "sudo mount -t cifs //paule6500/elevation /home/paul/elevation -o username=xxxx,password=xxxx,iocharset=utf8,file_mo de=0777,dir_mode=0777" Got a mount, but it was writable for su only.
Why did Ubuntu take mount away from ordinary users?