PDA

View Full Version : Mount samba shares with utf8 encoding using cifs



Pages : [1] 2 3 4 5 6

dmizer
October 30th, 2006, 06:27 AM
Introduction
I was having the most difficult time in the world trying to figure out the best way to connect from my ubuntu workstation to a server hosting shares which were created on a windows 2000 server.

Nautilus mounted them fine, and displayed the correct folder and file names. However, the files were not cashed which meant that I was getting very slow response times, and applications which were Nautilus unaware (Open office) could not access the shares. I was also having difficulty with my keyring among a few other share related issues.

I tried using the smbfs mount function, but it didn't want to cooperate with the Japanese file names. So, since cifs is suppose to be poised for a smbfs replacement I decided to take a look into it and see what it could do. So, even if you don't have Japanese (or other non-latin based characters) in your shared folder/file names, you should still take a look at cifs.

Disclaimer:
==================================
Despite the fact that this is a CLI tutorial, I have tried to write at a fairly basic level. Therefore, I've included a lot of commentary to address the needs of a newly established Linux/Ubuntu user which makes this howto seem lengthy (it's really only a couple lines of cli edits). So, if there is confusion, please let me know so I can attempt to clear it up.

Also, I have focused on command line instruction so the methods can be used in any of the Ubuntu based releases (Ubuntu, Kubuntu, Xubuntu et. al.)

Some NAS devices (like the ARGOSY HD363N) have difficulty handling cifs, so if you are trying to connect to a network attached storage unit, you may be stuck with smbfs (see disclaimer below). If you do have a NAS device, besure to include the device name and model in your post if you are having trouble.

SMBFS has depreciated is no longer included in Ubuntu. If your network needs require smbfs, you will have to compile it from source (http://ubuntuforums.org/showthread.php?t=707370), or use a version of Ubuntu earlier than Hardy (not recommended).

Finally, there are two alternatives to the following howto that may be of interest to some people. There is a nicely written tutorial for hard-mounting via GVFS: http://ubuntuforums.org/showthread.php?t=1186877. I have also written a tutorial for fixing Samba browsing here: http://ubuntuforums.org/showthread.php?t=1169149
==================================

Pre-work

There are a few preliminary actions we need to take before we can start mounting using cifs.

Although smbfs is no longer part of Ubuntu, smbfs is still the metapackage (https://help.ubuntu.com/community/MetaPackages) which contains all the dependencies (https://help.ubuntu.com/community/InstallingSoftware#Package%20Dependencies) necessary for using cifs to mount Samba shares. Ubuntu does allow for some cifs functionality out of the box, so it may seem like this command is not necessary, but the smbfs metapackage is critical for this howto. Even if you are positive you DO have the smbfs metapackage installed, run this command anyway.

sudo apt-get install smbfs

Now we need to create a location where the samba share can mount. Change "sharename" in the following code to something unique to the remote share, and that you will recognize (usually the share name itself). By creating the mount point in the /media folder, you will get a nifty icon to appear on your desktop like when a cdrom mounts.

sudo mkdir /media/sharename

To mount a windows share on a DHCP network, it is convenient to be able to mount by netbios name, so you don't have to modify the mount parameters every time you reboot your network. This can be easily enabled by doing the following:

Edit your nsswitch file

sudo nano /etc/nsswitch.conf
search through the file and look for the line that looks something like so:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
and add "wins" to the line so it looks something like this:

hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4
Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.
note: Order does matter. "wins" MUST be before "dns".

Now you'll need to install winbind

sudo apt-get install winbind
Reboot, or restart your network.

:!: Before you move on, you'll need to know the netbios name and share name of the computer you are trying to connect to. If you don't know what they are, please see the next post (http://ubuntuforums.org/showpost.php?p=1692022&postcount=2) in this thread before continuing


----------------------------------------------------

There are two ways you can mount using cifs; you can mount it manually as a one time use type purpose, or you can mount it permanently. If you only want to mount the share a few times, it's probably best to follow the directions under "Manual mount". If you will be mounting the same share over and over again, follow the directions under "Permanent mount".

In all cases, you will have to replace the following words:
> netbiosname
> sharename

with the actual netbios name and shared folder name of the shares on your remote computer.

Manual mount

If all you want to do is mount the samba share a few times, it's probably not necessary to make modifications to fstab as is the case with a permanent arrangement. Just modify one of the following lines so that it reflects your local needs (ie, change "netbiosname" to the netbios name of the samba server you are attempting to connect to, change "sharename" to the network name of your share, and change 'winusername' and 'winpassword' to the appropriate username and password of the share you are attempting to connect to).

:arrow: For a samba server with password protection:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777
:arrow: If your samba share does not require a password (shame on you ;) ) just use the following line instead:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77
:arrow: If your guest access does not allow write access, just remove the file and dir modes like so:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o guest,iocharset=utf8

Permanent mount

If you connect to the same samba share day in and day out, you'll likely want to mount it with a more permanent arrangement so you don't have to go looking for your mount command every time you boot your computer. To do this, you'll need to modify your fstab file. This is a system critical file (your Ubuntu box will not work correctly if it has a mistake), so you'll want to make a backup in case things go haywire on you:

sudo cp /etc/fstab /etc/fstab_old
if you need to restore your backup, use the following command:

sudo mv /etc/fstab_old /etc/fstab

If your samba server requires a password to access the shared files, you should create a credentials file so the username and password are hidden from prying eyes. If you don't have password protected access to your samba share, skip this section and start with the line that says "Now we edit fstab:".

To create a credentials file, do the following:

sudo nano /root/.smbcredentials

WARNING!!! Do not use a GUI text editor (like KATE) to create this file!!!

Add the following lines (change winusername and winpassword to the correct username and password for the samba/windows server you want to connect to):

username=winusername
password=winpassword
Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.

Now, change the permissions of the file so only root can read and edit it:

sudo chmod 700 /root/.smbcredentials

Now we edit fstab:

sudo nano /etc/fstab

and at the end of the file, insert one (1) of the following 3 lines according to your needs. Make sure you change "netbiosname" and "sharename" to the correct names for the server you are trying to connect to. (if you don't know what these are, please see the next post)

:arrow: For a password protected share with read/write permission.

//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
:arrow: For a non-password protected share with read/write permission use this instead:

//netbiosname/sharename /media/sharename cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0
:arrow: For read only guest access:

//netbiosname/sharename /media/sharename cifs guest,iocharset=utf8 0 0

Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.
note: if you've used a text editor other than nano, make sure that there is a blank line at the end of this file.

Finally, test your settings to make sure they work:

sudo mount -a
If you get a folder on your desktop with your server shares, then you have configured everything correctly. If not, please see the "Troubleshooting" section below, review the howto, or post in the thread.

Now, your samba shares will be mounted every time you start the computer. If you are not connected to your network when you boot, this will not cause problems. The share will simply not appear on your desktop.

Troubleshooting

******ERRORS******
Internal error failed to initialize HAL!
If you see this error in your dmesg, you can fix the problem by following the directions here: https://launchpad.net/distros/ubuntu/+source/hal/+bug/44874/comments/48

Thanks to bigbadsi (http://www.ubuntuforums.org/member.php?u=180853) for all the troubleshooting done to find the solution to this error, and for providing the inspiration for this howto: http://www.ubuntuforums.org/showthread.php?t=282008

---------####---------

CIFS VFS: Server not responding
If you see this error during shutdown, and or your shutdown sequence halts because of this error message:

[18.312000] CIFS VFS: Server not responding
[18.312000] No response for cmd 5 mid 8
Try this fix here:
http://ubuntuforums.org/showthread.php?t=1347340
*thanks to tipiglen (http://ubuntuforums.org/showpost.php?p=10580752&postcount=1309) for posting the fix to this.

For earlier versions of Ubuntu, this may also work.
Run these two commands:

ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh
Source: http://ubuntuforums.org/showthread.php?t=1128729

*thanks to incoming429 (http://ubuntuforums.org/showthread.php?t=469525) for testing the fix on this error.

The above two fixes don't work in all situations. There are more fixes listed in this thread: http://ubuntuforums.org/showthread.php?t=293513, or see the Jaunty specific fix below.

Bug information here: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/211631/

******Jaunty USERS******
CIFS VFS: Server not responding error needs a bit different fix.

Edit /etc/gdm/PostSession/Default:

sudo nano /etc/gdm/PostSession/Default
Add /etc/init.d/umountnfs.sh to the top of the file like so:

#!/bin/sh
/etc/init.d/umountnfs.sh

PATH="/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin:$PATH:/bin:/usr/bin"
OLD_IFS=$IFS

gdmwhich () {
COMMAND="$1"
OUTPUT=
IFS=:
for dir in $PATH
do
if test -x "$dir/$COMMAND" ; then
if test "x$OUTPUT" = "x" ; then
OUTPUT="$dir/$COMMAND"
fi
fi
done
IFS=$OLD_IFS
echo "$OUTPUT"
}

exit 0

******HARDY USERS******
Mount error 13. If you are seeing "mount error 13 = Permission denied" error ("CIFS VFS: cifs_mount failed w/return code = -13" in dmesg) when entering the "sudo mount -a" command, add the nounix option like so:

//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0
thanks to TonyS for posting this solution here: http://ubuntuforums.org/showthread.php?t=800313

******ALL USERS******
Space in path name. If you have a space in your path (example: //netbiosname/sharename with space), you should replace the space with '\040' like so:

//netbiosname/sharename\040with\040space /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

---------####---------

Netbios name resolution with Firestarter. Here is a fantastic thread for how to configure Firestarter so that name resolution works correctly: http://ubuntuforums.org/showthread.php?t=190542

---------####---------

Open Office save errors. If you get save errors when modifying an Open Office document in a CIFS mounted share, you will need to include the nobrl option like so:


//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,nobrl,file_mode=077 7,dir_mode=0777 0 0

Thanks to jwrede (http://ubuntuforums.org/showpost.php?p=6012786&postcount=691) for providing the solution to this troublesome problem.

---------####---------

Gedit save errors.
A bug (described here (https://bugs.launchpad.net/gedit/+bug/34813)) in gedit prevents gedit from saving to files located on CIFS mounted shares. Thank you MountainX (http://ubuntuforums.org/showpost.php?p=4597915&postcount=379) for reporting this very helpful information. A workaround for this error was located here (http://chrisnicholls.ca/2008/03/22/using-gedit-over-sshfs-or-smbcifs-without-being-annoyed/). The link is no longer valid, but the described workaround was to uncheck "Create backup of files before saving" (under "Edit" > "Preferences" > "Editor"). Also, a patch was recently posted so current versions of Gedit may not be effected.

---------####---------

Problems connecting to Vista? Take a look at this thread: http://ubuntuforums.org/showthread.php?p=6120780

Also, you will not be able to connect to any UAC protected drive/directory. Because of this, sharing the entire drives will not give you access (unlike it did in XP). Believe me when I say ... this is a very good thing. You don't want your entire system hanging out there for all to see. It's possible to override this protection but I wouldn't advise it.

Instead, share a single folder that your Vista user has control over. More information here:
http://www.vistax64.com/vista-security/103790-access-denied.html

---------####---------

Files owned by root / "The folder contents could not be displayed". If you can view but not change, delete, or add new files to your Samba share, or if you get an error in Nautilus which says, "The folder contents could not be displayed" or more recently "You don't have permission to do that"; try this fix:

1) Find your uid and gid (normally both are 1000, but double check):

cat /etc/passwd | grep ubuntu-username
The output will look something like this (my uid and gid are marked in red):

$ cat /etc/passwd | grep dmizer
dmizer:x:1000:1000:dmizer,,,:/home/dmizer:/bin/bash

2) Add gid, uid, and nounix options to your fstab line like so:

//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,n ounix,file_mode=0777,dir_mode=0777 0 0

KARMIC: Files owned by root / "The folder contents could not be displayed"
Note for KARMIC users encountering this error:
There is a bug affecting some users (particularly those with NAS devices like the Timecapsule) which gives the same symptoms as this problem. Bug report is here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/406466

Fix is simple, just add the "noserverino" option to the mount command like so:

//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,noserverino,gid=100 0,uid=1000,nounix,file_mode=0777,dir_mode=0777 0 0
Thanks to Dareus (http://ubuntuforums.org/showpost.php?p=8187618&postcount=1126) for posting the fix for this problem.

---------####---------

Permissions are always dr-xr-xr-x (read only) no matter how the share is mounted. Please see this Microsoft support document: http://support.microsoft.com/kb/326549/

Thanks to HyugaRicdeau (http://ubuntuforums.org/showpost.php?p=8053685&postcount=1083) for discovering the fix for that troublesome problem.

---------####---------

No international characters in your share? You can also use this howto for normal samba shares (without utf8 encoding). If the share does not have utf8 encoding, the iocharset option is simply ignored.

---------####---------

Let me know if this helps!

==================================
version history:
2008-03-28 > included bug information regarding gedit.
2008-05-20 > added fix for "mount error 13" in Hardy.
2008-05-29 > minor edit in "Disclaimer"
2008-06-01 > added note about the lack of smbfs in Hardy
2008-06-05 > clarified the need for installing smbfs package
2008-06-11 > added link for firestarter configuration
2008-10-23 > included work-around for Open Office save errors
2008-10-23 > possible workaround for Gedit save errors. testers wanted.
2008-10-27 > added solution for escaping a space in directory name
2008-11-07 > added solutions for Vista problems. added solution for "owned by root" when username is the same on both server and client. changed "after word" title to "Troubleshooting"
2009-01-07 > updated bug workaround for gedit.
2009-02-26 > more verbose reasoning for installing smbfs. added a more current example of /etc/nsswitch.conf. other minor cosmetic changes.
2009-03-26 > included more specific information about fixing gedit bug workaround. moved gedit bug information to the troubleshooting section. Removed all 2007 version history.
2009-04-20 > included updated link for CIFS VFS error; re-organized the troubleshooting section; moved warning about discontinued smbfs to the disclaimers section.
2009-05-11 > included verbose fix for CIFS VFS error.
2009-05-20 > added Jaunty CIFS VFS error fix.
2009-06-04 > included additional Vista information.
2009-06-29 > added links to alternatives to CIFS.
2009-10-30 > included fix for KARMIC bug 406466 (https://bugs.launchpad.net/ubuntu/+source/samba/+bug/406466)
2011-01-28 > minor edit to include Lucid permission error verbiage from Nautilus. changed aptitude to apt-get since aptitude is no longer installed by default
2011-03-22 > added fix for CIFS VFS error.
==================================

dmizer
October 31st, 2006, 06:45 AM
Just like to add:

If you don't know what the server netbios name is you can find it this way:

For windows servers
To find the netbios name in Windows xp:

start > my computer > view system information (under "system tasks" on the left) > computer name (tab)

The netbios name is next to "full computer name"

To find the share name in Windows xp:

Right click on the shared folder and select "properties", and click on the tab that says "sharing".

The share name is listed under "network sharing and security" next to "share name".


For linux servers
Best way I can think of is to look at your smb.conf file to see what your computer is called:

cat /etc/samba/smb.conf | grep netbios
the output will show your ubuntu server's netbios name.

Alternatively, you can find all the shares and share names on your network by entering the following command:

smbtree
or if your server requires a password:

smbtree user=winusername[winpassword]
and you should get results that look like this:

$ smbtree
Password:
MSHOME
\\YAMADA 山田
\\YAMADA\SharedDocs
\\YAMADA\IPC$ Remote IPC
\\SPROUT kasuga
\\SPROUT\C$ Default share
\\SPROUT\ADMIN$ Remote Admin
\\SPROUT\Common Files
\\SPROUT\SharedDocs
\\SPROUT\IPC$ Remote IPC
\\OYAMA
\\OYAMA\IPC$ Remote IPC
\\HIMUROPC himuro
\\HIMUROPC\SharedDocs
\\HIMUROPC\IPC$ Remote IPC
\\netbiosname\sharename

the password it asks for is the password for the samba server's share.

ting
November 1st, 2006, 11:46 AM
Great guide, just used it for Xubuntu!:D

I had a few problems:

1. the first mkdir command didn't work since i dont have a /mount folder.
I changed the command to sudo mkdir /mnt/delings$.

2. in fstab the directions are perhaps a bit confusing.
For me the following command(permanent mount alternative 2);

//server/sharename /media/sharename cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

after some testing became:

//pvr/delings$ /mnt/delings$ cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

To test that everything mounts correctly you can use the command sudo mount -a

If you get any errors, something did'nt work:-k

This saves you from restarting everytime you correct your fstab.

This is a great way to rectify the fact that xubuntu's network browsing is'nt as easy as in the other versions.

Now i can browse shares with thunar:mrgreen:

dmizer
November 1st, 2006, 02:27 PM
Great guide, just used it for Xubuntu!:D

glad to know you made it work, i was beginning to wonder ;)


1. the first mkdir command didn't work since i dont have a /mount folder.
I changed the command to sudo mkdir /mnt/delings$.
gahhh! my bad ... that line should have read /media/share rather than /mount/share. i've updated the howto with this change. can you verify for me that xubuntu has a /media folder?


2. in fstab the directions are perhaps a bit confusing.
i've made a few minor changes in wording and format in an effort to make things a bit less muddy.


To test that everything mounts correctly you can use the command sudo mount -a
initially, i intentionally left this out ... but there's merit in using it, so i've included it now.

thanks a million for testing this beast out for me!

ting
November 2nd, 2006, 12:18 PM
Xubuntu has a media folder, so no problems:mrgreen:

I had a little unrelated accident, so I had to reinstall my xubuntu installation.

Anny how the only error I got with sudo mount -a was:

[mntent]: warning: no final newline at the end of /etc/fstab

This happened because while editing with mousepad I didn't press enter after the new line I added.

So if anybody else gets this error you now know the solution:mrgreen:

Thanks for the Great guide!:-D

dmizer
November 2nd, 2006, 12:26 PM
[mntent]: warning: no final newline at the end of /etc/fstab

This happened because while editing with mousepad I didn't press enter after the new line I added.
lol ... that won't happen if you use nano like the guide says ;)

thanks for testing again, and glad to know it worked the second time too.

narky
November 4th, 2006, 03:38 AM
Hi there dmizer,

Thanks for the guide. I'm looking forward to learning that fstab stuff when I FINALLY get this thing workin' :)

I'm somewhat of a newb, so please excuse me if i've posted this in the wrong place, or feel free to 'bump' it to the right place.

I'm having some trouble understanding the difference between cifs/nfs/samba/smbfs. Samba to me seems like the linux protocol to talk to windows machines and smbfs/nfs/cifs are a means of doing that, is this correct?

I'm trying to use amarok to play files off a NAS (namely a DS-101j (http://www.synology.com/enu/products/DS101serise/index.php)). After a month or so of stuffing around I think my best shot is cifs, I get that impression from this article:
http://amarok.kde.org/wiki/Samba (down the bottom).

So I think i'm in the right place! Also having a read off the amarok forums from people with similar setups, some seem to have better success off cifs than smbfs.

So using your guide when I mount with:

sudo mount -t cifs //192.168.0.2/music /mnt/music -o username=******,password=******,iocharset=utf8,fil e_mode=0777,dir_mode=0777

The terminal just goes to it's normal thing and so it looks like it worked. And yet when i navigate to:
/mnt/music
there's nothing in the folder! Any ideas?

When I mount with

sudo mount -t smbfs -o username=*****,password=***** //192.168.0.2/music /mnt/music
The files appear in the folder. But if I try and copy large amounts/do an amarok collection scan it invariably crashes and the folder no longer appears as a mount, it feels like the whole mount system has just fallen over, this form of mount seems very ineffecient. The inbuilt nautilus 'connect to server' system seems quite a bit more effective but I still feel like I could get better performance...? As i'm sure your aware a lot of programs can't access the mount through the nautilus interface.

Having read a few of the bug reports for amarok some people claim they scan much larger collections using different hardware so I'm not sure what i'm doing wrong. I really have no idea what else I can try. I've also tried quite a few different GUI network mounting managers and the performance was still lacklustre/useless.

/On a side note, I gather the utf8 thing means it can read weird characters and stuff (hence the japanese fix). But what do -t/-o switches mean? And the "file_mode=0777,dir_mode=0777".

On a previous install of ubuntu I swear when I mounted things in the command prompt they would appear as desktop icons if successful, this doesn't seem to happen anymore and idea why?

My apologies at the length of this post.

Regards,
narky.

dmizer
November 4th, 2006, 04:01 AM
first of all, to answer your general questions:
yes, you are exactly correct, samba is the highway, and cifs/smbfs is the vehicle.

nfs is a linux specific protocol used for the same purpose. windows can't use it (that i'm aware of). but if your trying to talk from a linux machine to a linux file server, then nfs is the way to go.

nfs and samba are simply two different ways of transferring files across a network. there are many others ... scp, ftp ... all with varying positive and negative aspects.

to address your problem, did you install smbfs?

sudo aptitude install smbfs

if so, try this as well:

sudo aptitude install samba
and then give that line another try. it should work.

you don't get any errors or anything do you?

also, icons appear on the desktop if you mount in the /media folder, i don't think they will appear on the desktop if you mount from the /mnt folder. i really don't know about that for sure though ... i DO know that you WILL get a link on the desktop if you mount in the /media folder.

narky
November 4th, 2006, 04:17 AM
dmizer,

Thanks for your reply. It's amazing how much ](*,) (and random reading) i've done on such simple answers. I really do appreciate you answering ALL my questions. I'm having a very painful (and somewhat masochistically enoyable!) conversion to ubuntu. Anyway, sadly i had already installed the samba and smbfs... Just to confirm I tried it anyway:

sudo aptitude install smbfs
Password:
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
narky@narky-laptop:~$ sudo aptitude install samba
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done


To answer your question;
No, I do not get any errors on the aforementioned mount methods.
(What's the markup for 'quote' can't find it.)
A few days ago I was but that was because I hadn't installed samba!

One thing I noticed on reading the other ubuntu forum threads is that some people seemed to think different versions of samba could cause issue with cifs, could this be my problem?

What are the differences between smbfs and cifs? What protocol/pathway does nautilus mount stuff with?

So am I to understand you think my file server Synology DS-101j is linux based? (And hence, should be interfaced with using 'nfs') I've always thought it was linux based but never been sure. Assuming this is the case, how do I mount something using nfs rather than samba?

Cheers,
Chris


Ps.
So, I'm reading this guide:
HOWTO: NFS Server/Client (http://www.ubuntuforums.org/showthread.php?t=249889)

Do I have to that stuff:
"sudo apt-get install portmap nfs-common"
and
"sudo mount server.mydomain.com:/files /files"
-The trouble with above line is I don't think ubuntu will be able to resolve the dns name of my NAS...? Will it? What was that WINS stuff actually for in your howto? So if you do mount with out any switches does it assume to use 'nfs'?

dmizer
November 4th, 2006, 06:27 AM
okay ... let's hope that the 4th times' to charm here. the touchpad driver keeps browsing backwards when i touch it :(

anyway [quote] is your quote markup. bet you'll kick yourself for not figuring that out.

according to your hardware specs, you're not going to be able to use nfs. but cifs is supported, so there shouldn't be a problem with that. but i assume you have this connected and transferring files with no problems to a windows client? if so, did you have to install software or drivers to make it work?

i don't know of any problems with the current version of cifs working with window servers (it's important to note here that windows does not use samba, linux uses samba to emulate windows file sharing). there are sometimes problems when connecting to older linx samba servers with cifs, but if you have dapper, you'll not have this issue.

how about firewall protection. you must have a router in place, so it's something worth checking.

really, i'm grasping at straws here because i've never worked with nas units except for in windows clients, but from what i have experienced, you should be connecting with no problems.

differences between samba and nfs is that nfs is built on an open sourced file sharing structure. so it works fast on linux with very little configuration. samba on the other hand is a linux version of window's proprietary netbios file sharing. as such, it's a backwards engineered system that works tolerably only because people have been hacking at it for so long.

since nfs is a completely different functionality for mounting shared files, the command in fstab and in the cli is completely different. so no, if you just use "mount" it does not assume nfs.

the wins stuff at the beginning is designed to allow your ubuntu computer to resolve netbios names, so you will be able to mount your nas by name rather than ip.

do me a favor and post the output of

smbtree

i think you will be able to get more specific answers to many of your questions by using the man command. for example:

man mount.cifs
man mount
it'll give you a better idea of what opitons are available to you for mounting your share.

narky
November 4th, 2006, 08:40 AM
narky kicks himself in the head with a [quote] :P

dmizer,

Thanks for your reply.

I appreciate you filling me in on the background stuff, that learned experience stuff is impossible to get from a book and difficult to read between the lines on a howto.


okay ... let's hope that the 4th times' to charm here. the touchpad driver keeps browsing backwards when i touch it Touche. My 'next' task is to find out how I can turn my laptop (Dell Inspiron 1150) touchpad off, when I buy a real mouse, it drives me nuts the way it does that.

Okay it's official I'd like to cry. I've read all the man pages for mount, mount.cifs and mount.smbfs some of them several times. I have no idea why but the winning formula seemed to be:

sudo mount -t cifs //192.168.0.2/music /media/music -o user=*****,password=*****,domain=*****


Looking good... (see bottom line)

mount
/dev/hdc1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
devshm on /dev/shm type tmpfs (rw)
lrm on /lib/modules/2.6.15-27-386/volatile type tmpfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
//192.168.0.2/music on /media/music type cifs (rw,mand)


/side note
I think it also may have worked another time with the 'rw' switch I discovered it had worked once by accident (I reckon I almost tried every sort of switch combination/placement imaginable.) I still have no idea what the '-t' switch does.
You were right to, when it gets mounted in 'media' it does show up on the desktop!

And then:
*dramatic pause* (see screenshot)
There's nothing in it. #$%?!?!#!
I don't think i've gotten anywhere at all. ](*,)

The following is from the mount.cifs 'man' page:

In the directory /proc/fs/cifs are various configuration files and pseudo files which can display debug information...For more information see the kernel file fs/cifs/README.
Well I had a look in the /proc/fs/cifs folder and I couldn't find any debugging stuff not in the debugging or FYI files anyway. I also couldn't find the 'README' file mentioned.

To answer your questions:

i assume you have this connected and transferring files with no problems to a windows client? if so, did you have to install software or drivers to make it work?
I use it all the time on windows clients without a problem. You can just path to it as you would another windows machine (e.g. \\server-ip), there is a funny problem with windows where if you have the guest account turned on it won't ask you for a username and password so you can't access the drives. (And so, no I did not have to install any additional software; I have several of the drives loading as 'network' drives on boot up)

So am I right in understanding that my router is linux based? Would presumambly run something similiar to SAMBA to give windows compatability and would recommend cifs for linux interfacing?


how about firewall protection. you must have a router in place, so it's something worth checking.
Hmm, everything does run behind a firewall/router. But then how different is cifs to smbfs and the nautilus sharing things. Because the files appear when I mount it with smbfs and I stream music with rhythmbox fine under nautilus, and I can path to it with smb://ip-adress/folder --> it's just a pity not all the programs (ie. Amarok) can interface in this way.

What kind of thing would stop cifs from working? Do I need a port forward on the router or some such?


since nfs is a completely different functionality for mounting shared files, the command in fstab and in the cli is completely different. so no, if you just use "mount" it does not assume nfs.
But if I follow the instructions here:
under "NFS Client"
https://help.ubuntu.com/community/SettingUpNFSHowTo?highlight=%28nfs%29
and the instructions for a manual mount:

sudo mount 192.168.1.42:/home/music /home/poningru/music
-Then that does a nfs mount and they haven't added in any extra switches?


the wins stuff at the beginning is designed to allow your ubuntu computer to resolve netbios names, so you will be able to mount your nas by name rather than ip.
Hmm in the case I think the wins stuff worked because I can ping the server using it's DNS name rathern it's ip adress. (not sure if I used the right words then - hopefully you get my meaning)

As requested, smbtree info:

MSHOME
\\NARKY-LAPTOP narky-laptop server (Samba, Ubuntu)
\\NARKY-LAPTOP\ML-1510 ML-1510
\\NARKY-LAPTOP\ADMIN$ IPC Service (narky-laptop server (Samba, Ubuntu))
\\NARKY-LAPTOP\IPC$ IPC Service (narky-laptop server (Samba, Ubuntu))
\\NARKY-LAPTOP\print$ Printer Drivers
ICEBERG

So who knows why but the server isn't even showing up there. I don't think i've progressed at all, I think i'm going backwards.

Regards,
narky

dmizer
November 4th, 2006, 09:27 AM
-t vfstype ... or in other words: type, device, directory ... ect.

so in the case of mount -t cifs, you're telling "mount" to mount what follows as a cifs type mount.

from man mount:

mount [-lhV]

mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
mount [-fnrsvw] [-o options [,...]] device | dir
mount [-fnrsvw] [-t vfstype] [-o options] device dir

okay ... your nas device is your file server. since the file server you've purchased is designed to work on networks with windows clients, it is serving your files up as a windows type netbios file share. this means that nfs will *not* work. this is because nfs is a protocol that windows cannot handle.

please follow the directions at the top of the howto about wins, and then retry the smbtree command to see if your nas is visible then.

the options for file_mode and dir_mode are in place to give you the correct permissions to read and write the files, you might be successful in simply adding those two options to the end of the line you posted earlier:

sudo mount -t cifs //192.168.0.2/music /media/music -o user=*****,password=*****,domain=*****,file_mode=0 777,dir_mode=0777

but ... i'm confused. why are you seeing everything mount?

according to this:

mount
/dev/hdc1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
devshm on /dev/shm type tmpfs (rw)
lrm on /lib/modules/2.6.15-27-386/volatile type tmpfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
//192.168.0.2/music on /media/music type cifs (rw,mand)

it looks like you're mounting everything. for a temporary mount such as the one you're attempting to use ... all you need to do is copy that line directly into the terminal, replace your un/pw and domain and hit enter. then you should have a successful mount.

can ya give me some more detail on how you're going about this? maybe the command line output from start to finish ... including what you are typing before you hit the enter key ...

off to dinner. sushi tonight ... mmmm!

narky
November 4th, 2006, 10:24 AM
dmizer,

Thanks for the response.


from man mount:
Quote:
mount [-lhV]
mount -a [-fFnrsvw] [-t vfstype] [-O optlist]
mount [-fnrsvw] [-o options [,...]] device | dir
mount [-fnrsvw] [-t vfstype] [-o options] device dir
I have a bit of trouble understanding some of the things here, like 'fnrsvw' and 'optlist' but I think I get the jist. I don't quite understand which instructions to follow all the time. Like in mount.cifs 'man' it says you have to seperate the options with commas but lots of people don't seem to. And then in the mount page it says specify the user with username whereas in mount.cifs it says use 'user'. Is there some kind of universal syntax/hierarchy? (e.g. does the syntax for mount over ride the syntax for mount.cifs and mount.smbfs? As an analogy i'm thinking of the specific style overides the general style in Cascading Style Sheets).

Anyway.
I had already done your win instructions, but I tried doing them again just to make sure. See screenshot for the results of smbtree. The redded out stuff is not the NAS (sorry but I had to red it out for security reasons, it's a mac computer also on the network). There are other devices on the network that arn't showing up here. As you can also see from the screenshot I tried your 'file_mode and dir_mode' suggestions, but to no avail. As you can see the mount command doesn't throw any visible (in cli) errors.

Interestingly when I open up the share it reports the correct amount of free space! So there's obviously some form of interaction there, just no files. It also opens up quicker than pathing to it (ctrl+l) or using nautilus which makes me hopeful. I did find a article:
http://note.amherst.edu/thread.jsp?forum=5&thread=6105
-But it doesn't seem to apply to my case.

To answer your question about why I was using the 'mount' command:
I just did the mount command last time, to see if the network share was actually being mounted because I really wasn't sure as when I looked at where it was meant to be it was empty.

Thanks for all your help! Enjoy the sushi.

Kanpai!

narky.

narky
November 4th, 2006, 11:17 AM
dmizer!

hey it works! :-D ... [yes pause, your not delusional narky] it works! I'm not sure i'll ever get it working again, but hey.

I have no idea why, but the files are there now, and they weren't there before! :-D (see screenshot from before)

It's SO much better than smbfs :-D, no idea why but hey? So so much better. And amarok apart from so collection hicups is loading my collection. I think i'll be able to iron those issues out though.

Hopefully I'll figure out why it works in the next few days and get it to mount on boot!

Thanks for all your help dmizer.

=) Me very happy, been working on this for like six weeks.

Cheers,

narky.

dmizer
November 4th, 2006, 12:44 PM
dmizer!

hey it works!

holy smokes! that's fantastic. i was beginning to wonder if it was going to be possible for you.

wilberfan
November 6th, 2006, 06:15 PM
This is a fabulous HowTO--but as a n00b, there are some things I am confused about (and one thing I've learned about the Penguin--every "i" has to be dotted for this stuff to work!)

First, this confused me:


If your samba server requires a password to access the shared files, you should create a credentials file so the username and password are hidden from prying eyes. If you don't have password protected access to your samba share, skip this section and start with the line that says "Now we edit fstab:".

To create a credentials file, do the following:
Code:

sudo nano /root/.smbcredentials

add the following lines (change winusername and winpassword to the correct username and password for your samba server share):
Quote:
username=winusername
password=winpassword
Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.

Now, change the permissions of the file so only root can read and edit it:
Code:

sudo chmod 700 .smbpasswd

Should those file names in red be the same?! Is this a typo--or am I just lost here? (We created a file named '.smbcredentials', but then changed the permission of a file called '.smbpasswd'.)

And the winusername and winpassword are the name and password (MY name and password--I'm the only one using this machine) that I set up when I installed Samba, right?

I guess that leads me to my other (major) confusion...

I have two machines--my newer AMD 64x2 machine (running i386 Ubuntu) ("AMD-64") and an older Dell (DELL-Ubuntu) BOTH of which have Windows XP AND Ubuntuu loaded on them. I've set up Samba on both of them, too, (using this thread (http://www.ubuntuforums.org/showthread.php?t=202605)).

So, at this point I'm trying to get my AMD-64 machine ("[me]@AMD-64" is what's before the prompt in my terminal window--and that's my Netbios name, yes? "AMD-64" is what I entered as the netbios name in my smb.conf file.) to connect to my "DELL-Ubuntu" machine.

Here's where I get confused: A fstab entry like:


//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

In this case is 'netbosname' the name of the machine I'm connecting FROM (AMD-64) or the machine I want to connect TO (DELL-Ubuntu)? Or does "DELL-Ubuntu" go there?

And I'm not sure what sharename is. That should be the folder we set up in THIS step, yes?:


Now we need to create a location where the samba share can mount. Just change "sharename" in the following code to something unique to the share, and that you will recognize (usually the share name itself). By creating the mount point in the /media folder, you will get a nifty icon to appear on your desktop like when a cdrom mounts.
Code:

sudo mkdir /media/sharename

Sigh... as you can tell, I don't have a total grasp of what Samba is doing, nor exactly what that (those) fstab entries are doing...

Can you give me a helping nudge here? :-k

wilberfan
November 6th, 2006, 06:39 PM
In this command:


//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

Is what goes in place of 'sharename' the same?! (Yes, I AM confused!)

dmizer
November 7th, 2006, 04:37 AM
Should those file names in red be the same?! Is this a typo--or am I just lost here? (We created a file named '.smbcredentials', but then changed the permission of a file called '.smbpasswd'.)
nurrrrrr ... fixed that ... sorry.


And the winusername and winpassword are the name and password (MY name and password--I'm the only one using this machine) that I set up when I installed Samba, right?
incorrect. the winusername and winpassword are the username and password on the server you are attempting to connect to, not the machine you are using.


I guess that leads me to my other (major) confusion...

I have two machines--my newer AMD 64x2 machine (running i386 Ubuntu) ("AMD-64") and an older Dell (DELL-Ubuntu) BOTH of which have Windows XP AND Ubuntuu loaded on them. I've set up Samba on both of them, too, (using this thread (http://www.ubuntuforums.org/showthread.php?t=202605)).

So, at this point I'm trying to get my AMD-64 machine ("[me]@AMD-64" is what's before the prompt in my terminal window--and that's my Netbios name, yes? "AMD-64" is what I entered as the netbios name in my smb.conf file.) to connect to my "DELL-Ubuntu" machine.

In this case is 'netbosname' the name of the machine I'm connecting FROM (AMD-64) or the machine I want to connect TO (DELL-Ubuntu)? Or does "DELL-Ubuntu" go there?
"netbiosname" should be replaced with the network name (netbios name) of the computer you are attempting to connect to, not the name of the computer you are attempting to connect from. further, the "AMD-64" is not necessarily your netbios name on your local computer either.


And I'm not sure what sharename is. That should be the folder we set up in THIS step, yes?:
this should be replaced with the name of the shared folder of the computer you are trying to connect to


In this command:


//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

Is what goes in place of 'sharename' the same?! (Yes, I AM confused!)
as i said above "sharename" is the name of the folder you desire to connect to over the network. when you created the /media/sharename folder in the previous steps, you should have named "sharename" to whatever your sare's name is. since i have no idea what these things might be, you will have to replace every instance of the following words:
> winusername
> winpassword
> netbiosname
> sharename
so they match the needs of your shares. remember, this howto is about how to connect to another computer's shares, not how to connect to something on the computer you are using.

okay ... let's try this, just post the output of:

smbtree
and we'll try to customize the line for your specific application, because essentially you have 4 separate systems you may desire to share files to and from. so when you are sitting at your amd64 box, you will need to have two separate lines in your amd64 fstab:
one for your dell when booted to ubuntu, and another for your dell when booted to windows.

and conversely ... when you configure your dell computer, you will need two lines in your ubuntu fstab for your dell. one for your ubuntu install on the amd64 box, and one for your windows install on your amd64 box.

again:
samba ... is a server which allows other computers on your network to access files on the machine running samba.

cifs ... is what linux/ubuntu uses to access the shares on a samba or windows computer.

for illustration purposes:


CIFS -----> SAMBA
*not* CIFS <----- SAMBA
*and not* CIFS <-----> SAMBA

note here: windows does NOT use samba. samba is a server created for linux to emulate windows file sharing.

dmizer
November 7th, 2006, 05:00 AM
here's a concrete example from my own system.

i have two computers. a server named yakuin and a laptop named kyushu.

yakuin has a huge 300gb disk where i store everything, but kyushu is a laptop with a tiny 2 gig hard drive.

since i run an exclusively linux network, i have installed and configured samba on yakuin. in samba on yakuin, i shared a folder in /home/everything and named the share "everything". the share section of my smb.conf looks like this (note: in smb.conf under [global] is where you assign netbios name):

[everything]
path = /home/everything/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = *******
force group = *******

in the above example, yakuin is my samba server's netbiosname, and "everything" is my sharename.

so, now i want to connect to these shares from kyushu because i have no drive space for anything extra other than the operating system itself. (note: i do not have samba installed on kyushu, only smbfs)

on kyushu, i created a folder named:
/media/everything

and added this entry in fstab:
//yakuin/everything /media/everything cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

adamkane
November 7th, 2006, 05:30 AM
If browsing doesn't work, you can just convert your Japanese encoded filenames to UTF-8.

(Change cp850 to whatever encoding you are using:
euc-jp, iso-2022-jp, or shift_jis.
I haven't tested japanese conversion, so let me know if it works.)

Convert a few files before you try to convert your whole drive.



cd /<path to>
convmv -f cp850 -t utf-8 -r --notest *.*
Nautilus script:
http://g-scripts.sourceforge.net/

A Nautilus script allows you to right click the files you want to convert.



#!/bin/bash
#Convert CP850 to UTF-8

if [ $# -gt 0 ];then

convmv -f cp850 -t utf-8 -r --notest "$@"| zenity --progress --pulsate --text="conversion in progress" --auto-close

fi
exit 0

dmizer
November 7th, 2006, 05:40 AM
actually, the file names on the samba server i have at work are already utf-8 encoded, but nautilus couldn't read them, and couldn't copy them correctly. this is why i was so happy to discover cifs with the utf8 option. same was true for smbfs ... couldn't read the shares that were created by the windows 2000 server.

adamkane
November 7th, 2006, 05:44 AM
Oh, I see. A user may then want to convert from UTF-8 to another Japanese encoding to make browsing possibly easier.

Anyway sorry for the hijack.

And now back to our regularly scheduled program...

dmizer
November 7th, 2006, 07:15 AM
it's no problem ... i've always wanted to know how to convert encodings. but i realized it was going to be easier for me to mount the file system this way than to try to convert our network full of pobkac users.

wilberfan
November 7th, 2006, 05:19 PM
[Bowing reverently]

This is exactly the kind of clarification I needed!! Yes, I was on the wrong track in terms of my understanding of what the mount/fstab commands were trying to accomplish...



okay ... let's try this, just post the output of:

smbtree
and we'll try to customize the line for your specific application, because essentially you have 4 separate systems you may desire to share files to and from.

OK. Both machines are booted into Ubuntu, and here's what my smbtree just displayed:


me@AMD-64:~$ smbtree
Password:
HOME
\\DELL-UBUNTU Samba 3.0.22
timeout connecting to 208.**.***.40:445
timeout connecting to 208.**.***.40:139
Error connecting to 208.**.***.40 (Operation already in progress)
cli_start_connection: failed to connect to DELL-UBUNTU<20> (208.**.***.40)
\\AMD-64
Error connecting to 127.0.1.1 (Connection refused)
cli_start_connection: failed to connect to AMD-64<20> (127.0.1.1)
me@AMD-64:~$ (Those ip's made me nervous...so I asterisked out some of the numbers)

I'm off to work here soon; I'll check in tonight and see what I can get working! Thanks again for all the hand-holding!:mrgreen:

[Edit] There is a D-Link router that connects the two machines--will that be a possible issue re connectivity? (It wasn't under Dapper when I was just going through Nautilus to access the other machine...)

dmizer
November 8th, 2006, 01:43 AM
no problem to sensor your ip's. but since your shares are password protected (good for you), i can't see the share name, so you'll still have to provide that for me.

you said you used stormbringers guide to configure your samba server. so tell me this. in the smb.conf file (gksudo gedit /etc/samba/smb.conf) on your dell-ubuntu, take a look at what you have in the place of the section from stormbringers guide that looks like this:

[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
you don't actually have to include your username or group, just so that i have what's in brackets at the top. ie: "[myfiles]", then do the same for your amd-64 box.

also, you shouldn't need to worry about configuring your router at all.

wilberfan
November 8th, 2006, 04:35 AM
no problem to sensor your ip's. but since your shares are password protected (good for you), i can't see the share name, so you'll still have to provide that for me.

you said you used stormbringers guide to configure your samba server. so tell me this. in the smb.conf file (gksudo gedit /etc/samba/smb.conf) on your dell-ubuntu, take a look at what you have in the place of the section from stormbringers guide that looks like this:

[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
you don't actually have to include your username or group, just so that i have what's in brackets at the top. ie: "[myfiles]", then do the same for your amd-64 box.

also, you shouldn't need to worry about configuring your router at all.


Great!

Here's the section from the Dell box:


[MyFiles]
path = /home/dell-share
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = mydellsigninname
force group = mydellsigninname

Here's the AMD-64 box:


[MyFiles]
path = /media/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = myAMDsigninname
force group = myAMDsigninname

I just tried this mount command (which gave me zero results):


sudo mount -t cifs //DELL-Ubuntu/dell-share /media/samba -o user=mydellsigninname,password=********,iocharset= utf8,file_mode=0777,dir_mode=07

I'm still getting smbtree weirdness, too:

me@AMD-64:~$ smbtree
Password:
HOME
\\DELL-UBUNTU Samba 3.0.22
timeout connecting to 208.**.***.40:445
timeout connecting to 208.**.***.40:139
Error connecting to 208.67.219.40 (Operation already in progress)
cli_start_connection: failed to connect to DELL-UBUNTU<20> (208.**.***.40)
\\AMD-64
Error connecting to 127.0.1.1 (Connection refused)
cli_start_connection: failed to connect to AMD-64<20> (127.0.1.1)

dmizer
November 8th, 2006, 08:34 AM
the samba tree is timing out because the password it's asking for is the password on the remote computer. it's trying to connect, but it's getting denied because you didn't type in the correct password and/or username. this is perfectly normal.

a couple of things. first, you don't want to mount your remote computer's shares in the same directory as your local computer's shared files (in your case /mount/samba), so give them a new folder so you won't get your computer or yourself confused as to which computer the files are on:

sudo mkdir /mount/MyFiles

okay, second ... the "sharename" is what's in brackets [sharename] in your smb.conf files. so in both cases, your sharename is going to be MyFiles.

so, your manual mount line for the dell will look like so:

sudo mount -t cifs //AMD-64/MyFiles /media/MyFiles -o user=youramdsigninname,password=********,iocharset = utf8,file_mode=0777,dir_mode=0777

your fstab line for your amd will look like this:

sudo mount -t cifs //DELL-UBUNTU/MyFiles /media/MyFiles -o user=yourdellsigninname,password=********,iocharse t= utf8,file_mode=0777,dir_mode=0777

in both cases, you can change "MyFiles" to whatever you like as long as it maches what's in [] in the smb.conf of the computer you are trying to connect to. or IOTW, fstab on local must equal smb.conf on remote

wilberfan
November 8th, 2006, 06:00 PM
Bare with me; I'm almost there (I think!)...


the samba tree is timing out because the password it's asking for is the password on the remote computer. it's trying to connect, but it's getting denied because you didn't type in the correct password and/or username.

That just seems impossible...at this point I only HAVE one password (I'm using it everywhere on both systems until I learn what I'm doing more thoroughly. But let's put that aside for awhile and move on...


a couple of things. first, you don't want to mount your remote computer's shares in the same directory as your local computer's shared files (in your case /mount/samba), so give them a new folder so you won't get your computer or yourself confused as to which computer the files are on.

okay, second ... the "sharename" is what's in brackets [sharename] in your smb.conf files. so in both cases, your sharename is going to be MyFiles.

I think for me, using the same name to refer to two different things (or the same thing in two different places) may get confusing. So here's what I've done at this point: Here's the new smb.conf from AMD-64:

[AMD-64Files]
path = /media/samba/
browsable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = amd64signinname
force group = amd64signinname

And here's the DELL-Ubuntu smb.conf:

[DellFiles]
path = /home/dell-share
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = dellsigninname
force group = dellsigninname


so, your fstab line for the dell will look like so:


sudo mount -t cifs //AMD-64/MyFiles /media/MyFiles -o user=youramdsigninname,password=********,iocharset = utf8,file_mode=0777,dir_mode=0777

your fstab line for your amd will look like this:

sudo mount -t cifs //DELL-UBUNTU/MyFiles /media/MyFiles -o user=yourdellsigninname,password=********,iocharse t= utf8,file_mode=0777,dir_mode=0777

in both cases, you can change "MyFiles" to whatever you like as long as it maches what's in [] in the smb.conf of the computer you are trying to connect to. or IOTW, fstab on local must equal smb.conf on remote

Technically, those are MANUAL mount commands, yes? Wouldn't the fstab entry look slightly different?

OK, here's a good place to stop and make a request: I can see now that the reason I'm struggling with this, is that I don't completely understand what each part of the 'mount' command (or the fstab version when we get to that!) represents. I desperately appreciate you walking me through it, but it's not going to MAKE SENSE until I understand what it is I'm entering when I use that command.

For example, if I'm on my AMD machine and want to connect to the DELL:

mount ...This seems obvious

-t ...I don't know what this is, but it's easy enough to just put it there, so, no prob... ;-)

cifs invoking the cifs system, probably

//DELL-Ubuntu This is the machine (technically the Net-bios name?) for the 'remote' machine (the machine I want to connect TO)?

/XXXXXX This must be the folder specified in the smb.conf of the remote machine (DELL)?? The folder that I want to be able to access from the LOCAL (AMD) machine? It is into this folder that I will place things I want to 'share', yes?

media/ Now, this the point on the LOCAL machine (AMD) where I want to 'mount' or 'attach' the folder specified in the previous parameter?

XXXXXX Again, the folder within the previous directory? (In my case would this be /media/samba ?)

-o Whatever

user=remotesigninname,

password=remotepassword,

iocharset= utf8, Something to do with English?

file_mode=0777, File permissions (read/write)?

dir_mode=0777 Again, read-write permissions?

So, my manual mount command (I'm not ready for the fstab one yet!) to connect TO the DELL-Ubuntu machine FROM the AMD-64 SHOULD look like this??:


sudo mount -t cifs //DELL-Ubuntu/DellFiles /media/samba -o user=dellsignin,password=dellpswd,iocharset= utf8,file_mode=0777,dir_mode=0777

But when I tried it, I just get a sad little blinking cursor in my terminal window...



](*,)

dmizer
November 9th, 2006, 12:08 AM
sounds like you have the hang of things. but in your manual mount command that you posted though, you have a space after iocharset= so it looks like "iocharset= utf8" but there should be no space there: "iocharset=utf8".

but in reality, you don't really NEED this option unless you have files with characters other than english. it doesn't hurt to have it, but it also won't hurt to leave it in.

-t means mount as Type cifs
-o means "options"

the rest you seem to understand fairly well.

but there's also another problem that may be causing you issues. when you mount your shared files, you will have to place them in an EMPTY directory. according to your amd-64 smb.conf, your amd samba shared files are in /media/samba. so when you mount your dell's shares, you will have to give them a new empty directory to mount in other than /media/samba

so, be sure to make a new directory in /media on the amd-64 box.

edit: despite the fact that you seem to grasp this anyway, better safe than sorry, so one more thing ...

//DELL-Ubuntu This is the machine (technically the Net-bios name?) for the 'remote' machine (the machine I want to connect TO)?

/XXXXXX This must be the folder specified in the smb.conf of the remote machine (DELL)?? The folder that I want to be able to access from the LOCAL (AMD) machine? It is into this folder that I will place things I want to 'share', yes?
yes and no to your second point. this is a small, but important distinction. this should be what your remote computer calls the share on the network. ie: share name. it can be different than the name of the folder your files are in, as is the case with your situation for example. your smb.conf looks like this:


[AMD-64Files]
path = /media/samba/
browsable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = amd64signinname
force group = amd64signinname
note, the files you want access to are in /media/samba, but it's called AMD-64Files on the network.

wilberfan
November 9th, 2006, 03:45 AM
OK, I did a


sudo mkdir /media/MyFiles (And there's nothing in that directory...there was nothing in the /media/samba one either...)

Then tried this mount command:


me@AMD-64:~$ sudo mount -t cifs //DELL-Ubuntu/dell-share /media/MyFiles -o user=dellsignin,password=dellpasswd,iocharset=utf8 ,file_mode=0777,dir_mode=0777

...and still just get a blinking cursor...

dmizer
November 9th, 2006, 04:41 AM
i assume that by "just a blinking cursor" you mean that you are not getting returned to the prompt.

what happens when you:

ping DELL-Ubuntu

wilberfan
November 9th, 2006, 04:53 AM
That's correct: no prompt, nothing appears on the desktop...

When I ping DELL-Ubuntu, I get "64 bytes from [ip]" I assume that's a 'positive' response...

dmizer
November 9th, 2006, 05:02 AM
yup ... positive response.

have you rebooted or restarted samba since you made the changes to smb.conf?

also, what happens if you open firefox and type:
smb://DELL-Ubuntu/

if you see a directory structure, what is listed there?

wilberfan
November 9th, 2006, 05:03 AM
Oh sure...several times...

Could there be some kind of permission issue going on??

dmizer
November 9th, 2006, 05:11 AM
if you go to:
system > administration > networking and then click on the DNS tab, is your router listed at the top for your primary dns server?

also, can you browse to smb://DELL-Ubuntu in firefox?

wilberfan
November 9th, 2006, 05:15 AM
if you go to:
system > administration > networking and then click on the DNS tab, is your router listed at the top for your primary dns server?

Yes. [I'm using opendns in my router--would that effect anything?]


also, can you browse to smb://DELL-Ubuntu in firefox?

No. I just get a little twirly icon on that tab for 30 seconds or so, then the home page opens on that tab.

dmizer
November 9th, 2006, 05:20 AM
okay ... remove your router as your primary dns server. that should help things some. you should only see your internet provider's dns servers there.

now try this from the amd box:

smbtree --user=yourdellusername[yourdellpassword]
does your password contain any punctuation? specifically & or !

wilberfan
November 9th, 2006, 05:35 AM
okay ... remove your router as your primary dns server. that should help things some. you should only see your internet provider's dns servers there.

Do you mean change the setting to DHCP? I don't have my isp's dns servers in there. (I did have opendns settings in the router (208.67.222.222).


now try this from the amd box:

smbtree --user=yourdellusername[yourdellpassword]
does your password contain any punctuation? specifically & or !

No special characters in the password.

Well, I changed the network settings, and it killed my internet connection. It DID seem to positively effect our smbtree stuff, though!

Here's the output from the latest smbtree:


HOME
\\DELL-UBUNTU Samba 3.0.22
\\DELL-UBUNTU\Mom'sEpson EPSON Stylus C60
\\DELL-UBUNTU\ADMIN$ IPC Service (Samba 3.0.22)
\\DELL-UBUNTU\IPC$ IPC Service (Samba 3.0.22)
\\DELL-UBUNTU\DellFiles
\\DELL-UBUNTU\print$
\\AMD-64 Samba 3.0.22
Error connecting to 127.0.1.1 (Connection refused)
cli_start_connection: failed to connect to AMD-64<20> (127.0.1.1

dmizer
November 9th, 2006, 05:49 AM
lol ... so the trick is going to be to make your internet connection work as well as make your samba connection work huh?

okay. well, i'm talking about dns servers, not ip addresses. in networking there should be a tab that says "dns" in the top window frame, it should list dns servers. these servers should only be from your internet service provider (or in your case ... open dns server addresses), not a part of your network. what settings did you change such that you were able to make smbtree work?

wilberfan
November 9th, 2006, 05:52 AM
Okay. I finally got it to work. I had to change the properties of my eth0 wired card to "DHCP", instead of the router address. I also had a mistake (in red) in my mount command:


sudo mount -t cifs //DELL-Ubuntu/DellFiles /media/MyFiles -o user=dellid,password=dellpswd,iocharset=utf8,file_ mode=0777,dir_mode=0777

I've gained a connection to my Dell box; what have I lost? Anything? What will that change to my network settings do to my internet connection speed, etc?

And, next, I'm gonna wanna know what I have to do to be able to browse a lot more of the Dell machine--not JUST that one folder! :rolleyes:

wilberfan
November 9th, 2006, 05:57 AM
lol ... so the trick is going to be to make your internet connection work as well as make your samba connection work huh?

okay. well, i'm talking about dns servers, not ip addresses. in networking there should be a tab that says "dns" in the top window frame, it should list dns servers. these servers should only be from your internet service provider (or in your case ... open dns server addresses), not a part of your network.

The opendns guys suggest putting their ip addresses into the router (so you don't have to change settings in your different machines?? That's a guess on my part) which I had done.

Their addresses are now in the DNS tab, as you suggested. But it seems I have to change the configuration of the eth0 card from "Static" (with the router address listed) to "Automatic (DHCP)" Is this kosher?

dmizer
November 9th, 2006, 06:08 AM
well, as dhcp, it will be more difficult to enable ip forwarding for internet serving. for example ... if you want to host a website, or an ftp server. some routers are capable of recognizing netbios names but not all. i'll have to do some investigating to figure out why it's not working with static ip, becuase frankly ... i really don't know.

you want to browse your whole dell box? that's easy. install ssh server on the dell:

sudo aptitude install openssh-server
now you can ssh to your dell box and have view (view only) capability to your entire machine. ssh is a VERY powerful tool. you can get access to any application on your remote machine:

ssh -X dellusername@dellip
the x is uppercase. now you can open any gui on the dell from the command line. want to freak someone out? ssh into the dell from your amd box, and open your music program and start some music on your dell from your amd ;)

you want to browse your files?

ssh -X dell@dellip
nautilus

wilberfan
November 9th, 2006, 06:17 AM
well, as dhcp, it will be more difficult to enable ip forwarding for internet serving. for example ... if you want to host a website, or an ftp server. some routers are capable of recognizing netbios names but not all. i'll have to do some investigating to figure out why it's not working with static ip, becuase frankly ... i really don't know.

None of those scenarios sound very likely for me in the immediate future--but I would be interested in knowing why it wouldn't work until we changed it!


you want to browse your whole dell box? that's easy. install ssh server on the dell:

sudo aptitude install openssh-server

Oy. MORE installing?! ;)



now you can ssh to your dell box and have view (view only) capability to your entire machine. ssh is a VERY powerful tool. you can get access to any application on your remote machine:

ssh -X dellusername@dellip
the x is uppercase. now you can open any gui on the dell from the command line. want to freak someone out? ssh into the dell from your amd box, and open your music program and start some music on your dell from your amd ;)

you want to browse your files?

ssh -X dell@dellip
nautilus

Well, that WOULD be cool, but I can't help but think fondly back (two weeks ago?) to Dapper--where this could all be done through Nautilus!! I know, I know...that's not the 'best' way to do it--but it sure was easier!!

Buckets of thanks for your sustained assistence... I'll bet I'll have even more questions in the (near) future!

wilberfan
November 9th, 2006, 06:23 AM
you can get access to any application on your remote machine:

ssh -X dellusername@dellip


Well, crap. More connectivity problems:


ssh: connect to host DELL-Ubuntu port 22: Connection refused ](*,)

dmizer
November 9th, 2006, 06:29 AM
lol ... you just don't want to make this easy do you? sheesh. ;)

by the way ... i have YET to install edgy. so all these solutions i'm offering you are solutions to problems i've found as a result of working with dapper and nautilus' incapacity.

try rebooting your dell before you connect to it. that should sort your ssh issue.

wilberfan
November 9th, 2006, 06:35 AM
You haven't installed Edgy yet?! Duuuuuuuude. (Maybe you're having second thoughts!)

Does ssh have to be installed on BOTH machines? 'Cuz rebooting the Dell made no difference--I still got the 'Connection Refused' error message.

dmizer
November 9th, 2006, 06:54 AM
lol ... no, i just like to wait around until all the hardware issues are sorted out so i can have an easier transition. besides, dapper works perfectly well for me, and it's going to be supported for a while so i suspect that many of my machines will stay at dapper for the foreseeable future.

ssh server does not have to be installed on both computers ... that said, it won't hurt to install it on the amd either. try connecting with netbios name instead:

ssh -X dellusername@dell-ubuntu
the dellusername here must be the user name that you type into gdm when you log into the dell box if you were sitting at it.

dmizer
November 9th, 2006, 07:00 AM
argh ... it seems the package is simply ssh, not openssh-server as in dapper. apologies.

sudo aptitude install ssh

wilberfan
November 9th, 2006, 07:06 AM
lol ... no, i just like to wait around until all the hardware issues are sorted out so i can have an easier transition. besides, dapper works perfectly well for me, and it's going to be supported for a while so i suspect that many of my machines will stay at dapper for the foreseeable future.

ssh server does not have to be installed on both computers ... that said, it won't hurt to install it on the amd either. try connecting with netbios name instead:

ssh -X dellusername@dell-ubuntu
the dellusername here must be the user name that you type into gdm when you log into the dell box if you were sitting at it.

I rebooted the AMD and things changed a bit:


meonAMD@AMD-64:~$ ssh -X meondell@DELL-Ubuntu
The authenticity of host 'dell-ubuntu (192.168.0.101)' can't be established.
RSA key fingerprint is e1:20:d8:d8:17:48:86:2e:8d:ce:13:e2:37:c3:f7:df.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'dell-ubuntu,192.168.0.101' (RSA) to the list of known hosts.
meondell@dell-ubuntu's password:
Linux DELL-Ubuntu 2.6.17-10-generic #2 SMP Fri Oct 13 18:45:35 UTC 2006 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.
You have new mail.
Last login: Wed Nov 8 21:52:54 2006
meondell@DELL-Ubuntu:~$

Wait. Is that all I get?? Do I have to do all my browsing from the command line??!? Ooooooh....no fair!! (Crap. Is it too late to go back to Dapper?!) :???:

And how does it know I have new mail?! (That's a little creepy!)

I admire your discipline in being able to stay with Dapper; I'm waay too big a Release Queen... I always wanna try the latest everything... :twisted:

dmizer
November 9th, 2006, 07:13 AM
not just the command line. once you've ssh'd to the dell, type "nautilus", and shezam ... you can browse all your files on your dell with gui.

and the new mail bit ... don't worry about that so much. the ssh server sent you a system local email (read: created a file on your dell computer). i forget where those things show up, but if you really want you can just delete it (once you find it of course).

ps. once you start using ssh, you begin to see just how powerful the command line can REALLY be.

wilberfan
November 9th, 2006, 07:22 AM
not just the command line. once you've ssh'd to the dell, type "nautilus", and shezam ... you can browse all your files on your dell with gui.

Ooooh! I was HOPING you'd say that! :mrgreen:

I did get a nautilus window to open, but this error message showed up:


(nautilus:4900): libgnomevfs-WARNING **: Failed to open session DBUS connection: Unable to determine the address of the message bus (try 'man dbus-launch' and 'man dbus-daemon' for help)
Volume monitoring will not work.

When I browsed to a file, and tried to open it...I got a "F-Spot Encountered a fatal error".

Oy. I've had enough for tonight.... At least we've made some progress!

wilberfan
November 9th, 2006, 07:41 AM
argh ... it seems the package is simply ssh, not openssh-server as in dapper. apologies.

sudo aptitude install ssh

I just saw this. The '-X' (as in, "sudo ssh -X name@machine'" now seems to be an "illegal option"...

dmizer
November 9th, 2006, 07:55 AM
no ... "sudo" is an illegal option. you can't assign root privelages to do ssh. you've already connected with the -X option so that's not the problem.

also, opening nautilus via ssh gives you VIEW ONLY access to your files. if you want to open them, close nautilus, and open it from the command line:

rhythmbox
and just use rhythmbox's file browser to open whatever song you want played.

or if you have a fast network:

mplayer
and start a dvd that's in the drive on your dell (may be too slow for this). with the -X option, you can open ANY gui application from your remote computer.

wilberfan
November 9th, 2006, 05:40 PM
no ... "sudo" is an illegal option. you can't assign root privelages to do ssh. you've already connected with the -X option so that's not the problem.

Ooops. My bad.


also, opening nautilus via ssh gives you VIEW ONLY access to your files. if you want to open them, close nautilus, and open it from the command line:

rhythmbox
and just use rhythmbox's file browser to open whatever song you want played.

or if you have a fast network:

mplayer
and start a dvd that's in the drive on your dell (may be too slow for this). with the -X option, you can open ANY gui application from your remote computer.

Ahhh, okay... :neutral: I gotta be honest; right at the moment I'm having one of those Windows-users moments: "Why does it have to be this complicated?" ;) Guess I'm still in the 'adjustment' phase! :mrgreen:

wilberfan
November 9th, 2006, 06:15 PM
Interesting... My DNS setting in System/Administration/Networking gets reset to the router address (192.168.0.1) at reboot (negating my ability to mount via cifs)!:confused:

dannyboy79
November 9th, 2006, 06:28 PM
there are a few solutions that fix the dns issue here. http://www.ubuntuforums.org/showthread.php?t=103927&highlight=make+dns+setting+permanent
it is because dhcp overwrites /etc/network/interfaces file each time you reboot. i don't have that issue because I setup a static ip since my computer is a server.

dmizer
November 10th, 2006, 02:00 AM
Ahhh, okay... :neutral: I gotta be honest; right at the moment I'm having one of those Windows-users moments: "Why does it have to be this complicated?" ;) Guess I'm still in the 'adjustment' phase! :mrgreen:
well, thanks for having the fortitude to stick through it. plugged ya in the howto for finding the problem with static networking.


Interesting... My DNS setting in System/Administration/Networking gets reset to the router address (192.168.0.1) at reboot (negating my ability to mount via cifs)!:confused:
looks like dannyboy79 has that covered for ya.

wilberfan
November 10th, 2006, 04:03 AM
Well, all that work last night and I haven't been able to get my share to mount since... I've triple checked my network settings (DHCP, router no longer the DNS addr, etc...).

Nuthin'.

wilberfan
November 10th, 2006, 05:32 AM
And now, for just that extra touch of weirdness... I just rebooted, and NONE of my Network Settings have changed! My opendns ip addr's stayed just like I set them.

But I STILL cant get through to the Dell to mount the share directory via cifs.... (And, as desert, ssh no longer works, either. I just discovered that port 22 IS open, but it says the 'connection is refused'. There must be some kind of Edgy/Router thing going on??)

dmizer
November 10th, 2006, 06:02 AM
can you ping the dell? by netbios name or by ip? are both the dell and the amd machine set for dhcp? any errors?

wilberfan
November 10th, 2006, 06:56 AM
Successful pings both by netbios AND ip... The Dell machine is now DHCP (I don't think it was last night when I connected successfully!)

I'm not sure what kind of errors you're asking about. I get this when I try to ssh to the Dell:


ssh: connect to host DELL-Ubuntu port 22: Connection refused

I'm back to the lack-of-prompt when I try my mount command...

dmizer
November 10th, 2006, 07:14 AM
can you connect to either machine from windows?

wilberfan
November 10th, 2006, 07:20 AM
can you connect to either machine from windows?

Yep. Just connected from Xp (on the AMD) to Ubuntu (on the Dell). Quick n' easy! ;) :p

dmizer
November 10th, 2006, 07:56 AM
okay ... try this ... can you mount (using cifs) from the amd booted to ubuntu to the dell booted in windows?

wilberfan
November 11th, 2006, 04:50 PM
okay ... try this ... can you mount (using cifs) from the amd booted to ubuntu to the dell booted in windows?

That would be a negatory. (But the Dell under XP connects like that [snapping fingers] to the AMD under Ubuntu.)

dmizer
November 11th, 2006, 11:59 PM
alright ... i have a machine i can set up to install edgy. gimme a bit to see if i can't sort things out.

wilberfan
November 12th, 2006, 07:53 AM
alright ... i have a machine i can set up to install edgy. gimme a bit to see if i can't sort things out.

I'll be REALLY interested to hear what you discover! :D

dmizer
November 12th, 2006, 02:00 PM
I'll be REALLY interested to hear what you discover! :D

unfortunately ... i discovered absolutely nothing. i currently post from edgy. i installed the system, got all the updates, have the current kernel, and configured my system to mount samba shares line by line according to my howto and, after discovering that my server's smb.conf file had the wrong share directory, i was able to connect and view my shares right away.

i mounted both manually and via fstab, and everything worked just like it should. but i'm working with a completely stock install. zero tweaks with the exception of my cpu fan module, and configuring my gnome-panel the way i like it.

all i can think of at this point is firewalls? you had static ip before ... can you give me a bit of information on how you have your network configured? what kind of changes (networking and/or security) have you made to your system ... maybe i can duplicate your setup ... i really don't know what's holding you up, but i'd sure like to figure it out.

wilberfan
November 12th, 2006, 05:56 PM
I don't think I've made any network tweaks to a 'stock' system!

I wonder if there's more network weirdness related to this specific hardware? I had an issue for awhile with my AMD machine, where it would only have internet connectivity if I selected the ethernet card that was NOT connected to the router!

There was a second card installed in a PCI slot, and when I first installed edgy, I could only connect to the web if I went into network settings and selected that PCI card--but the ethernet cable was physically plugged into the onboard eth0 card!!

I physically removed the PCI card, and reinstalled Edgy--that seemed to end that confusion? Of course, now I can't remember if that was the 64bit Edgy or (this) 32bit Edgy...

I have a D-Link DI-604 router that both machines are plugged into. No special modifications to that... I have a couple of port-forwarding settings for bittorrent, etc. I have no software firewalls installed (unless they come with the distribution).

I installed the kubuntu-desktop. I've added all the non-free codecs, etc, necessary to play back all my media files...

What kinds of tweaks would I have to have made to possibly be a factor?

[edit] I went back and looked--the ethernet card weirdness was with Freespire (http://forum.freespire.org/showthread.php?t=2395). But, still... There might be some hardware issues?

wilberfan
November 12th, 2006, 06:13 PM
I just noticed that something has added three lines to the end of my smb.conf file:


[AMD-64Files]
path = /media/samba/
browsable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = amdsignin
force group = amdsignin
available = no
public = no
writable = no

Is there something in Edgy that does that??

dmizer
November 13th, 2006, 01:11 AM
I just noticed that something has added three lines to the end of my smb.conf file:
remove them, or comment them out and test again. (don't forget to restart your samba server after you've made changes to smb.conf

Is there something in Edgy that does that??
i don't know ... but i can test it tonight after i get home from work. did you dist-upgrade from dapper?

wilberfan
November 13th, 2006, 05:48 PM
OK. I decided to be a little more methodical about this!

Thinking perhaps that I had tweaked something that shouldn't be tweaked, yesterday morning I did a clean reinstall of Edgy. I wrote down each step to keep track of what I did and the result.

Here's what I've learned so far:

smbtree would only give 'clean' results (ie, no timeout errors) if I had NO OPENDNS IP ADDRESSES anywhere! (not in the router, nor in the DNS tab of Network Settings)

I was able to get a clean smbtree with Static (not DHCP) IP settings and the router ip address (192.168.0.1) in the Networking control panel.

My problem now is when I try and do a manual mount, I'm getting this:


amdsignin@AMD64:~$ sudo mount -t cifs //DELL-Ubuntu/DellFiles /media/dellshare -o user=dellsignin,password=dellpswd,iocharset=utf8,f ile_mode=0777,dir_mode=0777
mount: wrong fs type, bad option, bad superblock on //DELL-Ubuntu/DellFiles,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

I hadn't seen that error on my previous attempts (pre- clean install), and I'm a little baffled at what it's telling me...

dmizer
November 13th, 2006, 11:52 PM
My problem now is when I try and do a manual mount, I'm getting this:


amdsignin@AMD64:~$ sudo mount -t cifs //DELL-Ubuntu/DellFiles /media/dellshare -o user=dellsignin,password=dellpswd,iocharset=utf8,f ile_mode=0777,dir_mode=0777
mount: wrong fs type, bad option, bad superblock on //DELL-Ubuntu/DellFiles,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

I hadn't seen that error on my previous attempts (pre- clean install), and I'm a little baffled at what it's telling me...

what did dmesg | tail say? also, try the mount command without the utf8 option:

sudo mount -t cifs //DELL-Ubuntu/DellFiles /media/dellshare -o user=dellsignin,password=dellpswd,file_mode=0777,d ir_mode=0777

also just noticed, there was a space after the "f" in file_mode=0777 ... that might have caused your problem.

edit:
i did a bit more reading over at opendns and fount a possible solution which might allow you to use your opendns settings.

try using open dns addresses and use this line for your mount command:

sudo mount -t cifs //DELL-Ubuntu./DellFiles /media/dellshare -o user=dellsignin,password=dellpswd,file_mode=0777,d ir_mode=0777
note the "." after DELL-Ubuntu. this may or may not work, but that's the solution that opendns gives for this problem.

wilberfan
November 14th, 2006, 06:28 AM
I appreciate your ongoing research! Here's what happened when I tried again tonight:


me@AMD64:~$ sudo mount -t cifs //DELL-Ubuntu/DellFiles /media/dellshare -o user=dellsignin,password=dellpswd,file_mode=0777,d ir_mode=0777
mount: wrong fs type, bad option, bad superblock on //DELL-Ubuntu/DellFiles,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

me@AMD64:~$ dmesg | tail
[17179599.816000] NET: Registered protocol family 31
[17179599.816000] Bluetooth: HCI device and connection manager initialized
[17179599.816000] Bluetooth: HCI socket layer initialized
[17179599.824000] Bluetooth: L2CAP ver 2.8
[17179599.824000] Bluetooth: L2CAP socket layer initialized
[17179599.828000] Bluetooth: RFCOMM socket layer initialized
[17179599.828000] Bluetooth: RFCOMM TTY layer initialized
[17179599.828000] Bluetooth: RFCOMM ver 1.7
[17180613.276000] CIFS VFS: cifs_mount failed w/return code = -22
[17180768.972000] CIFS VFS: cifs_mount failed w/return code = -22

(Note: The space after the d in "dir_mode=" was NOT entered into the terminal--that's some artifact of this posting procedure...)

I'll try your opendns workaround AFTER I get at least ONE clean connection from one machine to the other! ](*,)

dmizer
November 14th, 2006, 07:35 AM
i vaguely recall having this exact same problem.

what happens when you do this:

sudo aptitude install smbfs

Rebeca
November 14th, 2006, 07:29 PM
I've tried this guide and everything seemed to be OK until the end, when I did the sudo mount -a, and I got:


mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

Now, my windows share doesn't need a password, because I've always accessed it without one, is there something I'm missing?

The line I added to the fstab, looks like this:



//DIMENSIONE310/C$ /media/here cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0


and my smbtree looks like this:



HERE
\\UBUNTU ubuntu server (Samba, Ubuntu)
\\UBUNTU\ADMIN$ IPC Service (ubuntu server (Samba, Ubuntu))
\\UBUNTU\IPC$ IPC Service (ubuntu server (Samba, Ubuntu))
\\UBUNTU\linux
\\UBUNTU\hdb1
\\UBUNTU\print$ Printer Drivers
\\DIMENSIONE310
\\DIMENSIONE310\C$ Default share
\\DIMENSIONE310\ADMIN$ Remote Admin
\\DIMENSIONE310\x
\\DIMENSIONE310\DeskJet- \\UBUNTU\DeskJet-610CL
\\DIMENSIONE310\My Music
\\DIMENSIONE310\print$ Printer Drivers
\\DIMENSIONE310\SharedDocs
\\DIMENSIONE310\IPC$ Remote IPC
\\DIMENSIONE310\My Documents


(I'm not sure if this is relevant or not, but I can browse my shares with firefox with no problem.)

dmizer
November 14th, 2006, 10:31 PM
The line I added to the fstab, looks like this:



//DIMENSIONE310/C$ /media/here cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0


and my smbtree looks like this:



HERE
\\UBUNTU ubuntu server (Samba, Ubuntu)
\\UBUNTU\ADMIN$ IPC Service (ubuntu server (Samba, Ubuntu))
\\UBUNTU\IPC$ IPC Service (ubuntu server (Samba, Ubuntu))
\\UBUNTU\linux
\\UBUNTU\hdb1
\\UBUNTU\print$ Printer Drivers
\\DIMENSIONE310
\\DIMENSIONE310\C$ Default share
\\DIMENSIONE310\ADMIN$ Remote Admin
\\DIMENSIONE310\x
\\DIMENSIONE310\DeskJet- \\UBUNTU\DeskJet-610CL
\\DIMENSIONE310\My Music
\\DIMENSIONE310\print$ Printer Drivers
\\DIMENSIONE310\SharedDocs
\\DIMENSIONE310\IPC$ Remote IPC
\\DIMENSIONE310\My Documents


(I'm not sure if this is relevant or not, but I can browse my shares with firefox with no problem.)

okay ... looks like you're trying to mount a device (C$) rather than a share. it should work if you mount x, My Music, SharedDocs, or My Documents.

to mount a share with a space in the name use a reverse slash in front of the space like so:

//DIMENSIONE310/My\ Music /media/here cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Rebeca
November 15th, 2006, 01:56 AM
That's right. Thank you.

However, the reverse slash didn't do it for me. fstab doesn't seem to accept any spaces, so I had to use a 040 instead of the space:



//DIMENSIONE310/My\040Music /media/here cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0


This was a good, simple guide. Thanks again.

wilberfan
November 15th, 2006, 03:44 AM
i vaguely recall having this exact same problem.

what happens when you do this:

sudo aptitude install smbfs


me@AMD64:~$ sudo aptitude install smbfs
Password:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following NEW packages will be installed:
smbfs
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 385kB of archives. After unpacking 922kB will be used.
Writing extended state information... Done
Get:1 http://us.archive.ubuntu.com edgy/main smbfs 3.0.22-1ubuntu4 [385kB]
Fetched 385kB in 1s (228kB/s)
Selecting previously deselected package smbfs.
(Reading database ... 91493 files and directories currently installed.)
Unpacking smbfs (from .../smbfs_3.0.22-1ubuntu4_i386.deb) ...
Setting up smbfs (3.0.22-1ubuntu4) ...


Is this what I'd have gotten whether or not I'd install smbfs previously?

wilberfan
November 15th, 2006, 04:15 AM
Why on earth would I be getting THIS now?!


me@AMD64:~$ sudo mount -t cifs //DELL-Ubuntu/DellFiles /media/dellshare -o user=dellsignin,password=dellpswd,file_mode=0777,d ir_mode=0777
mount error: could not find target server. TCP name DELL-Ubuntu/DellFiles not found
No ip address specified and hostname not found

dmizer
November 15th, 2006, 11:21 AM
Is this what I'd have gotten whether or not I'd install smbfs previously?
nope. remember, you reinstalled your os so you'll have to start from the beginning of the guide again.


Why on earth would I be getting THIS now?!
have you edited nsswitch.conf and installed winbind yet? if you've already done this, can you ping DELL-Ubuntu?

wilberfan
November 15th, 2006, 12:39 PM
Okay...! When I redid the nsswitch.conf and winbind yet again, then rebooted, everything worked fine.

Now I'll have to experiment with those opendns workarounds...!

dmizer
November 15th, 2006, 01:40 PM
well, congrats again. i'm really not sure if that fix will work with mount or not, but can't hurt to try it out.

let me know how it turns out.

Abhi Kalyan
November 16th, 2006, 04:55 PM
WOWOWOWOWOWOWOWWO WOW,
Great People Thank you a TONEEEEEEEEE-
My kisses,
After a week
atlast
able to automount a drive so precious.
Thank you all
Thank you

A doubt-
The share that am mounting has variying access permissions for varying users,
Is it possible to automount in such a way that the permissions set on the .smbcredentials file gets changed with every user logging in.
Ex:
When user-zen logs in read write permission
when user-skylock logs in reaqd permission
when user-benking logs in no acces at all.
or does this have a connection to authenticating usning samba?

wilberfan
November 16th, 2006, 05:41 PM
I have a question that's kind of in the same area as Abhi's...

I've got an fstab entry that works now...which allows me to access one designated folder on my Dell. You explained (earlier) how to use ssh to browse other folders, etc... I find that I am unable to copy/open any of the files that I access this way. (For example, there was an image I wanted to try as AMD wallpaper on the Dell--but couldn't copy it or open it.)

Is there an easy way to provide more complete access of one machine from the other?

wilberfan
November 16th, 2006, 06:00 PM
OK, I have to ask: This thread is, in many ways, a response to Nautilus being a poor way to access Samba.

I've just learned that Konqueror works GREAT. Is cifs still a "better" choice to share files via samba? (dmizer has got to be rolling his eyes by now!)

8)

der_joachim
November 16th, 2006, 07:45 PM
CIFS is very fast compared to smbfs. At work, I used smbfs for large folders with many small files. Sometimes it took a full minute to get a file listing in smbfs. Although CIFS needs some time in the beginning, it is very fast later on and it even seems to autorefresh.

To the OP: Thank you very much for this HOWTO. It helped me tremendously. :)

dmizer
November 17th, 2006, 01:57 AM
A doubt-
The share that am mounting has variying access permissions for varying users,
Is it possible to automount in such a way that the permissions set on the .smbcredentials file gets changed with every user logging in.
Ex:
When user-zen logs in read write permission
when user-skylock logs in reaqd permission
when user-benking logs in no acces at all.
or does this have a connection to authenticating usning samba?
the permissions you desire are controlled by the computer hosting the share, not the computer mounting the share. so:
1) if your share is hosted by a linux machine, you'll have to configure smb.conf on the remote computer for permissions (first link in my sig).
2) if the remote computer is a windows machine, i'm not too sure how to tell you to restrict permissions that way.


CIFS is very fast compared to smbfs. At work, I used smbfs for large folders with many small files. Sometimes it took a full minute to get a file listing in smbfs. Although CIFS needs some time in the beginning, it is very fast later on and it even seems to autorefresh.

To the OP: Thank you very much for this HOWTO. It helped me tremendously. :)
so glad to know it helped!


OK, I have to ask: This thread is, in many ways, a response to Nautilus being a poor way to access Samba.

I've just learned that Konqueror works GREAT. Is cifs still a "better" choice to share files via samba? (dmizer has got to be rolling his eyes by now!)

8)
well, actually, it depends on your needs. if, say, you regularly copy files larger that 2 gig across your network, even konq is not a good choice. cifs is the only protocol which can handle large file support. one of my biggest complaints about nautilus (and perhaps konq as well) is that i can't save a file directly to my server from my browser/word processor/gimp etc. speed is sometimes also an issue if you want to listen to music hosted on a windows server. but if konq does what you need it to do, and you like kde ... nothing wrong with that.

personally, i prefer gnome. i find it less flashy and (when configured correctly) faster than kde. i also have several computers with alternative desktops like fluxbox and icewm which do not have any mount capability from their file managers, as well as two servers with no gui at all. so it's easier for me to learn one way to mount my shares that works on all my (seven) different machines.

and, while i realize not everyone's computing needs are like my own, i'm also aware that it's near impossible to write a samba mount howto which can cover all the gui possibilities available to ubuntu. i also believe that, for a person using linux, it's essential to know how things work and why, because education is key to keeping linux secure and safe for future users. or in other words, linux is different than windows, and that's a good (though sometimes frustrating) thing.

as for your ssh questions, since it's really not in the scope of this thread, take a look here: http://easylinux.info/wiki/Ubuntu_dapper#SSH_Server ... you can also mount a remote computer using ssh and fuse.

dannyboy79
November 17th, 2006, 04:30 AM
ive got a weird one for ya, i just tried switching from smbfs to cifs because I was having the error localhost kernel: [603328.573736] smb_add_request: request
and guess what cifs returns when i do sudo mount -a. it states: mount.cifs failed: password in credentials file too long. and my password is only 10 characters long!! now it does start with puncuation and has letters, numbers, capital letters, a symbol, and then it ends with puncuation but it sure is hell isn't 64 chars long. i checked out the cifs code, it came up in gogle, and when i do a find for credentials in the cifs code, sure enough, there is a line that states: if(length > 64) {
printf("mount.cifs failed: password in credentials file too long\n");
memset(line_buf,0, 4096);
if(mountpassword) {
memset(mountpassword,0,64);

so what is up with this? should I post a bug?

dmizer
November 17th, 2006, 05:44 AM
is there a blank line after the username and password in the credentials file? cifs reads the blank line as an eof, so if no eof, the password looks infinite.

meikdahogo
November 20th, 2006, 10:10 AM
I've been searching the net over and over for a manual on how to correctly mount my server's shares on my ubuntu box.
Your instructions work like a charm, your post is the best that happened to me since my switch.

my sincere thanks!

Meik

dmizer
November 20th, 2006, 10:15 AM
glad to know it helped. but thanks also need to go to the good folks who have posted here and helped me refine the howto.

enjoy.

Kulgan
November 28th, 2006, 09:21 PM
Have allowed read/write access from the windows machine, used the second line in fstab, mount -a gives:



root@UBUNTU:~# mount -a
mount: wrong fs type, bad option, bad superblock on //DESKTOP/C,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

dmizer
November 28th, 2006, 11:43 PM
what is the output of smbtree? also post dmesg | tail

Titi
November 29th, 2006, 04:41 PM
hi.
first of all, very helpfull guide! made a lot of things clear for me. thanks for that. but i still have a problem...
accessing my ubuntu-laptop from mij windows-desktop is no problem. the other way round doesnt work...
i did everything in the tutorial (with DHCP) and i get no errors, but when i do
sudo mount -a, nothing happens. or it takes a long time and then i just ctrl-c. so i suppose i did something wrong. i'm not at all an expert, so if you explain something to me, please do it like in your tutorial :)
thanks in advance...

Maarten

ps: if there's anything else you need to know from me, please ask.

dmizer
November 29th, 2006, 10:13 PM
first, please post the line you've added to fstab
also ... post the output of smbtree

thank you :)

Titi
November 29th, 2006, 10:31 PM
ok, this is the fstab thingy:
//MAARTEN/Pbs2 /mnt/samba cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

smbtree:
WORKGROUP
\\MAARTEN blackbox
timeout connecting to 10.61.16.155:445
timeout connecting to 10.61.16.155:139
Error connecting to 10.61.16.155 (Operation already in progress)
cli_start_connection: failed to connect to MAARTEN<20> (10.61.16.155)
\\CRAPTOP
\\CRAPTOP\ADMIN$ IPC Service ()
\\CRAPTOP\IPC$ IPC Service ()
\\CRAPTOP\MyFiles
\\CRAPTOP\print$
SAL
MSHOME
timeout connecting to 10.91.16.57:445
timeout connecting to 10.91.16.57:139
Error connecting to 10.91.16.57 (Operation already in progress)
cli_start_connection: failed to connect to 10.91.16.57<20> (10.91.16.57)
timeout connecting to 10.91.16.57:445
timeout connecting to 10.91.16.57:139
Error connecting to 10.91.16.57 (Operation already in progress)
cli_start_connection: failed to connect to PIE<20> (10.91.16.57)


but it's different from the last time...
also, sometimes, in nautilus, 'MAARTEN' appears (which is the windows pc), but when i click it, they say: "couldn't display all the contents" or something like that.
i must note that there are several other computers in the network, with different workgroup names, i haven't configured those. so for now i don't ware about them. i'd just like to get on \\MAARTEN
\\craptop is the ubuntu laptop.
thanks for the quick reply :)

dmizer
November 30th, 2006, 10:25 AM
humm ... try this instead:

smbtree --authentication-file=/root/.smbcredentials

also post the error that follows when you do this:

sudo mount /mnt/samba

Titi
November 30th, 2006, 12:55 PM
maarten@craptop:~$ smbtree --authentication-file=/root/.smbcredentials
ERROR: Unable to open credentials file!
maarten@craptop:~$ sudo smbtree --authentication-file=/root/.smbcredentials
Password:
WORKGROUP
\\MAARTEN blackbox
timeout connecting to 10.61.16.155:445
timeout connecting to 10.61.16.155:139
Error connecting to 10.61.16.155 (Operation already in progress)
cli_start_connection: failed to connect to MAARTEN<20> (10.61.16.155)
\\CRAPTOP
\\CRAPTOP\ADMIN$ IPC Service ()
\\CRAPTOP\IPC$ IPC Service ()
\\CRAPTOP\MyFiles
\\CRAPTOP\print$
maarten@craptop:~$ sudo mount /mnt/samba
mount error 22 = Invalid argument
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

the mount took a long time again

dmizer
November 30th, 2006, 01:04 PM
have you installed and configured firestarter on your ubuntu machine? how about a windows firewall? (zone alarm, norton, xp's firewall)

you should be able to authenticate to the share with smbtree unless there is something blocking your access. so if you have firewalls turned on, try disabling them temporarily.

Titi
November 30th, 2006, 01:13 PM
ok, i don't have firestarter installed, and i turned off the xp firewall.
now i get:

maarten@craptop:~$ sudo smbtree --authentication-file=/root/.smbcredentials
WORKGROUP
\\MAARTEN blackbox
timeout connecting to 10.61.16.155:445
timeout connecting to 10.61.16.155:139
Error connecting to 10.61.16.155 (Operation already in progress)
cli_start_connection: failed to connect to MAARTEN<20> (10.61.16.155)
\\CRAPTOP
\\CRAPTOP\ADMIN$ IPC Service ()
\\CRAPTOP\IPC$ IPC Service ()
\\CRAPTOP\MyFiles
\\CRAPTOP\print$
MSHOME
timeout connecting to 10.91.16.57:445
timeout connecting to 10.91.16.57:139
Error connecting to 10.91.16.57 (Operation already in progress)
cli_start_connection: failed to connect to 10.91.16.57<20> (10.91.16.57)
timeout connecting to 10.91.16.57:445
timeout connecting to 10.91.16.57:139
Error connecting to 10.91.16.57 (Operation already in progress)
cli_start_connection: failed to connect to PIE<20> (10.91.16.57)

so this other computer with ip 10.91.16.57 is the one i'm not interested in. my windows pc is 10.61.16.155

dmizer
November 30th, 2006, 02:23 PM
humm ... well, the problem here is that your windows computer is not allowing the ubuntu machine to authenticate to it. the username and password are getting rejected by your windows computer.

it should have been necessary to add a new user to your windows machine, and the password for that new user is what you should be using in your smbcredentials file.

what ip address does the ubuntu computer have?

RAMDrive
November 30th, 2006, 05:38 PM
Thanks for the Howto.

I can manually mount my MS server 2003 share, however I receive an error "line 9 in /etc/fstab is bad"

This is what I have in the fstab;

//rootofevil/files$ /media/music cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

this is what I enter in term and it works;
sudo mount -t cifs //rootofevil/files$ /media/music -o credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=077

Thanks for any help.

dmizer
November 30th, 2006, 11:21 PM
hi!

you shouldn't be able to mount a share named with a "$". see this post: http://ubuntuforums.org/showpost.php?p=1758491&postcount=77

you said it works when you mount it manually, you might try putting quotes around file$ like so:
//rootofevil/"files$" /media/music ... but i'm not so sure that should work either.

addisor
December 7th, 2006, 01:20 PM
Hi I'm trying to access a shared folder on my wireless Window XP laptop and this is what happened. Any help please.

rob@rob-desktop:~$ sudo cp /etc/fstab /etc/fstab_old
rob@rob-desktop:~$ sudo nano /etc/fstab
rob@rob-desktop:~$ sudo mount -a
mount error: could not find target server. TCP name Laptop/SharedDocs not found
No ip address specified and hostname not found
rob@rob-desktop:~$ sudo nano /etc/fstab
rob@rob-desktop:~$ sudo mount -a
mount error: could not find target server. TCP name Laptop/SharedDocs not found
No ip address specified and hostname not found
rob@rob-desktop:~$

dmizer
December 7th, 2006, 01:23 PM
post the contents of your fstab file, and post the results of:

smbtree

addisor
December 7th, 2006, 01:37 PM
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
//Laptop/SharedDocs /media/sharename cifs guest,iocharset=utf8,file_mode=0777,d$



smbtree appears empty

dmizer
December 7th, 2006, 01:45 PM
humm ... how about the contents of /etc/nsswitch.conf

were there errors when you installed winbind?

have you rebooted since installing winbind?

addisor
December 7th, 2006, 01:51 PM
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat

hosts: files dns mdns wins
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

evince gnupg kino was kept back during winbird install, yep rebooted. please bare in mind i'm a linux newbiee and out of my depth a bit, so even if really simple i might not have done it. Tried a samba install before and that didn't work either.

dmizer
December 7th, 2006, 01:54 PM
try this ...

sudo aptitude update
sudo aptitude upgrade
sudo aptitude install winbind
then reboot and see if sambatree shows anything.

so far, it looks as if you've gotten everything done correctly.

addisor
December 7th, 2006, 02:01 PM
Yep done, reboot and smbtree empty!!! ah
Could it be something i haven't done to my XP laptop

dmizer
December 7th, 2006, 02:07 PM
only thing i can think of is firewall.

humm ... i thought netbios support was included in xp by default, but perhaps not. try this: http://www.chicagotech.net/netbios&wins.htm#Q:%20How%20can%20I%20install%20NetBEUI%20 on%20WinXP

regarding installing netbeui in windows. you might check your network settings first to see if netbeui is installed or not first though.

addisor
December 7th, 2006, 02:21 PM
Disabled the firewall, and got this in smbtree

STARHOUSE
\\ROB
\\ROB\BJC-7000 BJC-7000
\\ROB\BJC-7004 printer
\\ROB\ADMIN$ IPC Service ()
\\ROB\IPC$ IPC Service ()
\\ROB\MyFiles
\\ROB\print$

Don't want to leave off Firestarter for long.

addisor
December 7th, 2006, 02:47 PM
It now works one way a treat, only with firewall off!! can't get into desktop from laptop though. progress.

dmizer
December 7th, 2006, 04:08 PM
well ... if you have a router (which you should since you're able to connect two computers to eachother), your router should be configured as a firewall, and you shouldn't need firestarter anyway.

if you insist on running firestarter, you can open the samba port under the policy tab, or simply allow connections for everything in your local network (assuming you trust all computers connected to your network).

to configure your ubuntu computer to allow your windows machine to access it, you'll need to set up a samba server (first link in my sig).

addisor
December 7th, 2006, 04:46 PM
thanks all good here

eragorn
December 7th, 2006, 10:28 PM
dmizer,

I was wondering if you know what finally worked for narky, I have the ds-101j and have the exact same problem. I am able to mount and see the space available on my NAS but it is not listing the files.

Tried to figure out what exactly worked in the end but haven't been able to yet.

P.S. I am fairly new to linux but I'm loving it and will try anything!

dmizer
December 8th, 2006, 12:25 AM
dmizer,

I was wondering if you know what finally worked for narky, I have the ds-101j and have the exact same problem. I am able to mount and see the space available on my NAS but it is not listing the files.

Tried to figure out what exactly worked in the end but haven't been able to yet.

P.S. I am fairly new to linux but I'm loving it and will try anything!

i frankly have no idea. but since it was displaying the free space correctly, i suspect that it was a permissions problem. you might try changing the mounted folder permissions to 777 on ubuntu. for example:

sudo chmod 777 /mount/sharename
where "sharename" is the name you've given the folder where you want to mount the shares.

also, it would seem that narky was successful in mounting it manually rather than through fstab, so i suggest working that way first before you attempt to enter the mount in fstab.

beyond that, everything we discussed about making it work appears in this thread.

you might also consider sending narky a pm, because there may have been something done which was not posted here.

eragorn
December 8th, 2006, 02:44 AM
appreciate the reply, gave that a shot and to no avail. I have been mounting it manually it seems to be easier for testing :). I did pm narky but he was last active 4 weeks ago, any chance you have his email address?

thanks again for the info!

eragorn
December 8th, 2006, 03:01 AM
appreciate the reply, gave that a shot and to no avail. I have been mounting it manually it seems to be easier for testing :). I did pm narky but he was last active 4 weeks ago, any chance you have his email address?

thanks again for the info!



WOW! It works, I guess it took a few minutes to populate the folder.....I don't know. All I do know is that it's finally working.

Thanks to all your knowledge dizmer hope I can repay some how some day :mrgreen:

Too bad theres no way to send a beer across the net yet!

Cheers

dmizer
December 8th, 2006, 04:51 AM
lol ... you know, that's the EXACT same reply narky had. one post it didn't work and was ready to give up. and the next ... shezam ... everything's hunky dory. you find narky's magic words? lol

perhaps this is because the first time the mount is found, it takes time to cashe everything. after that, it should respond much more quickly.

no worries about the beer. i work for a wine import company ;)

phazon.
December 9th, 2006, 08:22 PM
OK, so I've got the same issue as eragorn and narky, and it is driving me insane! I've run through everything as described, try and list the mounted folder and get nothing. If I run exactly the same mount command but as smbfs, it lists fine, but doesn't work in nautilus (see here (http://www.ubuntuforums.org/showthread.php?t=311014) for description of that one).

Smbtree returns nothing, just blinks for a few seconds and then bcak to the command line.

It seems from the last few posts that no-one knows how to solve it, it just suddenly starts working. If anyone does have any ideas, please post it because I've been trying to get this working for a while now and I'm going to have to go back to Windows soon if I can't get it going.

BTW, I'm trying to connect to a Synology 106e NAS, similar to narky I think.

eragorn
December 10th, 2006, 02:53 AM
lol ... you know, that's the EXACT same reply narky had. one post it didn't work and was ready to give up. and the next ... shezam ... everything's hunky dory. you find narky's magic words? lol

perhaps this is because the first time the mount is found, it takes time to cashe everything. after that, it should respond much more quickly.

no worries about the beer. i work for a wine import company ;)

It ended up being folder permissions for me! Doh....Other than that I had to mount using cifs and I have not added it to fstab yet. I only mounted manually.

I believe the 106e is running a linux kernal already so maybe you need to follow easier steps for mounting. I can not help you with this but maybe dmizer. Also check this out http://www.synology.com/enu/forum/viewtopic.php?p=1565&sid=18fa769a52953f8af6402f36419dad98

its from the synology forum. Good luck!

If that doesn't work I think you can install alternative firmware since your NAS is a power pc (faster than my 101j) :)

dmizer
December 10th, 2006, 10:28 AM
Smbtree returns nothing, just blinks for a few seconds and then bcak to the command line.

okay ... let's concentrate on this issue, because if we can get the name to resolve, then you can get the mount to work properly. there are several possible causes for this:
1) firestarter blocks the samba port by default, so you'll have to open it if you've installed the firestarter iptables frontend.

2) something was not configured correctly with wins or the winbind daemon isn't running. in this case, simply review the first few steps in the howto.

can you ping the nas by name? can you ping the nas by ip? have you attempted to mount the nas by ip instead of by name?

btw, the link that eragorn gave outlines the exact same process for mounting the nas as i gave here, except that it's tailored for fedora core instead of ubuntu.

phazon.
December 10th, 2006, 11:13 AM
Guys

Thanks for your responses. Dmizer, on your two points

1) I don't have Firestarter installed. I will do that, but I want to get this working before adding anything else to confuse the issue.
2) This is an all linux issue, no Windows, so I'm presuming I don't need WINS...? But regardless, yes I can ping the NAS by name and IP. I'm generally only trying to mount by IP anyway (fixed lease).

This mounts fine via smbfs, but then stops working via nautilus.

This is the output from the ping and smbtree;

nick@home-desktop:~$ ping NJW_Diskstation
PING NJW_Diskstation (192.168.0.5) 56(84) bytes of data.
64 bytes from 192.168.0.5: icmp_seq=1 ttl=64 time=0.220 ms
64 bytes from 192.168.0.5: icmp_seq=2 ttl=64 time=0.181 ms
64 bytes from 192.168.0.5: icmp_seq=3 ttl=64 time=0.179 ms
64 bytes from 192.168.0.5: icmp_seq=4 ttl=64 time=0.181 ms
64 bytes from 192.168.0.5: icmp_seq=5 ttl=64 time=0.169 ms
64 bytes from 192.168.0.5: icmp_seq=6 ttl=64 time=0.152 ms
64 bytes from 192.168.0.5: icmp_seq=7 ttl=64 time=0.181 ms

--- NJW_Diskstation ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6023ms
rtt min/avg/max/mdev = 0.152/0.180/0.220/0.022 ms
nick@home-desktop:~$ smbtree NJW_Diskstation
Password:
nick@home-desktop:


Thanks for your help.

dmizer
December 10th, 2006, 11:55 AM
okay ... if there are no windows machines in your network then that may be part of your problem, as there is no domain for the nas and your ubuntu box to join.

although there are no windows machines in your network, you are using a windows protocol to connect to your nas device, so you have to play by windows networking rules.

try this:

sudo aptitude install samba
sudo /etc/init.d/samba stop
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.template
sudo touch /etc/samba/smb.conf
sudo nano /etc/samba/smb.conf
now, in this file, you'll have to enter the following data. but keep in mind you're going to have to change the specifics to meet your situation's needs:

[global]
; General server settings
netbios name = YOUR_HOSTNAME
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
now ... be sure to change "YOUR_HOSTNAME" to a name unique to your ubuntu computer, and change YOUR_WORKGROUP to a workgroup name common to both your ubuntu computer and your nas device (most likely mshome).

save the file and exit.

now, don't forget to modify the permissions on your mount folder. for example from my howto:

sudo chmod 777 /media/sharename
and finally ... restart the samba daemon:

sudo /etc/init.d/samba start

then see if you can mount again.

phazon.
December 10th, 2006, 01:06 PM
OK done that, rebooted, no joy. This is my smb.conf;

nick@home-desktop:~$ more /etc/samba/smb.conf
[global]
; General server settings
netbios name = home-desktop
workgroup = intl
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_S
NDBUF=8192
nick@home-desktop:~$

The reason the domain is intl is cos that is the domain on my work laptop.

Still nothing from smbtree...

dmizer
December 10th, 2006, 01:30 PM
well, according to what i've seen with eragorn and narky, your nas device isn't going to show up in smbtree anyway. but you still should be able to mount the device by either netbios name or ip address.

what directory are you trying to mount the shares to? and have you changed the permissions yet?

phazon.
December 10th, 2006, 08:32 PM
The share on the NAS is MyDocs. I've changed permissions on the directory on the ubuntu box (/home/nick/nas) to 0777 before trying to do the mount, that's right I think?

OK now this is weird... I've been out this afternoon for a few hours, and before I went out I rebooted and tried to 'ls /home/nick/nas' with the usual result. Now having come home, with no other changes and in the same terminal window, I 'ls /home/nick/nas' and it's working fine! It's like it needs time to register or something.

Rebooted and now it doesn't work again. I guess if I wait for a few hours it will work - but why doesn't work first time?!

dmizer
December 11th, 2006, 12:05 AM
The share on the NAS is MyDocs. I've changed permissions on the directory on the ubuntu box (/home/nick/nas) to 0777 before trying to do the mount, that's right I think?
no, you should only change permissions on the folder once. you don't have to change the permissions every time you mount the device, only the first time when you create the folder.

i don't know how big your storage unit is, but the more space you have, the longer it will take to cashe initially. but ... the more you use it, the faster it will get. and it shouldn't be long (two or three mounts with some use) before you will have instant access.

phazon.
December 11th, 2006, 12:33 AM
It's working again now - it seems to just take time (1-2 hours) to work after mounting. So the situation is -

1) mount as SMBFS, works immediately in terminal, but doesn't work in nautilus or from any GUI app (ie Songbird, VMware)
2) mount as CIFS, works fine in all applications but not for an hour or two after mounting/booting. Not ideal...

The NAS is 320Gb, so it's fairly large, but the fact I can access it immediately from the command line via smbfs, unless cifs has a totally different way of caching... Dunno, seems very weird.

Dmizer, really appreciate your help with this. This thread shows just how helpful a community like this can be.

Now if I could just get it working perfectly....

dmizer
December 11th, 2006, 01:34 AM
well, part of the reason smbfs isn't working in your other apps is because it doesn't cashe at all. it's also why you're getting instant access.

that said, it should not take over 5 minutes to cashe a drive of that size with cifs, so there is still something wrong. lots of very large files 700meg + on that drive? i'm going to take a closer look at some of the settings for cifs and see if i can come up with a solution for ya.

phazon.
December 11th, 2006, 10:02 AM
well, part of the reason smbfs isn't working in your other apps is because it doesn't cashe at all. it's also why you're getting instant access.

that said, it should not take over 5 minutes to cashe a drive of that size with cifs, so there is still something wrong. lots of very large files 700meg + on that drive? i'm going to take a closer look at some of the settings for cifs and see if i can come up with a solution for ya.

OK I see, if smbfs doesn't do any caching then that makes a bit more sense then. I'll have to read up a bit more on that and cifs so I understand a bit more about how they work.

There are a fair few large files on the drive I would think. I guess it's got about 200Gb on it in total.

If you can find anything further I'd really appreciate it. Thanks again.

dmizer
December 14th, 2006, 12:18 AM
okay ... try adding the option "directio" in your mount options. i'll use my example from the howto:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,directio ,iocharset=utf8,file_mode=0777,dir_mode=0777
see if that doesn't get you faster response times. i think part of the reason is you have a huge amount of data on that drive. directio will turn cashing off so you should get better mount response times. since cifs is faster, you should also still be able to use other applications like nautilus and songbird (vmware might be pushing things).

phazon.
December 15th, 2006, 12:42 AM
Seems to be the same strangely, possibly it's a bit quicker but we're still talking an hour or so. I will have a further play with it in the morning.

Thanks for the continued efforts.

dmizer
December 15th, 2006, 01:55 AM
no worries, but i'm starting to reach now.

how about some information about your network setup?
router make and model? are you wireless, and if so ... what card and driver are you using?

try this ... shut the entire network down. turn everything off including your router and modem. power on in this order:
modem first ... wait for sync.
router next ... again, wait for sync.
your nas device
your ubuntu box.

retry the connection and see if you get improved results.

dmizer
December 15th, 2006, 02:16 AM
here's something else to try for possibly getting more information. mount with the verbose option and see what the output is of the mount. like so:

sudo mount -t cifs //netbiosname/sharename /media/sharename --verbose -o username=winusername,password=winpassword,directio ,iocharset=utf8,file_mode=0777,dir_mode=0777

phazon.
December 15th, 2006, 10:17 AM
OK I'll try that last one and the reboot this morning.

As for network, I've got a Netgear DG834G router/modem. That is connected via Netgear XE103 powerline network devices to a Netgear gigabit 8-port switch. Plugged into the switch are the Synology NAS and the Ubuntu box, via a Netgear gigebit ethernet card.

phazon.
December 15th, 2006, 02:51 PM
here's something else to try for possibly getting more information. mount with the verbose option and see what the output is of the mount. like so:

sudo mount -t cifs //netbiosname/sharename /media/sharename --verbose -o username=winusername,password=winpassword,directio ,iocharset=utf8,file_mode=0777,dir_mode=0777

Here's the output from the verbose mode


nick@home-desktop:~$ sudo mount -t cifs //192.168.0.5/MyDocs /home/nick/nas --verbose -o username=xyz,password=1mogen,directio,iocharset=ut f8,file_mode=0777,dir_mode=0777
parsing options: rw,username=admin,password=123,directio,iocharset= utf8,file_mode=0777,dir_mode=0777

mount.cifs kernel mount options unc=//192.168.0.5\MyDocs,ip=192.168.0.5,ver=1,rw,usernam e=admin,password=1mogen,directio,iocharset=utf8,fi le_mode=0777,dir_mode=0777
nick@home-desktop:~$ ls nas
nick@home-desktop:~$


As you can see, 'ls nas' retrieves nothing. I'm timing it and will keep trying to see how long it takes to come back with something.

To be honest I guess it's working as it's supposed to, it's just the implementation of cifs takes a while to deal with the amount of data involved. I'm surprised to the directio option doesn't solve it though.

When this is done I'll try rebooting the network.

dmizer
December 18th, 2006, 02:43 PM
well according to the verbose mode, the directio was actually sent. the only thing i can think of now would be network related. you do have an enormous amount of information on that drive, but it still shouldn't take more than 15 minutes to complete the mount.

what was the result of your network reboot?

if that was unsuccessful, how about attempting to connect directly to it with a crossover cable?

pavel_kbc
December 18th, 2006, 05:03 PM
root@r00t-suck-on-that:/home/r00t-fck# smbtree
Password:
WORKGROUP
\\XYZ-8FB08C0E596
cli_start_connection: failed to connect to XYZ-8FB08C0E596<20> (0.0.0.0)
\\XP
cli_start_connection: failed to connect to XP<20> (0.0.0.0)
\\SUDHA-16B0C4B5D
\\RUMEL01
cli_start_connection: failed to connect to RUMEL01<20> (0.0.0.0)
\\RAB-E103633FC51
cli_start_connection: failed to connect to RAB-E103633FC51<20> (0.0.0.0)
\\PUSPO
\\NIPUN
\\NIPUN\L$ Default share
\\NIPUN\J$ Default share
\\NIPUN\Printer Canon S200SP
\\NIPUN\C$ Default share
\\NIPUN\ADMIN$ Remote Admin
\\NIPUN\F$ Default share
\\NIPUN\M$ Default share
\\NIPUN\G$ Default share
\\NIPUN\K$ Default share
\\NIPUN\I$ Default share
\\NIPUN\SharedDocs
\\NIPUN\print$ Printer Drivers
\\NIPUN\D$ Default share
\\NIPUN\IPC$ Remote IPC
\\NIPUN\E$ Default share
\\MERAJ
cli_start_connection: failed to connect to MERAJ<20> (0.0.0.0)
\\LUCKY-9EAC2AD7E
cli_start_connection: failed to connect to LUCKY-9EAC2AD7E<20> (0.0.0.0)
\\KHADEM7-577EA85
cli_start_connection: failed to connect to KHADEM7-577EA85<20> (0.0.0.0)
\\ICED Mudvayne's PC
\\HELLO-841DE0ECD
cli_start_connection: failed to connect to HELLO-841DE0ECD<20> (0.0.0.0)
\\FAHMID-C6A009D1
cli_start_connection: failed to connect to FAHMID-C6A009D1<20> (0.0.0.0)
\\DK-R0BJCB4G659X
\\CORPORAT-444C9B
cli_start_connection: failed to connect to CORPORAT-444C9B<20> (0.0.0.0)
\\CELL-XQC6XYS624
cli_start_connection: failed to connect to CELL-XQC6XYS624<20> (0.0.0.0)
\\BRIGHT-1A0846E4
cli_start_connection: failed to connect to BRIGHT-1A0846E4<20> (0.0.0.0)
\\ARAFIN
timeout connecting to 192.168.8.60:445
timeout connecting to 192.168.8.60:139
Error connecting to 192.168.8.60 (Operation already in progress)
cli_start_connection: failed to connect to ARAFIN<20> (192.168.8.60)
\\ALANGIR-89DF279
cli_start_connection: failed to connect to ALANGIR-89DF279<20> (0.0.0.0)
MULTI
\\PC7
cli_start_connection: failed to connect to PC7<20> (0.0.0.0)
\\PC5
cli_start_connection: failed to connect to PC5<20> (0.0.0.0)
\\PC4
cli_start_connection: failed to connect to PC4<20> (0.0.0.0)
\\PC3
cli_start_connection: failed to connect to PC3<20> (0.0.0.0)
\\PC2
cli_start_connection: failed to connect to PC2<20> (0.0.0.0)
\\PC1
cli_start_connection: failed to connect to PC1<20> (0.0.0.0)
\\MSERVER
\\MSERVER\700
\\MSERVER\C$ Default share
\\MSERVER\ADMIN$ Remote Admin
\\MSERVER\F$ Default share
\\MSERVER\print$ Printer Drivers
\\MSERVER\D$ Default share
\\MSERVER\IPC$ Remote IPC
\\MSERVER\EPSONLQ-300 EPSON LQ-300+ ESC/P 2
\\MSERVER\E$ Default share
MSHOME
\\R00T-SUCK-ON-THA r00t-suck-on-that server (Samba, Ubuntu)
\\R00T-SUCK-ON-THA\ADMIN$ IPC Service (r00t-suck-on-that server (Samba, Ubuntu))
\\R00T-SUCK-ON-THA\IPC$ IPC Service (r00t-suck-on-that server (Samba, Ubuntu))
\\R00T-SUCK-ON-THA\print$ Printer Drivers
\\EXCELSIOR
timeout connecting to 192.168.8.15:445
timeout connecting to 192.168.8.15:139
Error connecting to 192.168.8.15 (Operation already in progress)
cli_start_connection: failed to connect to EXCELSIOR<20> (192.168.8.15)
MONTESORY
MICROSOFTBD
\\GOOGLECAFP
HB
\\BANNA


any idea? i getting error
cli_start_connection: failed to connect to "NETBIOS"

dmizer
December 20th, 2006, 02:49 AM
hello pavel_kbc, sorry for my delay. i've been quite busy at work.

looks like you have a fair number of computers in your network, as well as several domains. which one of those multitude are you trying to connect to?

Erlander
December 28th, 2006, 12:45 PM
Thank you for this guide.

After editing fstab and using the mount command i get the following:


rob@ubuntu:~$ sudo nano /etc/fstab
rob@ubuntu:~$ sudo mount -a
mount: mount point cifs does not exist
rob@ubuntu:~$

My fsaab is:
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/hda1
UUID=2bf4580d-fb6a-4f9c-ac34-4e09c86370a0 / ext3 defaults,errors=remount-ro 0 1
# /dev/hda3
UUID=caa16d69-0146-4972-91e9-53d9a27f78cb /var xfs defaults 0 2
# /dev/hda2
UUID=d9143452-7712-41dd-a14c-ef9495825d72 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
//robs./TVCapture/media/sharename cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0


The network is as follows:

I have a pc with Edgy installed named Ubuntu and a second pc with Win XP home named robs and a shared folder with the share name TVCapture they are connected via a router and both can access the internet.

The XP machine has a Zone alarm firewall that is configured to put the Ubuntu machine in the trusted zone. Turning off Zonealarm has the same result to sudo mount -a

I have some doubt as to whether the XP machuine is robs. or robs without the "." so I have tried both with the same result. I thought it was robs which is what is in Computer Description but after Full computer name: it has the "."

Another part of the confusion is what I get from smbtree:

rob@ubuntu:~$ smbtree
Password:
ERLANDER
\\UBUNTU Samba 3.0.22
\\UBUNTU\BJC-8200 Canon i865 Local
\\UBUNTU\Canoni865 Canon_i865
\\UBUNTU\ADMIN$ IPC Service (Samba 3.0.22)
\\UBUNTU\IPC$ IPC Service (Samba 3.0.22)
\\UBUNTU\rob
\\UBUNTU\print$
\\UBUNTU\homes
\\ROBS Robs
\\ROBS\BJC-8200 Canon i865 Local
\\ROBS\Canoni865 Canon_i865
\\ROBS\ADMIN$ IPC Service (Samba 3.0.22)
\\ROBS\IPC$ IPC Service (Samba 3.0.22)
\\ROBS\rob
\\ROBS\print$
\\ROBS\homes
rob@ubuntu:~$

What is showing up under ROBS are the shared files and devices on the Ubuntu machine as shown on the XP but no XP files or devices!!!!](*,)

I can copy files from the xp machine to the Ubuntu as the XP machine sees the Ubuntu but the Ubuntu cannot see into the XP but will ping it!!!!

Any assistance will be gratefully accepted.

Rob

dmizer
December 28th, 2006, 01:13 PM
okay ... well, there are several issues here. first of all, it doesn't look like you have xp set up to share the tvcapture folder. you'll have to right click on it and select properties and set the share permissions correctly.

second, robs does not have a period after it.

third, there needs to be a space between the server part of the fstab mount line, and the client side of the mount line. or in other words like so:
//robs/tvcapture /media/sharename

fourth, did you actually create a folder in /media named "sharename"? my media folder looks like this:

/media$ ls
cdrom cdrom0 floppy floppy0 server tokkyu
where both "server" and "tokkyu" are other computers that i mount shares into. so when the i see the folder on my desktop, it is named something relevant to my server so, at a glance, i can recognize which folder belongs to which machine.

but really, the main part of the issue here is that windows does not appear to be set up correctly. check networking to make sure that file and printer sharing is enabled.

zasf
December 28th, 2006, 05:01 PM
dmizer, why should we use cifs instead of old plain smbfs??

I actually don't know the difference between the two, but with smbfs (same commands you wrote in the howto) I get full access (read and write) while with cifs I can't write to the shared folder. The server is a win XP machine.

Thanks,

dmizer
December 28th, 2006, 05:13 PM
multiple reasons which i tried to list on the first page.

first and foremost, cifs is faster and more stable (network traffic wise).
second, cifs will be replacing smbfs soon, so eventually we won't have a choice.
third, (and most importantly for me) i could make cifs handle japanese file names in mounted shares.

cifs is a better way of dealing with mounting samba shares. if you do not get write access with cifs, then there's probably something we can do to correct that either by changing the permissions on the mounted folder, or by taking a look at your mount commands. but if it's working satisfactorally for ya, there's no real immediate need for a switch.

smbfs does not meet my needs, but that doesn't mean smbfs can't meet yours.

Erlander
December 29th, 2006, 03:22 AM
Dmizer,

Thank you for your advice.

1. Sharing on the XP machine. I suspect the problem here is in Win XP Home. I have several folders and a printer shared. We also have a laptop running Win XP Pro that is also on the network when it is turned on. It can browse the shared files on the Win XP Home machine and use the printer.

From the Ubuntu machine I can browse the laptops shared files but cannot browse the Win XP Home machine. The XP Home machine does have Zonealarm installed but even when I turn it off Ubuntu still cannot access the shared folders. I have read on the Microsoft Knowledge base that Home has a cutdown version of file and printer sharing. I know there are people on these forums who have networked a XP Home machine with a Ubuntu and would dearly love to know how.

2. Have removed the period.

3. I have inserted the space in the fstab mount line.

4. Very silly of me. I hadn't created that folder. Have amended fstab to point it to a folder that does exist.

The mount command now gives this error:

rob@ubuntu:~$ sudo mount -a
Password:
retrying with upper case share name
mount error 6 = No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
rob@ubuntu:~$

I need to stay with ******* for a while due to the investment I have in software particularly in video, image & sound editing and until I understand Ubuntu better. If necessary I will buy XP Pro to overcome this problem but would rather not.

Thank you.

Rob

dmizer
December 29th, 2006, 03:57 AM
for winxp home, try this guide ...
here: http://www.practicallynetworked.com/sharing/xp/addxp.htm
and here: http://www.practicallynetworked.com/sharing/xp/filesharing.htm

zasf
December 29th, 2006, 10:09 AM
multiple reasons which i tried to list on the first page.

first and foremost, cifs is faster and more stable (network traffic wise).
second, cifs will be replacing smbfs soon, so eventually we won't have a choice.
third, (and most importantly for me) i could make cifs handle japanese file names in mounted shares.

ok, thanks for the explanation.


smbfs does not meet my needs, but that doesn't mean smbfs can't meet yours.

So far I could not setup cifs to meet my needs, if I can solve this I would gladly switch


cifs is a better way of dealing with mounting samba shares. if you do not get write access with cifs, then there's probably something we can do to correct that either by changing the permissions on the mounted folder, or by taking a look at your mount commands. but if it's working satisfactorally for ya, there's no real immediate need for a switch.

I explain my setup so that you can help troubleshoot the problem that normal users don't get write access to the share.

The server "Z2" is a winxp pro machine, with a shared folder named "condi" in read/write access with no password (I just use it to pass stuff from one comp to the other).


matteo@burnt:~$ smbtree
Password:
ZCASA
\\Z2
\\Z2\C$ Condivisione predefinita
\\Z2\ADMIN$ Amministrazione remota
\\Z2\F
\\Z2\iso
\\Z2\Stampante Epson Stylus COLOR 740 ESC/P
\\Z2\Zip
\\Z2\print$ Driver della stampante
\\Z2\D$ Condivisione predefinita
\\Z2\IPC$ IPC remoto
\\Z2\condi
\\BURNT ubuntu
\\BURNT\ADMIN$ IPC Service (ubuntu)
\\BURNT\IPC$ IPC Service (ubuntu)
\\BURNT\share shared stuff
MSHOME


matteo@burnt:~$ ping z2
PING z2 (192.168.1.2) 56(84) bytes of data.
64 bytes from 192.168.1.2: icmp_seq=1 ttl=128 time=0.262 ms
64 bytes from 192.168.1.2: icmp_seq=2 ttl=128 time=0.249 ms

--- z2 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.249/0.255/0.262/0.017 ms

matteo@burnt:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda3 -- converted during upgrade to edgy
UUID=853a9cf6-d4c2-474f-8384-0b33ae57923d / ext3 defaults,errors=remount-ro 0 1
# /dev/sda7 -- converted during upgrade to edgy
UUID=df93ad94-ef99-4b4a-96c2-e752d2b42f1d /media/linux2 ext3 defaults 0 2
# /dev/sda6 -- converted during upgrade to edgy
UUID=D48C60BD8C609C2C /media/secondo ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda1 -- converted during upgrade to edgy
UUID=9EA03185A03164C5 /media/windows ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sda5 -- converted during upgrade to edgy
UUID=a914c6c8-9d28-47e3-b45a-f0cdba1e55a7 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
#//192.168.1.2/condi /media/condisuz2 smbfs defaults,username=defaults,password=defaults,gid=4 6 0 0
#//netbiosname/sharename /media/sharename cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
//z2/condi /media/condisuz2 cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

matteo@burnt:~$ vdir /media/condisuz2/
total 5.7G
-rwxrwxrwx 1 root root 5.7G 2006-10-22 12:53 backup-burnt-2006-10-22_11-40.tgz
drwxrwxrwx 1 root root 4.0K 2006-12-02 16:07 cs
-rwxrwxrwx 1 root root 35 2006-09-24 14:03 prova2.txt
-rwxrwxrwx 1 root root 156 2006-09-24 14:06 prova.tar.bz2
-rwxrwxrwx 1 root root 29 2006-09-24 14:00 prova.txt
matteo@burnt:~$ cp /home/matteo/Desktop/ValueatRisk.doc /media/condisuz2/
matteo@burnt:~$ rm /media/condisuz2/ValueatRisk.doc
matteo@burnt:~$ vdir /media/condisuz2/
total 5.7G
-rwxrwxrwx 1 root root 5.7G 2006-10-22 12:53 backup-burnt-2006-10-22_11-40.tgz
drwxrwxrwx 1 root root 4.0K 2006-12-02 16:07 cs
-rwxrwxrwx 1 root root 35 2006-09-24 14:03 prova2.txt
-rwxrwxrwx 1 root root 156 2006-09-24 14:06 prova.tar.bz2
-rwxrwxrwx 1 root root 29 2006-09-24 14:00 prova.txt


hum.. ok now it works, this is strange. You know it is very good to post on the forums because when you're trying to solve a problem, very soon you enter a "frenzy" state where you do "trial and error" and you stop thinking.. now everything is clear, cifs works. Ok, I'll keep posting if stops workings.

Thanks for the help

dmizer
December 29th, 2006, 10:59 AM
lol ... good to see you got it sorted.

Erlander
December 29th, 2006, 11:58 AM
Suddenly Ive got it working.

Problem is I'm not sure what did it.

Most likely was re-installing winbind. I had been reading lots of other threads and came across one that said you had to have winbind installed. Wasn't sure if I had it so went to install. Synaptic said it would re-install so I said Yes.

Then tried sudo mount -a and the icon appeared on the desktop. Nautilus also can now find the XP Home machine and browse its shared files too.

Dmizer, thank you for an excellent "How To" and for your patience with new users like me.

Rob

dmizer
December 29th, 2006, 04:37 PM
it's no problem at all rob, glad to see you got it sorted too. winbind installation is defiantly a part of my howto, but i can see how it might be easily overlooked.

enjoy your newfound networking setup :)

borka
December 31st, 2006, 03:09 PM
Hello dmizer.
I'm trying to follow your guide, but I'm not able to get it working, or well, I do get it to work.

But I'm not able to mount my NAS thru CIFS, I get the error: "mount error 5 = In/ut-fel
Refer to the mount.cifs(8 ) manual page (e.g.man mount.cifs)"
(Note: In/ut-fel is probebly "Input/output error" in english)

The command I'm using is: x@Ricewind:/media$ sudo mount -t cifs //LAN-HDD/Williams/ /media/LAN-HDD/ -o guest,iocharset=utf8,file_mode=0777,dir_mode=0777

I have tried to take away the "/" from the end of the locationspaths, e.g //LAN-HDD/Williams
But then I get: mount error 20 = Inte en katalog (not a directory)
Refer to the mount.cifs(8 ) manual page (e.g.man mount.cifs)

Could it be that my NAS aint supporting CIFS? it mounts fine when using smbfs, but then I'm not able to access files with swedish characters in its name, therefor I would like to see if cifs can do this better.. Ooh, and I didnt find anything helpful in "man mount.cifs" either

(note: If I use nautilus Connect to Server, and connect to the NAS the swedish characters displays fine, but then I cant use rythmbox or other applications to access it :( )

//Borka

dmizer
January 2nd, 2007, 05:22 PM
NAS devices are the bane of this thread's existence.

let's start simple, and move from there ... what character encoding is the file names written in?

also, post the output of smbtree

p.s. happy new year everyone.

Trekko
January 2nd, 2007, 11:08 PM
First of all, SuperThanx for an great and esy understanding howto for all us who are new to linux. =D>
I have read thru all the 13 pages and tried some of the things but i cant get it to work.

I write down the outputs of what i belive tells u the most.

I have an error from mount -a "line 9 in /etc/fstab is bad"

This is my line in fstab
//banancompaq/ftp /bananftp cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

I think I have tried everything but the right ting:) ](*,) even installed winbind :)



output from smbtree --authentication-file=/root/.smbcredentials

BANANREPUBLIKEN
\\BANANSERVER
\\BANANSERVER\C$ Default share
\\BANANSERVER\ADMIN$ Remote Admin
\\BANANSERVER\DVD Dvd i väggen
\\BANANSERVER\cd
\\BANANSERVER\Virtualdvd
\\BANANSERVER\D$ Default share
\\BANANSERVER\IPC$ Remote IPC
\\BANANCOMPAQ
\\BANANCOMPAQ\C$ Default share
\\BANANCOMPAQ\ADMIN$ Remote Admin
\\BANANCOMPAQ\ftp
\\BANANCOMPAQ\D$ Default share
\\BANANCOMPAQ\IPC$ Remote IPC
\\BANANCOMPAQ\300g
\\BANANCOMPAQ\scsi2 17gb
\\BANANCOMPAQ\E$ Default share


and this works like a charm.

root@bananubuntu:~# mount -t cifs //banancompaq/ftp /bananftp -o username=administrator,password=********,iocharset =utf8,file_mode=0777,dir_mode=0777
root@bananubuntu:~# ls /bananftp/
apps ezy Film KARTOR MP3 osedd film RAR sigge spel tmp
root@bananubuntu:~# umount /bananftp




My second problem is that i am doing this on a laptop with wireless, and the wlan is'nt started untill i have logged in and provided password for the keyring.
I assume that this can be resolved by putting in mount -a in some script executed after the wlan is started.

dmizer
January 3rd, 2007, 02:20 AM
well, everything seems to be in order, and i don't see anything wrong with your fstab line. the only difference i see between your manual mount and your fstab mount lines is that you are not using the smbcredentials file.

when you created the credentials file, did you create it with nano? also, you might want to check your credentials file for mistakes.

also try completely removing the credentials part of the line and replace it with your real username and password like so:

//banancompaq/ftp /bananftp cifs username=administrator,password=********,iocharset =utf8,file_mode=0777,dir_ mode=0777 0 0

and don't worry about the wireless not becoming active until after you log in. once your connection becomes active, fstab should detect the share and auto mount it for you. that is, of course, once we get fstab working right for you.

if the above line does not correct your problem, please post the entire contents of your fstab file.

borka
January 3rd, 2007, 12:58 PM
Hehe, I can se that..

Um, good question about the character encoding, but it aint utf8 thats for sure, probebly windows counterpart to ISO-8859-1 (Latin 1 (the iocharset=iso8859-1 does not do the job in/with smbfs, so I think I need something ells))

The smbtree looks like this, there is some more computers in the network, but I left them out.

x@Ricewind:/media$ smbtree
Password:
BALLAD
\\RICEWIND Ricewind server (Samba, Ubuntu)
\\RICEWIND\ADMIN$ IPC Service (Ricewind server (Samba, Ubuntu))
\\RICEWIND\IPC$ IPC Service (Ricewind server (Samba, Ubuntu))
\\RICEWIND\william
\\RICEWIND\print$ Printer Drivers
\\LAN-HDD
\\LAN-HDD\IPC$
\\LAN-HDD\Williams
\\LAN-HDD\PUBLIC

One strange thing thou is that I can mount the other computers shares using cifs just fine.
It's just when I'm trying to use it on the NAS device (the one labeld LAN-HDD, an ARGOSY HD363N)

Thanks for taking time with all problems that comes up here in the thread :)

dmizer
January 3rd, 2007, 03:40 PM
well, according to prism, your nas device supports cifs: http://www.psism.com/hd363n.htm

can you ping your NAS device by netbios name?

ping LAN-HDD
if not, you'll have to revisit the section on winbind.

otherwise, you might look through your NAS web admin pages to see if there's a setting for cifs, or to see if something else might be amis.

also, try removing the utf8 option completely. iso encodings won't work with cifs, only utf character sets. however, utf8 SHOULD be capable of reading swedish, so i doubt that's the problem but it can't hurt to eliminate uncertainties.

borka
January 3rd, 2007, 05:04 PM
It pings alright:


x@Ricewind:/media$ ping LAN-HDD
PING LAN-HDD (192.168.1.69) 56(84) bytes of data.
64 bytes from 192.168.1.69: icmp_seq=1 ttl=32 time=0.234 ms
64 bytes from 192.168.1.69: icmp_seq=2 ttl=32 time=0.208 ms
64 bytes from 192.168.1.69: icmp_seq=3 ttl=32 time=0.229 ms
64 bytes from 192.168.1.69: icmp_seq=4 ttl=32 time=0.397 ms
64 bytes from 192.168.1.69: icmp_seq=5 ttl=32 time=0.212 ms
64 bytes from 192.168.1.69: icmp_seq=6 ttl=32 time=0.202 ms
64 bytes from 192.168.1.69: icmp_seq=7 ttl=32 time=0.223 ms

[2]+ Stopped ping LAN-HDD


And there is nearly no settings at all in the NAS Admin pages :/ only for renaming folders, creating new ones, and put passwords on to them.
The only tink I see on the admin pages is the dhcp options, now it stands as a dhcp client, but it can also become an dhcp server,
but as my router gives "static" adresses thru dhcp that shuld not be a problem, right?

And about the iso encodings, it does not help removing them, it seems like it just ignores them anyway, but I get the same error message without them.
The "mount error 20 = not a directory" one, I'v tried to create new folders with different name, but those wont mount either.

but the strangest thing, that I can se is that it mounts just fine using smbfs (well, not the character encoding, but it does mount), with the command.


mount -t smbfs -o guest //LAN-HDD/Williams /media/LAN-HDD

but the command


mount -t cifs -o guest //LAN-HDD/Williams /media/LAN-HDD
or
mount.cifs //LAN-HDD/Williams /media/LAN-HDD -o guest

gives the mount error 20 message.
And the exact same mount cifs command can mount a share on for example my fathers computer without any problem at all.

So the mounting is the big problem for now, atleast for me, but I also think it's strange that I don't get the right characters when I mount thru the mount -t smb command,
when nautilus gui tool does it alright (wonder how they does it).

Ooh, and it seems that the right iso encoding shuld be iso8859-15 instead of iso8859-1 but using that in the smbfs mount didnt do anyting at all.
And yes, utf8 does indeed have the swedish characters åäö, but it seems it doesnt work in quite the same way? 'course my whole ubuntu system runs on utf8,
and everyting I create here looks alright :)

Trekko
January 3rd, 2007, 05:06 PM
I created the smbcredentialsfile with nano, even recreated it.
Shuldn't it be ok since smbtree --authentication-file=/root/.smbcredentials works?

The fstab line with username and password in it doesent work for me either.
Still complaining about error on the line, now on row 10 (since 9 is commented out).



The only thing that differs my systen from your guide is that i have my windows computers in my hostfile to.


Good news about the wirelesss lan though:)
My fstab file as follows

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda5 / ext3 defaults,errors=remount-ro 0 1
/dev/hda1 /media/hda1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
/dev/hda6 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
# //banancompaq/ftp /bananftp cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
//banancompaq/ftp /bananftp cifs username=administrator,password=*******,iocharset= utf8,file_mode=0777,dir_ mode=0777 0 0

Trekko
January 3rd, 2007, 05:33 PM
and this works like a charm.

root@bananubuntu:~# mount -t cifs //banancompaq/ftp /bananftp -o username=administrator,password=********,iocharset =utf8,file_mode=0777,dir_mode=0777




Just noted a strange thing, maybe a bug in the forum, there is a space in the text after iocharset in my above posts.
But this is only in the forumtext. not the terminal i copied them from.

Maybe this can create some intresting situations fur users copying text/commands from furum.
Or is this why most of you use the codetags?

dmizer
January 3rd, 2007, 08:06 PM
okay ....
@trekko:
first off, if you encase your lines in
markups, then your line will not scroll, so yes ... this is exactly why most of us use code tags.

try changing your fstab line to this:
[code]//banancompaq/ftp /bananftp cifs noauto,username=administrator,password=*******,ioc harset=utf8,file_mode=0777,dir_mode=0777 0 0
then mount using this command:

sudo mount /bananaftp

@borka
i need to take a step back. you said:

I have tried to take away the "/" from the end of the locationspaths, e.g //LAN-HDD/Williams
But then I get: mount error 20 = Inte en katalog (not a directory)
but the paths should definitely NOT have the "/" at the end. is "LAN-HDD" a directory in /media? remember, linux is case sensitive. (i'm just trying to make sure all the ducks are lined up so to speak)

otherwise, let's try adding the verbose option to your mount line to see if we can't get some more info:

sudo mount -t cifs //LAN-HDD/Williams /media/LAN-HDD --verbose -o guest,iocharset=utf8,file_mode=0777,dir_mode=0777

Trekko
January 3rd, 2007, 09:41 PM
Progress :) :)


When i add this to fstab

//banancompaq/ftp /bananftp cifs noauto,username=administrator,password=*******,ioc harset=utf8,file_mode=0777,dir_mode=0777 0 0
it mounts succesfully with

sudo mount /bananftp

but does not mount with
sudo mount -a
or gives any errors so it looks like it mounted but doesent.

Thx for the almoust 24/7 effort you put in this.

MichaelJohansson
January 3rd, 2007, 10:17 PM
I have exactly the same problem as Borka

When I try to mount my NAS (ARGOSY HD363N) with cifs


sudo mount -t cifs //192.168.000.10/Apps /home/michael/mnt/Apps -o username=michael

I get following error


mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

The ARGOSY HD363N shall support cifs according to manual, and I think it do so be course when I mount it from Windows it seems much faster compared to when I mount from Linux using smbfs
That is also the reason that I want to use cifs.

Could cifs be implemented in different ways?
Is cifs requiring something else, library etc. more than smbfs does?
Is there anyone who have succeeded to mount ARGOSY HD363N with cifs from Linux?

However

iocharset=utf8,codepage=unicode,unicode
solved my problem with the Swedish characters when mounting with smbfs

glave
January 4th, 2007, 12:01 AM
I'm having a problem with some of my shares mounting with the correct permissions.

My windows machine share mount perfectly fine, however, my shares on my linux server are not mounting as expected.

I've got all my shares set in fstab to mount the same, with both files and dirs set to 0777. On my samba server, I have the shares defaulting to read only, but I have myself set as the admin, so I can share files to the whole family and give myself full read/write access without having to worry about my wife or son accidentally deleting all our mp3s.

It would appear that my mounts are ignoring the fact that I am an admin user, and just mounting the shares based on the default share settings. Is there a way I can circumvent this?


Here are two entries:


//arcade/mp3 /media/mp3 cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
//arcade/glave /media/glave cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

And then the resulting mountpoints

drwxr-xr-x 122 root root 0 2006-12-20 09:13 mp3
drwxr-xr-x 16 glave glave 0 2007-01-01 09:12 glave

Before mounting, both mountpoints are root root drwxrwxrwx. The second share is my user share on the server, so I can see that its mounting the share to just me (nice!). I just need that mp3 share to recognize that I am a share admin and let me mount it 777 instead of the 755 that the share defaults to.

Markus72
January 5th, 2007, 12:31 AM
Hi,

thanks for the guide.
It works fine except one thing I cannot solve yet:

when I mount the share like that

mount -t cifs -o username=XXX,password=XXX,iocharset=utf8,codepage= 850,file_mode=0777,dir_mode=0777,credentials=/root/.smbcredentials sharename mountpoint

everyting looks good - until I create a file or a folder. I can create both but the permissions after creation are total nonsense.

I wonder if that is a mounting issue or a samba configuration issue. If I use the network server browser to create a file or folder all permissions are as expected. So I assume it's not an samba config thing!?

Any idea?

Thanks in advance
Markus

dmizer
January 5th, 2007, 11:20 AM
sorry for the delay folks, i've been on holiday.

@Trekko:
well, i believe you're being effected by bug 44874 (https://launchpad.net/ubuntu/+source/hal/+bug/44874)

i'm actually in the same boat, but it's on my desktop machine with a wired ethernet connection so i don't have to worry about entering my keyring password.

the only thing i can suggest at this point is to have a script launch (with the "mount /bananftp" command) after you've entered in your keyring password.

sorry, i'm clueless when it comes to scripts so i'm not to sure what to tell you on that.

@MichaelJohansson
i wish i could get my hands on one of these little buggers. without a doubt, the most problems are occurring with the nas devices of a variety of manufacture.

smbfs is a different technique, but it uses the same libraries. in most cases, it simply performs the job better.

if you could also try mounting with the "verbose" option like i requested from borka in post 162 (http://www.ubuntuforums.org/showpost.php?p=1962996&postcount=162), i might be able to figure out more.

@glave:
try adding the uid option in your line like so:

//arcade/mp3 /media/mp3 cifs credentials=/root/.smbcredentials,uid=your_windows_admin_id,iocharse t=utf8,file_mode=0777,dir_mode=0777 0 0

@Markus72
first of all, i'm not sure what you mean by the permissions are "total nonsense". are the permissions on the local computer a problem, or are the permissions on the remote sharing server a problem?

also, your mount line has loads of extra stuff in it that could be causing problems:

mount -t cifs -o username=XXX,password=XXX,iocharset=utf8,codepage= 850,file_mode=0777,dir_mode=0777,credentials=/root/.smbcredentials sharename mountpoint

1) the "codepage" is not an option in cifs. because cifs is much better at handling international characters, you don't need the codepage option.
2) the "username=xxx,password=xxx" and "smbcredentials" options perform the exact same function, so if they are different in any way, it could be causing you trouble. use one or the other but not both.
3) you're putting the options in front of the sharename and mountpoint.

