Page 2 of 137 FirstFirst 12341252102 ... LastLast
Results 11 to 20 of 1362

Thread: Mount samba shares with utf8 encoding using cifs

  1. #11
    Join Date
    Nov 2006
    Beans
    6
    Distro
    Ubuntu 6.06 Dapper

    Re: Mount samba shares with utf8 encoding using cifs

    [quote]narky kicks himself in the head with a

    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:
    Code:
    sudo mount -t cifs   //192.168.0.2/music /media/music -o user=*****,password=*****,domain=*****
    Looking good... (see bottom line)
    Code:
    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/Se...ight=%28nfs%29
    and the instructions for a manual mount:
    Code:
    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:
    Code:
    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
    Attached Images Attached Images
    Last edited by narky; November 4th, 2006 at 08:44 AM.

  2. #12
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Mount samba shares with utf8 encoding using cifs

    -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:
    Code:
    sudo mount -t cifs   //192.168.0.2/music /media/music -o user=*****,password=*****,domain=*****,file_mode=0777,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!
    Last edited by dmizer; November 4th, 2006 at 09:32 AM.

  3. #13
    Join Date
    Nov 2006
    Beans
    6
    Distro
    Ubuntu 6.06 Dapper

    Re: Mount samba shares with utf8 encoding using cifs

    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.
    Attached Images Attached Images
    Last edited by narky; November 4th, 2006 at 10:27 AM.

  4. #14
    Join Date
    Nov 2006
    Beans
    6
    Distro
    Ubuntu 6.06 Dapper

    Re: Mount samba shares with utf8 encoding using cifs

    dmizer!

    hey it works! ... [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! (see screenshot from before)

    It's SO much better than smbfs , 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.

  5. #15
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Mount samba shares with utf8 encoding using cifs

    Quote Originally Posted by narky View Post
    dmizer!

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

  6. #16
    Join Date
    Jul 2006
    Location
    Southern California
    Beans
    494
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Mount samba shares with utf8 encoding using cifs

    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).

    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?
    "He who lives by the penguin, dies by the penguin."
    (at least 'till he figures out what he's doing!)

  7. #17
    Join Date
    Jul 2006
    Location
    Southern California
    Beans
    494
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: Mount samba shares with utf8 encoding using cifs

    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!)
    "He who lives by the penguin, dies by the penguin."
    (at least 'till he figures out what he's doing!)

  8. #18
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Mount samba shares with utf8 encoding using cifs

    Quote Originally Posted by wilberfan View Post
    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).

    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

    Quote Originally Posted by wilberfan View Post
    In this command:

    Code:
    //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:
    Code:
    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.
    Last edited by dmizer; November 7th, 2006 at 05:26 AM.

  9. #19
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Mount samba shares with utf8 encoding using cifs

    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):
    Code:
    [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
    Last edited by dmizer; November 20th, 2006 at 02:22 AM.

  10. #20
    Join Date
    Mar 2006
    Location
    Toronto, Canada
    Beans
    855

    Re: Mount samba shares with utf8 encoding using cifs

    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.

    Code:
    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.

    Code:
    #!/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
    Last edited by adamkane; November 7th, 2006 at 05:42 AM.

Page 2 of 137 FirstFirst 12341252102 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •