Why am I getting [mount error(22): Invalid argument] while trying to mount SMB network drive?












6














Disclaimer: I am very new to Linux :)



Anyway, onward:



I have a fresh instance of Ubuntu Server (12.04.1 LTS) running on my network and I want to mount a network drive to the server so I can access the contents. The network drive is a SAMBA compatible drive running Darwin OS.



If I run the following command:



smbclient -L //192.168.0.2 -U myuser



It prompts me for the password and then displays output similar to:



Domain=[SERVER01] OS=[Darwin] Server=[@(#)PROGRAM:smbd  PROJECT:smbx-105.4.0]

Sharename Type Comment
--------- ---- -------
Comp Staff's Public Folder Disk
CompRaid03 Disk
Dropbox Disk
Groups Disk
IPC$ IPC
Public Disk
Users Disk
compstaff Disk


However, when I try and mount the CompRaid03 share, using this command:



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/myshare -o username=myuser


I get the same password prompt, but after putting the correct password in, I received this error:



mount error(22): Invalid argument



dmesg | tail returns:



[23576.037373] CIFS VFS: cifs_mount failed w/return code = -22



I don't understand what is wrong with this command. I've managed to mount a share on my current (Windows 8) machine using basically the same command but with a different IP address and share name (obviously). I've spent a good few hours trying to solve this and got no where. Any help or pointers would be greatly appreciated.



Thanks
Steve



EDIT



As suggested I've also trued using "user=" instead of "username=":



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/svnrepo -o user=myuser



This results in the same "Invalid argument" error.



EDIT 2



I feel I should add to the question that in the end I couldn't figure out what the problem was, but, I used the exact same command to mount a share on a different shared drive that was running Debian and it worked fine - I can only assume it's therefore a flaw or idiosyncrasy of the SAMBA implementation that Darwin OS is using.










share|improve this question




















  • 1




    I think it is user=myuser, not username=myuser See manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html
    – Panther
    Feb 4 '13 at 17:53












  • My only other advice is to put the user before the mount ` sudo mount -t cifs -o user=myuser //192.168.0.2/CompRaid03 /mnt/svnrepo ` , although I am not sure why order would matter.
    – Panther
    Feb 4 '13 at 18:20










  • Could you test this answer on SO? It suggests installing cifs-utils.
    – lgarzo
    Jun 26 '13 at 16:03
















6














Disclaimer: I am very new to Linux :)



Anyway, onward:



I have a fresh instance of Ubuntu Server (12.04.1 LTS) running on my network and I want to mount a network drive to the server so I can access the contents. The network drive is a SAMBA compatible drive running Darwin OS.



If I run the following command:



smbclient -L //192.168.0.2 -U myuser



It prompts me for the password and then displays output similar to:



Domain=[SERVER01] OS=[Darwin] Server=[@(#)PROGRAM:smbd  PROJECT:smbx-105.4.0]

Sharename Type Comment
--------- ---- -------
Comp Staff's Public Folder Disk
CompRaid03 Disk
Dropbox Disk
Groups Disk
IPC$ IPC
Public Disk
Users Disk
compstaff Disk


However, when I try and mount the CompRaid03 share, using this command:



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/myshare -o username=myuser


I get the same password prompt, but after putting the correct password in, I received this error:



mount error(22): Invalid argument



dmesg | tail returns:



[23576.037373] CIFS VFS: cifs_mount failed w/return code = -22



I don't understand what is wrong with this command. I've managed to mount a share on my current (Windows 8) machine using basically the same command but with a different IP address and share name (obviously). I've spent a good few hours trying to solve this and got no where. Any help or pointers would be greatly appreciated.



Thanks
Steve



EDIT



As suggested I've also trued using "user=" instead of "username=":



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/svnrepo -o user=myuser



This results in the same "Invalid argument" error.



EDIT 2



I feel I should add to the question that in the end I couldn't figure out what the problem was, but, I used the exact same command to mount a share on a different shared drive that was running Debian and it worked fine - I can only assume it's therefore a flaw or idiosyncrasy of the SAMBA implementation that Darwin OS is using.










share|improve this question




















  • 1




    I think it is user=myuser, not username=myuser See manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html
    – Panther
    Feb 4 '13 at 17:53












  • My only other advice is to put the user before the mount ` sudo mount -t cifs -o user=myuser //192.168.0.2/CompRaid03 /mnt/svnrepo ` , although I am not sure why order would matter.
    – Panther
    Feb 4 '13 at 18:20










  • Could you test this answer on SO? It suggests installing cifs-utils.
    – lgarzo
    Jun 26 '13 at 16:03














6












6








6


2





Disclaimer: I am very new to Linux :)



Anyway, onward:



I have a fresh instance of Ubuntu Server (12.04.1 LTS) running on my network and I want to mount a network drive to the server so I can access the contents. The network drive is a SAMBA compatible drive running Darwin OS.



If I run the following command:



smbclient -L //192.168.0.2 -U myuser



It prompts me for the password and then displays output similar to:



Domain=[SERVER01] OS=[Darwin] Server=[@(#)PROGRAM:smbd  PROJECT:smbx-105.4.0]

Sharename Type Comment
--------- ---- -------
Comp Staff's Public Folder Disk
CompRaid03 Disk
Dropbox Disk
Groups Disk
IPC$ IPC
Public Disk
Users Disk
compstaff Disk


However, when I try and mount the CompRaid03 share, using this command:



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/myshare -o username=myuser


I get the same password prompt, but after putting the correct password in, I received this error:



mount error(22): Invalid argument



dmesg | tail returns:



[23576.037373] CIFS VFS: cifs_mount failed w/return code = -22



I don't understand what is wrong with this command. I've managed to mount a share on my current (Windows 8) machine using basically the same command but with a different IP address and share name (obviously). I've spent a good few hours trying to solve this and got no where. Any help or pointers would be greatly appreciated.



Thanks
Steve



EDIT



As suggested I've also trued using "user=" instead of "username=":



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/svnrepo -o user=myuser



This results in the same "Invalid argument" error.



EDIT 2



I feel I should add to the question that in the end I couldn't figure out what the problem was, but, I used the exact same command to mount a share on a different shared drive that was running Debian and it worked fine - I can only assume it's therefore a flaw or idiosyncrasy of the SAMBA implementation that Darwin OS is using.










share|improve this question















Disclaimer: I am very new to Linux :)



Anyway, onward:



I have a fresh instance of Ubuntu Server (12.04.1 LTS) running on my network and I want to mount a network drive to the server so I can access the contents. The network drive is a SAMBA compatible drive running Darwin OS.



If I run the following command:



smbclient -L //192.168.0.2 -U myuser



It prompts me for the password and then displays output similar to:



Domain=[SERVER01] OS=[Darwin] Server=[@(#)PROGRAM:smbd  PROJECT:smbx-105.4.0]

Sharename Type Comment
--------- ---- -------
Comp Staff's Public Folder Disk
CompRaid03 Disk
Dropbox Disk
Groups Disk
IPC$ IPC
Public Disk
Users Disk
compstaff Disk


However, when I try and mount the CompRaid03 share, using this command:



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/myshare -o username=myuser


I get the same password prompt, but after putting the correct password in, I received this error:



mount error(22): Invalid argument



dmesg | tail returns:



[23576.037373] CIFS VFS: cifs_mount failed w/return code = -22



I don't understand what is wrong with this command. I've managed to mount a share on my current (Windows 8) machine using basically the same command but with a different IP address and share name (obviously). I've spent a good few hours trying to solve this and got no where. Any help or pointers would be greatly appreciated.



Thanks
Steve



EDIT



As suggested I've also trued using "user=" instead of "username=":



sudo mount -t cifs //192.168.0.2/CompRaid03 /mnt/svnrepo -o user=myuser



This results in the same "Invalid argument" error.



EDIT 2



I feel I should add to the question that in the end I couldn't figure out what the problem was, but, I used the exact same command to mount a share on a different shared drive that was running Debian and it worked fine - I can only assume it's therefore a flaw or idiosyncrasy of the SAMBA implementation that Darwin OS is using.







mount samba






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 13 '14 at 13:49

























asked Feb 4 '13 at 17:40









Steve Whitfield

131113




131113








  • 1




    I think it is user=myuser, not username=myuser See manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html
    – Panther
    Feb 4 '13 at 17:53












  • My only other advice is to put the user before the mount ` sudo mount -t cifs -o user=myuser //192.168.0.2/CompRaid03 /mnt/svnrepo ` , although I am not sure why order would matter.
    – Panther
    Feb 4 '13 at 18:20










  • Could you test this answer on SO? It suggests installing cifs-utils.
    – lgarzo
    Jun 26 '13 at 16:03














  • 1




    I think it is user=myuser, not username=myuser See manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html
    – Panther
    Feb 4 '13 at 17:53












  • My only other advice is to put the user before the mount ` sudo mount -t cifs -o user=myuser //192.168.0.2/CompRaid03 /mnt/svnrepo ` , although I am not sure why order would matter.
    – Panther
    Feb 4 '13 at 18:20










  • Could you test this answer on SO? It suggests installing cifs-utils.
    – lgarzo
    Jun 26 '13 at 16:03








1




1




I think it is user=myuser, not username=myuser See manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html
– Panther
Feb 4 '13 at 17:53






I think it is user=myuser, not username=myuser See manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html
– Panther
Feb 4 '13 at 17:53














My only other advice is to put the user before the mount ` sudo mount -t cifs -o user=myuser //192.168.0.2/CompRaid03 /mnt/svnrepo ` , although I am not sure why order would matter.
– Panther
Feb 4 '13 at 18:20




My only other advice is to put the user before the mount ` sudo mount -t cifs -o user=myuser //192.168.0.2/CompRaid03 /mnt/svnrepo ` , although I am not sure why order would matter.
– Panther
Feb 4 '13 at 18:20












Could you test this answer on SO? It suggests installing cifs-utils.
– lgarzo
Jun 26 '13 at 16:03




Could you test this answer on SO? It suggests installing cifs-utils.
– lgarzo
Jun 26 '13 at 16:03










3 Answers
3






active

oldest

votes


















3














0 down vote



I have found a solution. Add the option sec=ntlm - this works both in a manual mount and from fstab



The fstab entry is now -
Network USB Drive - ie the USB Flash Drive connected to the Modem



//192.168.0.1/USB /home/user/USB cifs sec=ntlm,uid=1000,gid=1000,guest,_netdev 0 0



Based with Thanks from http://ubuntuforums.org/showthread.php?t=2139090






share|improve this answer





























    1














    On RHEL I had to edit file /etc/request-key.conf and add these 2 rows at the end of the file.



    create       cifs.spnego    * * /usr/sbin/cifs.upcall -c %k
    create dns_resolver * * /usr/sbin/cifs.upcall %k





    share|improve this answer





























      0














      One possible reason: system can't resolve server name.

      I got below error when mounting shared folder.




      #sudo mount -a
      mount error(22): Invalid argument
      Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


      /var/log/kern.log:
      enter image description here




      Edit /etc/resolv.conf, add search "server", issue solved.
      enter image description here






      share|improve this answer





















        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f251283%2fwhy-am-i-getting-mount-error22-invalid-argument-while-trying-to-mount-smb-n%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        3














        0 down vote



        I have found a solution. Add the option sec=ntlm - this works both in a manual mount and from fstab



        The fstab entry is now -
        Network USB Drive - ie the USB Flash Drive connected to the Modem



        //192.168.0.1/USB /home/user/USB cifs sec=ntlm,uid=1000,gid=1000,guest,_netdev 0 0



        Based with Thanks from http://ubuntuforums.org/showthread.php?t=2139090






        share|improve this answer


























          3














          0 down vote



          I have found a solution. Add the option sec=ntlm - this works both in a manual mount and from fstab



          The fstab entry is now -
          Network USB Drive - ie the USB Flash Drive connected to the Modem



          //192.168.0.1/USB /home/user/USB cifs sec=ntlm,uid=1000,gid=1000,guest,_netdev 0 0



          Based with Thanks from http://ubuntuforums.org/showthread.php?t=2139090






          share|improve this answer
























            3












            3








            3






            0 down vote



            I have found a solution. Add the option sec=ntlm - this works both in a manual mount and from fstab



            The fstab entry is now -
            Network USB Drive - ie the USB Flash Drive connected to the Modem



            //192.168.0.1/USB /home/user/USB cifs sec=ntlm,uid=1000,gid=1000,guest,_netdev 0 0



            Based with Thanks from http://ubuntuforums.org/showthread.php?t=2139090






            share|improve this answer












            0 down vote



            I have found a solution. Add the option sec=ntlm - this works both in a manual mount and from fstab



            The fstab entry is now -
            Network USB Drive - ie the USB Flash Drive connected to the Modem



            //192.168.0.1/USB /home/user/USB cifs sec=ntlm,uid=1000,gid=1000,guest,_netdev 0 0



            Based with Thanks from http://ubuntuforums.org/showthread.php?t=2139090







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 20 '13 at 13:43









            dr_smit

            18415




            18415

























                1














                On RHEL I had to edit file /etc/request-key.conf and add these 2 rows at the end of the file.



                create       cifs.spnego    * * /usr/sbin/cifs.upcall -c %k
                create dns_resolver * * /usr/sbin/cifs.upcall %k





                share|improve this answer


























                  1














                  On RHEL I had to edit file /etc/request-key.conf and add these 2 rows at the end of the file.



                  create       cifs.spnego    * * /usr/sbin/cifs.upcall -c %k
                  create dns_resolver * * /usr/sbin/cifs.upcall %k





                  share|improve this answer
























                    1












                    1








                    1






                    On RHEL I had to edit file /etc/request-key.conf and add these 2 rows at the end of the file.



                    create       cifs.spnego    * * /usr/sbin/cifs.upcall -c %k
                    create dns_resolver * * /usr/sbin/cifs.upcall %k





                    share|improve this answer












                    On RHEL I had to edit file /etc/request-key.conf and add these 2 rows at the end of the file.



                    create       cifs.spnego    * * /usr/sbin/cifs.upcall -c %k
                    create dns_resolver * * /usr/sbin/cifs.upcall %k






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 12 '15 at 8:46









                    Elia Oggian

                    111




                    111























                        0














                        One possible reason: system can't resolve server name.

                        I got below error when mounting shared folder.




                        #sudo mount -a
                        mount error(22): Invalid argument
                        Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


                        /var/log/kern.log:
                        enter image description here




                        Edit /etc/resolv.conf, add search "server", issue solved.
                        enter image description here






                        share|improve this answer


























                          0














                          One possible reason: system can't resolve server name.

                          I got below error when mounting shared folder.




                          #sudo mount -a
                          mount error(22): Invalid argument
                          Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


                          /var/log/kern.log:
                          enter image description here




                          Edit /etc/resolv.conf, add search "server", issue solved.
                          enter image description here






                          share|improve this answer
























                            0












                            0








                            0






                            One possible reason: system can't resolve server name.

                            I got below error when mounting shared folder.




                            #sudo mount -a
                            mount error(22): Invalid argument
                            Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


                            /var/log/kern.log:
                            enter image description here




                            Edit /etc/resolv.conf, add search "server", issue solved.
                            enter image description here






                            share|improve this answer












                            One possible reason: system can't resolve server name.

                            I got below error when mounting shared folder.




                            #sudo mount -a
                            mount error(22): Invalid argument
                            Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


                            /var/log/kern.log:
                            enter image description here




                            Edit /etc/resolv.conf, add search "server", issue solved.
                            enter image description here







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 2 days ago









                            Fisher

                            1084




                            1084






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f251283%2fwhy-am-i-getting-mount-error22-invalid-argument-while-trying-to-mount-smb-n%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                How to make a Squid Proxy server?

                                Is this a new Fibonacci Identity?

                                19世紀