frankly, i'm curious as to how that line is working at all.

so change your line to this:

mount -t cifs //sharename /mountpoint -o username=XXX,password=XXX,iocharset=utf8,file_mode =0777,dir_mode=0777
or this:

mount -t cifs //sharename /mountpoint -o credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777

please remember cifs is NOT the exact same thing as smbfs, so the method for mounting is not going to be identical.

Markus72
January 5th, 2007, 12:25 PM
Hi Dmizer,

thanks for your reply. I solved the problem.
In fact it was not a problem caused by the mount command. Your variant did the same as mine but was just shorter and less redundant - that's why I replaced mine ;-)

It were the file permission settings configured in samba. After I changed them, everything war fine.
What I didn't understand yet is why creating a folder in a mounted share will lead to different permissions in comparison to a folder created using the network computer browser window.

But - in the end - after changing the samba settings: who cares now they're equal ;-)

Thanks a lot
Markus

glave
January 6th, 2007, 03:39 PM
@glave:
try adding the uid option in your line like so:

//arcade/mp3 /media/mp3 cifs credentials=/root/.smbcredentials,uid=your_windows_admin_id,iocharse t=utf8,file_mode=0777,dir_mode=0777 0 0

Gave that a shot, but got the exact same results. Glave is the admin user's name on my samba share, so I used uid=glave on the mount command.

In short, my mount was still mounted root root drwxr-xr-x and I was unable to do any write or delete to the mounted share.

dmizer
January 7th, 2007, 02:00 AM
well, we can try a few more options, but this problem may be with the configuration of the share on the windows machine. lol, it may give me an excuse to actually boot a windows machine. which, in reality, means i'll actually have to install it.

anyway ... try this line:

//arcade/mp3 /media/mp3 cifs credentials=/root/.smbcredentials,uid=glave,iocharset=utf8,rw,file_m ode=0777,dir_mode=0777 0 0

glave
January 7th, 2007, 05:24 AM
That seemed to clear it up for me!

Although for clarification, this wasn't coming from a windows share, this was from a samba share running edgy in server mode!

dmizer
January 7th, 2007, 10:26 AM
That seemed to clear it up for me!
fantastic!


[...] this was from a samba share running edgy in server mode!
if both your server and your client are linux, you should use nfs instead of samba. it's much easier to configure, and way faster. the fourth link in my sig will show you how to set up both the server and client. only a few lines of cli as compared to this mess.

glave
January 8th, 2007, 02:01 AM
Unfortunately, I'm sharing out to windows machines as well, else I'd probably opt for nfs as the sole option!

dmizer
January 8th, 2007, 02:20 AM
nothing to stop you from using both ;)

MichaelJohansson
January 9th, 2007, 08:45 PM
About mounting the ARGOSY HD363N (NAS) with cifs



....
if you could also try mounting with the "verbose" option like i requested from borka in post 162 (http://www.ubuntuforums.org/showpost.php?p=1962996&postcount=162), i might be able to figure out more
....


I tried the verbose option but it doesn't give me any clue.


michael@hppavilion-linux:~$ sudo mount -t cifs --verbose //192.168.0.10/Apps /home/michael/mnt/Apps -o username=michael
parsing options: rw,username=michael
Password:

mount.cifs kernel mount options unc=//192.168.0.10\Apps,ip=192.168.0.10,pass=1234,ver=1, rw,username=michael
mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
michael@hppavilion-linux:~$

dmizer
January 10th, 2007, 09:17 AM
humm ... MichaelJohansson and borka, i've been doing some digging and most of the information i'm finding on the error code 20 is quite old. so i did some digging on your particular unit, and it would seem that it's a buggy little sucker. it says cifs support, but apparently cifs support is something of an overstatement.

you can try going here:
http://www.argosyusa.net/product.asp?product_name=HD363N
and make sure you have the latest firmware loaded (requires windows).

there's a healthy discussion you might try sifting through. located here:
http://www.futurehardware.in/66931.htm
it would appear that both windows and linux users are having problems with the unit.

otherwise you may just be stuck with smbfs. there are reasons why cheap hardware is cheap ... :(

HD363N NAS - 2 <> dmizer - 0

sorry folks ...

borka
January 10th, 2007, 08:10 PM
Sorry for being away for some days, got my hands on some other problem..
But as Michaels smbfs options worked to get swedish characthers working, I think I can live with using that for now :)

Anyhow, I wish I had done some research about this particular NAS before I bought it, but that one was the only one that they sold at the time in the small town I live in :(
Otherwise I would have gone with some other hardware for it :P

Well well, thanks for you help guys, atleast I wont go anyfurther trying to get CIFS working with the Agrosys NAS..

Cya around
//Borka

dmizer
January 11th, 2007, 02:00 PM
sorry again, and thanks for trying.

updated the howto to include a small disclaimer about NAS devices and the ARGOSY HD363N in particular.

LavaHot
January 19th, 2007, 11:17 AM
so i get all the way to
sudo mount -a, and it wont let me have a "$" at the end of a share, such as the hidden default shares on windows drives, and the "\ "trick for spaces doesn't work either. BUT, I've gotten around all that by creating new shares but now I get this:
mount: mount point 0 does not exist when I enter
sudo mount -a any ideas?

dmizer
January 19th, 2007, 11:22 AM
you can mount "hidden" (in quotes because they are only hidden from ms machines) directories by putting quotes around the directory like so:

//netbiosname/"sharename$"

if that doesn't work, post the output of:

smbtree
and your fstab line.

eragorn
January 21st, 2007, 09:49 PM
Just wanted to post an update that synology has put out new firmware which corrected cifs/smbfs problems. With this firmware update and Dizmer's howto everything is rocking!

simonsimon
January 26th, 2007, 09:23 PM
Hi

I'm getting this error when I try and mount:


[mntent]: line 12 in /etc/fstab is bad

This is the line it says is bad:



//insertech-dc.INSERTECH.NET/Network\ Drive /media/Network\ Drive cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

Does it look wrong to you? If so where?

I've followed your directions exactly (I hope) and have installed samba and smbfs. I'm trying to do this from Edgy. If you need more info please let me know.

Thanks.

dmizer
January 26th, 2007, 11:55 PM
Hi

I'm getting this error when I try and mount:


[mntent]: line 12 in /etc/fstab is bad

This is the line it says is bad:



//insertech-dc.INSERTECH.NET/Network\ Drive /media/Network\ Drive cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0


the "insertech-dc.INSERTECH.NET" is not your local domain, so your getting the error. can you post the output of:

smbtree

simonsimon
January 27th, 2007, 12:30 AM
ok. Thanks for helping. Here it is.


MSHOME
\\SIMON
\\SIMON\Printer HP LaserJet 4
\\SIMON\Shared
\\SIMON\C$ Default share
\\SIMON\ADMIN$ Remote Admin
\\SIMON\Printer2 hp deskjet 5550 series
\\SIMON\SharedDocs
\\SIMON\print$ Printer Drivers
\\SIMON\IPC$ Remote IPC
\\SIMON\web site
\\MAILSERV mailserv server (Samba, Ubuntu)
\\MAILSERV\ADMIN$ IPC Service (mailserv server (Samba, Ubuntu))
\\MAILSERV\IPC$ IPC Service (mailserv server (Samba, Ubuntu))
\\MAILSERV\print$ Printer Drivers
INSERTECH
\\VAIO
\\VAIO\Printer Quicken PDF Printer
\\VAIO\C$ Default share
\\VAIO\outlook
\\VAIO\ADMIN$ Remote Admin
\\VAIO\Printer2 Microsoft Office Document Image Writer
\\VAIO\Printer3 Intuit Internal Printer
\\VAIO\SharedDocs
\\VAIO\print$ Printer Drivers
\\VAIO\IPC$ Remote IPC
\\RECEPTION FRONTDESK
\\RECEPTION\C$ Default share
\\RECEPTION\ADMIN$ Remote Admin
\\RECEPTION\hpLaserJ hp LaserJet 1300 PCL 6
\\RECEPTION\SharedDocs
\\RECEPTION\print$ Printer Drivers
\\RECEPTION\IPC$ Remote IPC
\\RECEPTION\My Documents
\\QUALITY
\\QUALITY\LexmarkZ23 Lexmark Z23-Z33 (Copy 1)
\\QUALITY\C$ Default share
\\QUALITY\ADMIN$ Remote Admin
\\QUALITY\print$ Printer Drivers
\\QUALITY\SharedDocs
\\QUALITY\IPC$ Remote IPC
\\MANUFACTURING01 MANUFACTURING
\\MANUFACTURING01\IPC$ Remote Inter Process Communication
\\MANUFACTURING01\HP1200
\\MANUFACTURING01\PRINTER$
\\MANUFACTURING01\TERMINAL SER
\\LAPTOP2 DAVE
cli_start_connection: failed to connect to LAPTOP2<20> (0.0.0.0)
\\INSRTCHRCPT
\\INSRTCHRCPT\C$ Default share
\\INSRTCHRCPT\ADMIN$ Remote Admin
\\INSRTCHRCPT\print$ Printer Drivers
\\INSRTCHRCPT\IPC$ Remote IPC
\\INSERTECH-DC
\\INSERTECH-DC\DesignJet DesignJet 450C
\\INSERTECH-DC\shared
\\INSERTECH-DC\VPHOME Symantec AntiVirus
\\INSERTECH-DC\C$ Default share
\\INSERTECH-DC\VPLOGON Symantec AntiVirus
\\INSERTECH-DC\SYSVOL Logon server share
\\INSERTECH-DC\ADMIN$ Remote Admin
\\INSERTECH-DC\F$ Default share
\\INSERTECH-DC\NETLOGON Logon server share
\\INSERTECH-DC\print$ Printer Drivers
\\INSERTECH-DC\D$ Default share
\\INSERTECH-DC\IPC$ Remote IPC
\\INSERTECH-DC\E$ Default share
\\HP14656110233
\\ENGINEERING01
\\ENGINEERING Engineering
\\DIMENSION4
\\DIMENSION3
cli_start_connection: failed to connect to DIMENSION3<20> (0.0.0.0)
\\DIMENSION1 HP932C Deskjet
\\DIMENSION1\C$ Default share
\\DIMENSION1\ADMIN$ Remote Admin
\\DIMENSION1\Printer2 Microsoft Office Document Image Writer
\\DIMENSION1\Printer4 Creates Adobe PDF
\\DIMENSION1\SharedDocs
\\DIMENSION1\print$ Printer Drivers
\\DIMENSION1\IPC$ Remote IPC
\\CPI01
\\CPI01\C$ Default share
\\CPI01\ADMIN$ Remote Admin
\\CPI01\print$ Printer Drivers
\\CPI01\SharedDocs
\\CPI01\IPC$ Remote IPC
\\COMPAQ2
\\COMPAQ2\Printer Quicken PDF Printer
\\COMPAQ2\Printer2 Microsoft Office Document Image Writer
\\COMPAQ2\SharedDocs
\\COMPAQ2\print$ Printer Drivers
\\COMPAQ2\IPC$ Remote IPC
\\COMPAQ05
\\COMPAQ05\Deskjet6940 HP Deskjet 6940 series
\\COMPAQ05\SharedDocs
\\COMPAQ05\print$ Printer Drivers
\\COMPAQ05\IPC$ Remote IPC

dmizer
January 27th, 2007, 12:43 AM
i'm not absolutely positive by your output there, but i THINK this is what you're looking for:

//INSERTECH-DC/shared /media/Network\ Drive cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

however, it may be that your office is using active domain for shares. if that's the case, you're in a completely differet situation that i'll be unable to help you with.

simonsimon
January 27th, 2007, 12:51 AM
ok. that didn't work. I'll look into the active domain thing.

Thanks.

Sleestack
February 3rd, 2007, 05:17 AM
Thank you so much for posting these excellent instructions. I'm a total Ubuntu newbie and I've been looking for weeks how to get my brand-spanking new Ubuntu installation to see my Windows home network drives. Previous to this I was only minimally able to browse the network drives using the Ubuntu equivalent to the Windows File Explorer (sorry - I'm still that new to this...) and my applications could not see network files using the ol' file->open menus. It's been like learning how to use a computer all over again, but much more rewarding this time around.

Just a few notes on my experiences with this that may help others out there like me.

1. I had to use the IP address (instead of the computer name) of the Windows server when adding the access line to the fstab file:
//192.168.1.100/MyMaxtorExternal /media/Maxternal0 cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

For those of you who need to know how to find the IP address of the Windows server, go to Start->Run->Command and type ipconfig in the "DOS" window.

I actually don't know if using the IP address will cause me trouble in the future, and I'm not sure why the DNS didn't work, but for now it seems to be stable.

2. The follow-up poster who gave the tip on how to find the proper share name to put into the fstab file was extremely helpful:

"You can find all the shares and share names on your network by entering the following command:"

smbtree user=jsmith

It then displayed all the machines on my home network with the drive share names.

All-in-all I'm extremely gratified and really appreciate your post. It took some tweaking and I'm not so sure it's all completely stable, but your help is very much appreciated.

mells
February 9th, 2007, 11:18 PM
Hi

Thanks for posting this great thread. I'm a Linux noob and it has taught me a great deal about mounting patitions.

I have a Safecom NSUR-10100F NAS device that I still cant get to mount. I have tried the insturctions in post 162 and tried:


sudo mount -t smbfs -o guest //192.168.0.3/My_Documents /media/phoenix

The above mounts the device in /media/phoenix but when I try and look at items the folders on the share dont open etc.

The NAS is called 'phoenix' on my network and I can ping it:


PING PHOENIX (192.168.0.3) 56(84) bytes of data.
64 bytes from PHOENIX (192.168.0.3): icmp_seq=1 ttl=32 time=1.90 ms
64 bytes from PHOENIX (192.168.0.3): icmp_seq=2 ttl=32 time=1.87 ms
64 bytes from PHOENIX (192.168.0.3): icmp_seq=3 ttl=32 time=1.89 ms
64 bytes from PHOENIX (192.168.0.3): icmp_seq=4 ttl=32 time=1.87 ms

--- PHOENIX ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 1.876/1.887/1.904/0.032 ms



but I cant mount it and see it properly.

Any ideas??

Many Thanks.

phazon.
February 11th, 2007, 06:21 PM
Just wanted to post an update that synology has put out new firmware which corrected cifs/smbfs problems. With this firmware update and Dizmer's howto everything is rocking!

Thanks for the heads up mate, that has solved all my problems!

dmizer
February 12th, 2007, 01:11 AM
eragorn or phazon,
can i get a link to the synergy firmware? i'll stick it on the first post.

@ mells:
well, this thread is about cifs, not smbfs, but i THINK you should be able to get yours to work by adding two options to your mount line like so:

sudo mount -t smbfs -o guest,fmask=777,dmask=777 //192.168.0.3/My_Documents /media/phoenix
you may also have to make sure that the /media/phoenix folder has 777 permissions:

sudo chmod 777 /media/phoenix

phazon.
February 12th, 2007, 10:59 AM
eragorn or phazon,
can i get a link to the synergy firmware? i'll stick it on the first post.

Here you go

http://www.synology.com/enu/news/07.01.12.php

mells
February 12th, 2007, 08:37 PM
eragorn or phazon,
can i get a link to the synergy firmware? i'll stick it on the first post.

@ mells:
well, this thread is about cifs, not smbfs, but i THINK you should be able to get yours to work by adding two options to your mount line like so:

sudo mount -t smbfs -o guest,fmask=777,dmask=777 //192.168.0.3/My_Documents /media/phoenix
you may also have to make sure that the /media/phoenix folder has 777 permissions:

sudo chmod 777 /media/phoenix

Thanks dmizer, but I get the following message if I try the suggested:


sudo mount -t smbfs -o guest,fmask=777,dmask=777 //192.168.0.3/My_Documents /media/phoenix
mount: wrong fs type, bad option, bad superblock on //192.168.0.3/My_Documents,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

dmizer
February 12th, 2007, 11:46 PM
please post the output of:
smbtree

mells
February 13th, 2007, 07:46 PM
please post the output of:
smbtree

Thats the funny thing.


carl@angel:~$ sudo smbtree
Password:
carl@angel:~$


Nothing comes up.

I can ping the device //phoenix and its IP address 192.168.0.3 no problems..

dmizer
February 15th, 2007, 03:59 AM
humm ... do you have ubuntu set up as a samba server as well?

try this line:

sudo mount -t smbfs -o guest,rw //phoenix/My_Documents /media/phoenix
sometimes this works when attempting the mount by ip address does not.

mells
February 15th, 2007, 11:49 PM
humm ... do you have ubuntu set up as a samba server as well?

try this line:

sudo mount -t smbfs -o guest,rw //phoenix/My_Documents /media/phoenix
sometimes this works when attempting the mount by ip address does not.

That doesnt work, its driving me nuts. Output:


carl@angel:~$ sudo mount -t smbfs -o guest,rw //phoenix/My_Documents /media/phoenix
Password:
mount: wrong fs type, bad option, bad superblock on //phoenix/My_Documents,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

carl@angel:~$

dmizer
February 16th, 2007, 11:28 AM
okay ... i broke out the manual on your nas device. what filesystem did you use to format the drive with?

also, where did you format the drive? did you format the drive with the "disk utility" while it was in the nas unit, or did you format it and then put it in the nas unit?

also, can you post screenshots of the "SMB Server" and "status" sections from the web controll utility for your device?

i swear ... i'm going to go out and buy myself one of these evil NAS things just so i can smash it to tiny bits with a blunt object. ;)

mells
February 17th, 2007, 07:51 PM
The disk was formatted from NTFS to FAT32 by the NAS unit using the format feature in the menu.

Thanks for spending so much time helping. Here is the requested screenshots, sorry I used a windows box (eewwh!!!) to grab them:

Status
http://i25.photobucket.com/albums/c77/cmelia/status.jpg

SMB
http://i25.photobucket.com/albums/c77/cmelia/smb.jpg

IP address
http://i25.photobucket.com/albums/c77/cmelia/ipaddy.jpg

Thanks again, the unit so nearly has been thrown out of the window several times!

dmizer
February 17th, 2007, 08:05 PM
lol ... don't worry, if i get around to buying one, i'll take lots of pictures while i destroy it.

okay ... have you set up samba to share files from your ubuntu box yet? if so, please post your current /etc/samba/smb.conf file. if not, i'll reply with a replacement for it.

humm ... what about ipv6? has that been disabled on your box? what's listed in ubuntu as your dns servers?

have you installed smbfs?

sudo aptitude install smbfs

mells
February 17th, 2007, 11:54 PM
Yay, a step in the right direction at last!

I reinstalled smbfs and typed this into the terminal:


sudo mount -t smbfs -o guest,rw //phoenix/My_Documents /media/phoenix

It mounted as phoenix2 as I already had a ftp connection (which is useless) as phoenix on the desktop.

Problem is I cant read the file names (see screenshot), or open any of the files.

http://i25.photobucket.com/albums/c77/cmelia/Screenshot.png

There is nothing in /etc/samba/smb.con

My DNS is my wireless router (I think) which is always fixed to 192.168.0.1

dmizer
February 18th, 2007, 09:24 AM
okay ... lets try cifs now. see if this works:

sudo mount -t cifs //phoenix/My_Documents /media/phoenix -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77

also make sure that the ftp is unmounted first.

mells
February 18th, 2007, 02:06 PM
I'm starting to think this is a non starter with Ubuntu now....

I got this message now:


carl@angel:~$ sudo mount -t cifs //phoenix/My_Documents /media/phoenix -o guest,iocharset=utf8,file_mode=0777,dir_mode=0777
mount error 20 = Not a directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
carl@angel:~$

volksman
March 14th, 2007, 01:09 AM
Just followed your howto and works like a charm. However I would say that a reboot will be necessary if you are trying to connect linux to linux...I spent a good 15 - 25 minutes scratching my head as to why my windows shares mounted no problem but I couldn't hit a samba share on another linux box in my network. Renamed the hosts file etc....kept getting Error 5.

Rebooted my Ubuntu desktop and all was mounted when it came back up. Very weird.

Would love to know why I couldn't just restart a service or something but it works now so no biggy.

Thanks for the howto!

dmizer
March 14th, 2007, 01:39 AM
i've never had a problem with needing to reboot when connecting from linux to linux. i really have no idea what could have been causing that for you.

you might have been successful by using this command:

sudo mount /media/sharename

kerridge
March 23rd, 2007, 11:38 AM
Yay, a step in the right direction at last!

I reinstalled smbfs and typed this into the terminal:



It mounted as phoenix2 as I already had a ftp connection (which is useless) as phoenix on the desktop.

Problem is I cant read the file names (see screenshot), or open any of the files.

http://i25.photobucket.com/albums/c77/cmelia/Screenshot.png

There is nothing in /etc/samba/smb.con

My DNS is my wireless router (I think) which is always fixed to 192.168.0.1



Hello,

I had the same problem and fixed it thanks to these resources:-

http://whirlpool.net.au/forum-replies-archive.cfm/424238.html

discussed firmware and directed me to:

http://www.aroundmyroom.com/landisk/
where i used
nas-basic45-69-r8.rar

and upgraded the box.

howardf42
March 24th, 2007, 07:26 PM
I believe I followed your instructions carefully. I even went back and used nano after I had used gedit to modify fstab. When I run
sudo mount -a I get the following error:
[mntent]: line 19 in /etc/fstab is bad

Line 19 reads as follows:


//shuttlex/Shared Media /media/SharedMedia cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Any idea what I'm doing wrong?

Thanks,
Howard

dmizer
March 25th, 2007, 12:21 AM
//shuttlex/Shared Media /media/SharedMedia cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

Any idea what I'm doing wrong?
fstab reads a space as a prompt that the command is done and to move on to the next. so with //shuttlex/Shared Media ... it's trying to read the shared file as //shuttlex/Shared and mount it in Media.

you can correct this one of two ways.

1) it's preferable to eliminate the space in your share name.
-or-
2) indicate a space by using \040 like so:

//shuttlex/Shared\040Media /media/SharedMedia cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

swarles_barkley
April 9th, 2007, 03:08 AM
I'm trying to get my PS3 running Ubuntu to see my file share created on a Windows XP computer.

I followed the guide and tried the manual mount option first, but couldn't get it to work. I then went off and tried to configure a samba server, not knowing exactly what I was doing, but after reading through this thread, it looks like what I might have done is configured a file share on my PS3 that perhaps my Windows XP machine could see, rather than what I originally intended, which was to have my PS3 see my Windows share.

Could I get some help removing samba from my PS3 (since I don't need the ability to see my PS3 from my Windows machine and I'm thinking this might make life a lot easier), and then achieve what I originally intended?

I saw that requests were made to post my smbtree so here it is:

MAUNAWILI
\\SHRAPNEL
\\SHRAPNEL\ADMIN$ IPC Service ()
\\SHRAPNEL\IPC$ IPC Service ()
\\SHRAPNEL\MyFiles
\\SHRAPNEL\print$

Keep in mind, however, that I have a samba server running so I don't know if this will affect the smbtree output.

As far as how my network is set up, my Windows XP machine is connected wirelessly to a Netgear WRT54G router with a static IP. My PS3 is connected via wire to my router and is also assigned a static IP.

Windows XP machine name: shrapnel.
Workgroup: MAUNAWILI

Note: When I right-clicked on "My Computer --> Properties" and then went to the "Computer Name" tab, the full name of the computer is displayed as "shrapnel."

I saw that I need to get my Ubuntu environment onto the same workgroup as my Windows machine. At the moment, I don't know how to do that.

Any help would be greatly appreciated.

Thanks,

dmizer
April 9th, 2007, 03:20 AM
okay ... lets just try to get you connected before making the effort of changing work group for your ubuntu machine.

you didn't indicate if your xp machine had password protected shares or not, but i'll assume that you don't.

as indicated in the howto, you'll need to create a folder on your ubuntu machine in which to mount the remote directory. howto indicates a directory of /media/sharename. for you i suggest /media/shrapnel like so:

sudo mkdir /media/shrapnel
now edit fstab as shown in the howto and include this line:

//shrapnel/MyFiles /media/shrapnel cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0
save, exit, and try this command:

sudo mount -a

you should see a folder appear on your desktop labeled "shrapnel" where you can browse, change, and save files to at will.

if that doesn't work, then we'll go through the effort of making your ubuntu machine joing the same workgroup.

swarles_barkley
April 9th, 2007, 03:26 AM
I forgot to mention that the name of my share on the WinXP machine is called "videoshare"

This is the output from "mount":

mount: sys already mounted or /sys busy
mount: according to mtab, /sys is already mounted on /sys
mount error 5 = Input/output error
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

dmizer
April 9th, 2007, 03:31 AM
well, according to your smbtree output, the "videoshare" doesn't exist.

so, please post the contents of your /etc/samba/smb.conf file and we'll fix the workgroup issue.

swarles_barkley
April 9th, 2007, 03:50 AM
[global]
; General server settings
netbios name = shrapnel
server string =
workgroup = MAUNAWILI
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast

wins support = yes

printing = CUPS
printcap name = CUPS

syslog = 1
syslog only = yes

; NOTE: If you need access to the user home directories uncomment the
; lines below and adjust the settings to your hearts content.
;[homes]
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/

; NOTE: Only needed if you run samba as a primary domain controller.
; Not needed as this config doesn't cover that matter.
;[netlogon]
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no

; NOTE: Again - only needed if you're running a primary domain controller.
;[Profiles]
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no

; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in another HOWTO.
[print$]
path = /var/lib/samba/printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775

[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no

; Uncomment if you need to share your CD-/DVD-ROM Drive
;[DVD-ROM Drive]
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes

[MyFiles]
path = /media/videoshare/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = arthur
force group = user

dmizer
April 9th, 2007, 04:00 AM
well, according to what you've told me about your xp machine, and what i see here in your smb.conf file, you are already a part of the same workgroup. however, both your xp and your ubuntu machine have the exact same name. we'll need to correct that.

please change this line:

netbios name = shrapnel
to something unique to your ubuntu box. alternatively, you could rename your xp ps3 box. but i think part of your problem is happening because the names are the same.

also, comment out the fstab line i gave you earlier by putting a # in front of it.

then reboot everything (xp and ubuntu) and retry smbtree.

swarles_barkley
April 9th, 2007, 04:27 AM
Here's my smbtree after restarting:
MAUNAWILI
\\SWARLEY
\\SWARLEY\ADMIN$ IPC Service ()
\\SWARLEY\IPC$ IPC Service ()
\\SWARLEY\MyFiles
\\SWARLEY\print$

I changed my smb.conf to read netbios name = swarley.

So it looks like I can't even see my Windows PC at all; I'm only seeing my PS3. Is this correct?

dmizer
April 9th, 2007, 04:36 AM
that's what it looks like. could be a firewall issue or some such, but lets try to mount the thing anyway.

you said your share was named 'videoshare', so now edit the fstab file again. remove the # and change "MyFiles" to 'videoshare' like so:


//shrapnel/videoshare /media/shrapnel cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

then try:

sudo mount -a
again

swarles_barkley
April 9th, 2007, 04:54 AM
Here are the results after editing the fstab and attempting to remount:

retrying with upper case share name
mount error 6 = No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

dmizer
April 9th, 2007, 05:48 AM
sorry for the delay ... you caught me out at lunch.

do you have the windows xp firewall enabled? if you don't know how to check: http://www.microsoft.com/windowsxp/using/networking/security/winfirewall.mspx

are your shares password protected?

swarles_barkley
April 9th, 2007, 06:15 AM
dmizer,

Thank you so much for all your help thus far.

I saw that the Windows firewall might present some problems so I disabled it, but I still cannot see my Windows PC from Ubuntu. I also tried to see if I could see my PS3 from my Windows laptop (since, if I understand things correctly, I have a samba server set up) and I could not.

dmizer
April 9th, 2007, 06:26 AM
well, you almost have a samba server enabled. make a couple of changes and you'll be good to go.

change this line: security = user to security = share
change this line: guest ok = no to guest ok = yes
change this line: force group = user to force group = arthur

then, enter these commands:

sudo smbpasswd -L -a arthur
sudo smbpasswd -L -e arthur
sudo /etc/init.d/samba restart
and you should then be able to see your ubuntu box from windows.

you said you were using static ip on the windows box? let's try mounting by ip address instead of by netbios name.
so in fstab, change "shrapnel" to the ip address of your windows box, save and retry the sudo mount -a

swarles_barkley
April 9th, 2007, 06:39 AM
I see it now! Is that it?

dmizer
April 9th, 2007, 06:45 AM
you were able to mount the windows shared folder from ubuntu? if so, yup, that's it.

swarles_barkley
April 9th, 2007, 06:53 AM
The file share mounted and appeared on the desktop. Thank you!

Now to figure out a way to get the PS3 to play my video files smoothly.

dmizer
April 9th, 2007, 06:57 AM
no problem, glad we got you working.

for video, i've found that xine works the best. for gnome, look through synaptic for the package xine-ui and install that. see if that gives you better playback.

swarles_barkley
April 9th, 2007, 07:16 AM
Is there a divx/xvid codec that I'd need to install for Xine? (I was using vlc before)

dmizer
April 9th, 2007, 07:20 AM
honestly, i don't know. i just followed this guide: https://help.ubuntu.com/community/RestrictedFormats?highlight=%28formats%29%7C%28res tricted%29

then installed xine-ui and everything worked fine.

HeyItsMatt
April 11th, 2007, 05:43 AM
Hey, I was attempting to follow your guide, and I wanted to try doing a manual mount first instead of a permanent one. When I attempt to use a mount command, I get the error "mount error 12 = Cannot allocate memory". (I've set a Samba username and password but I tried all 3 commands just in case I was confused and did something wrong when creating a user - all the same result). The folder I am trying to mount from a Windows XP comp has no files in it so I'm not sure why this would be memory-intensive or anything.

I can actually access my Windows XP computer from this Linux computer using Nautilus and see the shared folders on it, but when I try to open the folder it gives the error "The folder contents could not be displayed. Sorry, couldn't display all the contents of "XXX". It was previously working fine and I was able to go to "Places / Network servers" and take files from XP onto this Ubuntu machine, but after I restarted XP a while ago for some reason I have been getting this error message - this is why I was trying to mount the shared folder myself.

I just can't figure out what's going on... perhaps this isn't something you can't help me with and my Windows machine is somehow having a problem? There are other Windows XP machines on my LAN and I can view/take from their shared folders as normal. I also noticed that I can't seem to see any shared folders I set up on this Ubuntu machine from my Windows XP machine, despite having samba installed... I guess this might not really be related though.

Sorry if anything is vague, I'm a Linux newbie and this stuff gives me headaches :) I don't even mind when stuff doesn't work, but when something worked and then randomly stops working, it's like it's teasing me.

dmizer
April 11th, 2007, 05:50 AM
well, that's a new one. gimme a bit to hunt it down.

dmizer
April 11th, 2007, 05:58 AM
can you post the exact line you used to mount your share please (not the one from my example, the actual line you used)?

HeyItsMatt
April 11th, 2007, 07:41 AM
Hopefully this is what you meant -

sudo mount -t cifs //matt8200/8200share /media/8200share -o username=matt,password=xxxxxx,iocharset=utf8,file_ mode=0777,dir_mode=0777

matt8200 being the hostname of my Windows XP computer, 8200share being the name of the shared folder I have set up (I have a folder with the same name created in this Ubuntu computers' /media/ folder)

I did the same thing for your other two commands. They didn't actually mount anything though, just gave me the memory allocation error instead of mounting.

dmizer
April 11th, 2007, 08:14 AM
okay ... try this command and tell me what the output is:

sudo mount -t cifs //matt8200/8200share /media/8200share --verbose -o username=matt,password=xxxxxx,iocharset=utf8,file_ mode=0777,dir_mode=0777

HeyItsMatt
April 11th, 2007, 06:03 PM
Here you go:


parsing options: rw,username=matt,password=xxxxxxx,iocharset=utf8,f ile_mode=0777,dir_mode=0777

mount.cifs kernel mount options unc=//matt8200\8200share,ip=192.168.0.10,ver=1,rw,userna me=matt,password=xxxxxx,iocharset=utf8,file_mode=0 777,dir_mode=0777
mount error 12 = Cannot allocate memory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


Thanks for taking the time for try to help out by the way, it's very generous of you.

dmizer
April 11th, 2007, 06:12 PM
humm ... does it say anything other than a simple "failed to mount" or the like when you look at the output of dmesg?

you said you were able to connect to other machines ... what kind of specs does the matt8200 machine have?

ps. i'm heading to bed. it's after 2am and i have to work in the morning. please reply and i'll do some more searching tomorrow, but i haven't turned up much yet.

HeyItsMatt
April 11th, 2007, 06:40 PM
There is a whole bunch of stuff after the "dmesg" command but the only stuff related to mounting is at the end:


[17180372.768000] CIFS VFS: cifs_mount failed w/return code = -12
[17180747.976000] CIFS VFS: cifs_mount failed w/return code = -12
[17182010.284000] CIFS VFS: cifs_mount failed w/return code = -12
[17182021.392000] Outbound IN= OUT=eth0 SRC=192.168.0.2 DST=239.255.255.250 LEN=160 TOS=0x00 PREC=0x00 TTL=1 ID=0 DF PROTO=UDP SPT=32771 DPT=1900 LEN=140
[17182021.396000] Outbound IN= OUT=eth0 SRC=192.168.0.2 DST=239.255.255.250 LEN=161 TOS=0x00 PREC=0x00 TTL=1 ID=0 DF PROTO=UDP SPT=32771 DPT=1900 LEN=141
[17182123.284000] CIFS VFS: cifs_mount failed w/return code = -12
[17182179.052000] CIFS VFS: cifs_mount failed w/return code = -12
[17191921.764000] CIFS VFS: cifs_mount failed w/return code = -12
[17228319.304000] Outbound IN= OUT=eth0 SRC=192.168.0.2 DST=239.255.255.250 LEN=160 TOS=0x00 PREC=0x00 TTL=1 ID=0 DF PROTO=UDP SPT=32829 DPT=1900 LEN=140
[17228319.304000] Outbound IN= OUT=eth0 SRC=192.168.0.2 DST=239.255.255.250 LEN=161 TOS=0x00 PREC=0x00 TTL=1 ID=0 DF PROTO=UDP SPT=32829 DPT=1900 LEN=141
[17228577.920000] CIFS VFS: cifs_mount failed w/return code = -12
[17228603.692000] CIFS VFS: cifs_mount failed w/return code = -12

I'm assuming that the "Outbound" lines are related to the mounting command anyway.

Some matt8200 specs:
Dell Dimension 8200 desktop, 74.5 GB of space, NTFS filesystem
Pentium 4 2.00 GHz CPU, 512 MB of RAM
NVIDIA GeForce FX 5200 Ultra graphics card
CNet PRO200WL PCI Fast Ethernet Adapter

Sorry if this is not enough, I'm not exactly a computer expert yet :) Just to make sure if I didn't mention it though, I was actually able to connect to matt8200 just fine like the other XP computers on my LAN - I was tranferring pictures from an old Kodak DC210 digital camera to matt8200 a few days ago, and then to Ubuntu, since Ubuntu did not recognize the camera. At some point I restarted XP to make it recognize a new picture, and then started having the connection error where I can see the shared folders I create but not display file contents. (The camera has not been connected to matt8200 since I restarted).

dmizer
April 11th, 2007, 11:49 PM
lets take a few stabs at the matt8200 machine.

first of all, i suggest you uninstall and reinstall your ethernet adapter. locate your driver disk for the card. if you don't have it, look on line for the driver. usually xp can find the driver for the card, but not always.

then go to start > control panel > system > hardware tab > device manager
look through the list for network adapters, expand the menu, right click on your adapter and select "remove" or "uninstall" ... i don't remember which.

reboot your xp machine and it should reinstall your network card. if not, use the driver you downloaded earler.

then retry your mount.

HeyItsMatt
April 13th, 2007, 01:18 AM
Hey, sorry for taking so long to respond.

I tried uninstalling and reinstalling my Ethernet Adapter, which did not help, but I have since solved the problem. I realized this had to be a problem with XP not related to Ubuntu, because I could not log into matt8200's shared folders from the other XP computers on my LAN either. I looked up the error message I was getting on Windows (before that I was only trying to look for the Ubuntu error message), and eventually figured out that I needed to change a registry entry specifying the IRPStackSize value and increase it. I guess something that had been installed on XP changed the value when I restarted the computer or something. Who knows... but it's working now!

I also tried one of your manual mount commands, which is now working, although I couldn't unmount the mount until I restarted Ubuntu (which made it disappear). When I restarted Ubuntu it did some kind of filesystem check (it said it was checking hda3 because it had been mounted 30 times without being checked) but then continued to automatically load into the Ubuntu GUI with no problems.

It's funny, my first reaction was to suspect Ubuntu since I'm new to it, but this has actually been a good argument in favor of replacing Windows XP with Ubuntu on my other computer, too. :)

Thank you for all your help!

dmizer
April 13th, 2007, 01:25 AM
no problem at all, glad you got it figured out. congrats, and happy ubunting!

auditory
April 25th, 2007, 06:22 AM
thank you for this guide.
this is very helpfrul.

i have a question.

i have samba installed but no smbfs.
I am using Feisty upgraded from Edgy.

But still I can use cifs to mount windows share.
Do you think do I have to install smbfs anyway??

When i try to install smbfs, there is a warning of authentication.
Is this OK?

dmizer
April 25th, 2007, 06:32 AM
humm ... the important thing here is that you're able to use cifs to mount your share. since cifs is a part of the smbfs package set (last i checked), there shouldn't be any need to install smbfs as long as cifs works. or iow ... you probably already have smbfs installed.

auditory
April 25th, 2007, 06:57 AM
no, i don't have smbfs.
instead I guess libsmbclient package do provide cifs:

libsmbclient:
shared library that allows applications to talk to SMB/CIFS servers
libsmbclient allows to write applications that use the SMB/CIFS protocol.
This gives applications the ability to talk to Microsoft Windows servers
and Unix servers running Samba.

This package contains the libsmbclient shared library.

auditory
April 25th, 2007, 07:06 AM
one more question:
the one little thing i prefer nautilus to cifs is that
in nautilus i don't have to know the share name.

Only to know the netbios name( actually static ip address),
I can see all share folders.

Is it also possible to do this with cifs?

i.e. if there is three(or more) share folders,
//xxx.xxx.xxx.xxx/share1
//xxx.xxx.xxx.xxx/share2
//xxx.xxx.xxx.xxx/share3
can i do mount all three(or more) share folders
without knowing that.

when i try to
mount -t cifs //xxx.xxx.xxx.xxx /media/share
i got error message like this:
mount: unknown filesystem type 'cifs'

dmizer
April 25th, 2007, 07:12 AM
if you are simply mounting from the command line (not permanent mount) you will not be able to mount without designating the specific shared folder name. so yes, you must know the shared name.

you can generally figure out what the shared name is by using the smbtree command even if you haven't mounted anything yet.

auditory
April 25th, 2007, 07:29 AM
then, how i can do that in case of permanent mount?

just omitting sharename failed with the following messages:


Mounting the DFS root for a particular server not implemented yet
No ip address specified and hostname not found

dmizer
April 25th, 2007, 11:02 AM
here's the deal ... with fstab you must also know the sharename. but you only need to figure it out once. then, every time you reboot it will appear on your desktop ready to use.

now ... if you want to mount a group of shares, just put them all in the same folder. mount that folder, and you don't have to figure out any other folder names underneath it.

you're looking at a difference between convenience and performance in this case. if your needs indicate you want convenience over performance, there is nothing wrong with that but you will have limitations. if you need to have the performance, then you will need to adjust how you address your use of shares such that it fits within the parameters of a more advanced and secure file transfer protocol.

and ... believe it or not, you run into the exact same issue if you use windows. you get better performance and network stability if you actually mount the folder by name instead of using "my network places" to browse the network.

auditory
April 26th, 2007, 01:40 AM
Thank you for your kind and patient replies.

Of course I prefer performance to convenience, and I will definitely use cifs.

And I didn't know at all the performance of cifs and windows network with share name
performs better than just network shares using browser.
I appreciate for valuable information.
(And I know that in MS windows also , to mount the share folders as network drive,
I must know the share name.)

Since I am not administrator of the win file server,
I can not change the structure of share directory.
And unfortunately, there are many root folders to mount.
(I hate this, but it's beyond my scope..)

And my point was:
I don't like to have so many mount points for each share folders.
I hope there be the way to manage all these share folders by one root node.
i.e. a mount folder for a file server.
( i have multiple file servers, each managed by different admins)

But as far as I know there will be no way to do this.

Actually I tried to mount all the shares at the same directory.
But it only shows the last mounted folder.

I hope there will be way to do this.

Thank you again for your kindess and
sorry about this long post..

========
After posting hereto, I got some idea.
Since what I want is just single mount point for many share folder,
I made corresponding directories under the single root dir.
( I naver hit upon this simple idea.. :( )

Anyway I did what i wanted.. thank you..

And one more trivial question. I made mount points as:

/media/server1/share1-1
/media/server1/share1-2
/media/server2/share2-1
/media/server2/share2-2
/media/server2/share2-3

and there appear 5 short cuts for all of 5 subdirectories in Desktop and file browser.
Can I make the change so that only two short cuts for two directories to appear?
(i.e. short cuts to /media/server1 and /media/server2)

dmizer
April 26th, 2007, 01:58 AM
actually, by trying to mount them all in the same folder, you might cause some issues on the server side. definitely not something i would suggest.

your mounted folders could be something like so:
/media/shared/share1
/media/shared/share2
/media/shared/share3

and that way when you open up /media/shared you would be able to view all your remote directories. don't know if that's the answer you're looking for or not, but thought it might be worth a shot.

dmizer
April 26th, 2007, 02:59 AM
And one more trivial question. I made mount points as:

/media/server1/share1-1
/media/server1/share1-2
/media/server2/share2-1
/media/server2/share2-2
/media/server2/share2-3

and there appear 5 short cuts for all of 5 subdirectories in Desktop and file browser.
Can I make the change so that only two short cuts for two directories to appear?
(i.e. short cuts to /media/server1 and /media/server2)

well, frankly ... that's not the behavior i was expecting.

1) mount your shares in a directory other than media:
/home/server1/share1-1
/home/server2/share2-1
etc ...

2) then use this command:

ln -s /home/server1/ /home/auditory/Desktop/
to create the shortcut on your desktop.

latle
May 4th, 2007, 11:00 AM
Sorry to disturb in the middle of this :-)

The problem is that I can't figure out how to make the share writeable for my non-root-user. I have only read-access with my non-root.

my fstab:
Code:


//serverko/leif /media/serverko cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

and my smbcredentials file contains my username and password for my share.

The share (a NSLU2 NAS running unslung) is reached from other boxes (winxp, vista and xbox) so all should work just fine there.

After asking in another thread, dmizer sugested to try adding rw to the fstab like this:

//serverko/leif /media/serverko cifs credentials=/root/.smbcredentials,rw,iocharset=utf8,file_mode=0777,d ir_mode=0777 0 0
But this didn't work either.

Is there another trick around?

dmizer
May 6th, 2007, 01:09 PM
**edit**
found some fantastic information on your slug here: http://www.movingtofreedom.org/2007/02/06/samba-and-the-nslu2-network-shares-in-gnu-linux/ have a good read through that page before you decide to take any action, but according to this blog, your problem is that the slug is using an older version of samba that won't work with cifs.

you can upgrade your slug to the newer version of samba, and directions are linked to on the blog. alternatively ... you might be better off enabling the nfs (linux specific) file system and mount with nfs instead of cifs. directions here: http://www.nslu2-linux.org/wiki/Optware/Nfs-utils (and seem significantly more simple than trying to reload the slug os)
**end edit**

original post content follows and is left in place for reference only

lets try something simple first.

sudo aptitude install smbfs

if that doesn't fix the problem ... just for a test, let's replace your credentials option with the actual username and password for your remote share:

//serverko/leif /media/serverko cifs username=nslu2username,password=nslu2pass,rw,iocha rset=utf8,file_mode=0777,dir_mode=0777 0 0

it might also help to make sure that you have write permissions on your mount directory like so:

sudo chmod 777 /media/serverko

the only other things i can think of here are to take a closer look at your nas device settings to make sure you have the ubuntu account added correctly. also, if you get error messages or the like, please post them here. you can try this to see error messages:

sudo umount /media/serverko
sudo mount /media/serverko

nrune
May 6th, 2007, 02:59 PM
Thanks for the How-To, Has made my life much easier!

latle
May 6th, 2007, 06:44 PM
I have to say dmizer, you do a great job for the community! I tried all the sambastuff with no luck, including upgrading the sambaserver on the slug. I decided to give the nfs a try, and after learning the basic I finally got it working! Thanks for pointing me into that direction! I should have thought of using nfs between two linux-boxes, but frankly I'm so used to samba that it didn't even cross my mind :oops:

So to others who might be stumbling upon this thread searching for: nslu2 slug unslung nas, here is what I did:
- First install nfs-utils as shown here: http://www.nslu2-linux.org/wiki/Optware/Nfs-utils
- Then I edited the /opt/etc/exports like this:
/share/flash/data/public <my_ip_range/28 ie "10.0.0.0/28 to allow all ip's from 10.0.0.1 to 10.0.0.16>(rw,sync,all_squash,anonuid=0)
- Restart the nfs-utils on the slug with the command: /opt/etc/init.d/S56nfs-utils
- Check from your ubuntubox if the shares can be reached with: showmount -e <nslu2_ip>
- Mount in fstab:

<nslu2_ip_adress>:/share/flash/data/public/ /media/<mnt_point> nfs rsize=8192,wsize=8192,timeo=14,intr (without the <> :-) )

- sudo mount -a and that was it!

I have to admit that I'm a real nfs-noob and I didn't figured out how this actually works, and how secure this method is. So if anybody has suggestions or laughs quietly of this post, pleas tell! :-)