From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roger Brooks" Subject: RE: Unable to mount using credentials file Date: Tue, 4 Nov 2014 14:31:25 +0100 Message-ID: <000601cff833$a28ec5c0$e7ac5140$@ieee.org> References: <00bc01cff5ef$e5361770$afa24650$@ieee.org> <000001cff685$0d849630$288dc290$@ieee.org> <001501cff6bd$292e5d70$7b8b1850$@ieee.org> <5456C316.90308@kukkukk.com> <000c01cff738$a265e610$e731b230$@ieee.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE To: Return-path: In-Reply-To: Content-Language: de-ch Sender: linux-cifs-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Actually neither mount nor mount.cifs could resolve the computer name u= ntil I added wins to /etc/nsswitch.conf. After I did so, neither had any difficulty mounting volumes by computer= name instead of by IP address. Your prediction is correct, however, concerning mount commands without = credentials on the command line. In that case mount fails with "Invalid argument", whereas mount.cifs pr= ompts for a password. Unfortunately, mount does not seem to be looking for mount.cifs in /sbi= n. I was afraid of moving mount.cifs from where Synology puts it, so I add= ed a softlink (with privileges 777) in /sbin to /usr/syno/bin/mount.cif= s, but the behaviour of mount remains unchanged. Why would mount require a fixed location for mount.cifs? Why wouldn't = it just search the PATH? IAC, I can just call mount.cifs directly. -----Original Message----- =46rom: Steve French [mailto:smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]=20 Sent: Monday, November 3, 2014 3:40 PM To: Roger Brooks Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Subject: Re: Unable to mount using credentials file Makes sense - it looks like it sis simply not finding mount.cifs so in = your case you will want to call mount.cifs directly or move it into /sb= in One way to think about this is that if you don't have mount.cifs (or if= it is not in the path, usually /sbin/mount.cifs, where mount is lookin= g for it) then the mount command will pass the mount options directly t= o the kernel (cifs.ko) without parsing them. This is ok for something = like: mount -t cifs //192.168.0.101/sharename /mnt -o username=3Dmyuse= r,password=3Dmypassword but won't work when you pass in something which has to be resolved in u= serspace berfore getting to the kernel. In particular it won't work if= you have - a credential file (since mount.cifs has to open that), or i= f you mount using a tcp name of the server (instead of using the server= 's ip address) e.g. mount -t cifs //myserver/myshare /mnt instead of mo= unt -t cifs //ip-address/myshare and will also fail if you don't specif= y the password (because mount won't prompt for a password if missing). Most of the work in mount is done in kernel (at least for the case of cifs) but opening credential files, looking u= p hostnames and prompting for the password are exceptions. On Mon, Nov 3, 2014 at 1:34 AM, Roger Brooks wrot= e: > Sorry, Gunter, I don't have strace: > > -ash: strace: not found > > mount.cifs is located at: > > /usr/syno/bin/mount.cifs > > I suspect that the installed version of mount (from BusyBox 1.16) is = too old to correctly handle "-o credentials=3D". > I will try installing a newer version (BusyBox 1.21) and report back = later. > > However, this no longer has a high priority for me, as I can live wit= h calling mount.cifs directly. > > @Steve, > mount.cifs is only v5.5 in my installation, but since calling it dire= ctly works fine, I presume that the problem lies with the BusyBox versi= on of mount and not with mount.cifs. > Since mount works with "-o username=3D,password=3D", = I presume that it is finding mount.cifs, but is not passing "-o credent= ials=3D" correctly. > > Thanks for all of your help! > > -----Original Message----- > From: G=C3=BCnter Kukkukk [mailto:linux-KQewbsS9MvBBDgjK7y7TUQ@public.gmane.org] > Sent: Monday, November 3, 2014 12:50 AM > To: Roger Brooks; linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Subject: Re: Unable to mount using credentials file > > Am 02.11.2014 um 17:50 schrieb Roger Brooks: >> Here is the output from mount -t cifs --verbose -o ... for the faili= ng case: >> mount: mounting /// on /mnt// failed: >> Invalid argument There is still no output when I add --verbose to th= e successful case. >> There is no verbose option listed for mount --help. >> Thanks for your help. > > you can also try strace (hopefully available) like: > > strace -f mount -t cifs --verbose //server/share /mnt -o ..... > > look, whether mount.cifs is found or not. > > Btw - where is your mount.cifs installed (absolute path)? > > Cheers, G=C3=BCnter > >> >> -----Original Message----- >> From: Steve French [mailto:smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] >> Sent: Sunday, November 2, 2014 5:30 PM >> To: Roger Brooks >> Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >> Subject: Re: Unable to mount using credentials file >> >> mount with call mount.cifs (if it is present in /sbin) when you spec= ify "mount -t cifs" >> >> You can specify --verbose before the -o (see >> http://linux.die.net/man/8/mount.cifs) and it will show the mount=20 >> options being passed in to the kernel syscall so it would be useful=20 >> for debugging to compare the exact parameters being passed in to the= =20 >> kernel in the working vs. failing case by specifying --verbose befor= e=20 >> the -o >> >> On Sun, Nov 2, 2014 at 4:09 AM, Roger Brooks w= rote: >>> P.S. To answer my own question below, experimentation shows that mo= unt and umount still fulfill their normal functions for volumes mounted= directly with mount.cifs. >>> So, much as it irritates me not to know why mount -o credentials do= esn't work, I can live with using mount.cifs instead. >>> Thanks to all who responded! >>> >>> Thanks for the tips, Steve! >>> >>> My version of mount: >>> BusyBox v1.16.1 (2014-10-10 08:37:09 CST) multi-call binary. >>> does not appear to have a verbose option. At least: >>> mount --help >>> does not list any such option, and mount does not return any inform= ation to the console when it succeeds, regardless of whether or not I s= pecify -v. >>> >>> The failure message is also unchanged with the -v option: >>> mount: mounting /// on /mnt/ failed: >>> Invalid argument >>> >>> Also, I have read that mount maintains /etc/mtab. >>> Does that mean that mount will not list volumes which I mounted dir= ectly with mount.cifs, and that I cannot use umount to unmount volumes = mounted directly with mount.cifs? >>> >>> -----Original Message----- >>> From: Steve French [mailto:smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] >>> Sent: Saturday, November 1, 2014 5:24 PM >>> To: Roger Brooks >>> Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >>> Subject: Re: Unable to mount using credentials file >>> >>> using /sbin/mount.cifs directly should be fine. When you mount wi= th >>> verbose mount option does it show any useful differences between th= e=20 >>> two cases (working vs. failing) >>> >>> On Sat, Nov 1, 2014 at 11:21 AM, Roger Brooks = wrote: >>>> P.S. >>>> There was a non-printing character in the directory name under /ro= ot. >>>> After correcting that, mount.cifs -o credentials=3D work= s. >>>> However, mount -t cifs -o credentials=3D still returns "= Invalid argument". >>>> Can I just use mount.cifs directly, or does mount perform some add= itional needed housekeeping? >>>> If mount is needed, how can I get -o credentials to work? >>>> TIA for any tips! >>>> >>>> Hi Benjamin, >>>> >>>> Thanks for responding. >>>> >>>> The credentials file is a simple text file created with vi contain= ing the lines: >>>>>> >>>> username=3D >>>> password=3D >>>> << >>>> I have tried this both with and without trailing newline at the en= d of the second line. >>>> >>>> I have also tried the variant: >>>>>> >>>> username=3D >>>> password=3D >>>> domain=3D >>>> << >>>> >>>> The results are always the same. >>>> If there is a problem with the *content* of the file, why would th= e error message say that the file could not be opened? >>>> >>>> Thanks for your help! >>>> Best Regards, >>>> Roger >>>> >>>> From: Benjamin Bellec [mailto:b.bellec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org] >>>> Sent: Saturday, November 1, 2014 1:34 PM >>>> To: Roger Brooks >>>> Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org >>>> Subject: Re: Unable to mount using credentials file >>>> >>>> Hi, >>>> Does your credential file is correctly formatted ? >>>> >>>> 2014-11-01 13:03 GMT+01:00 Roger Brooks : >>>> I am attempting to mount Windows volumes on a Synology DS (running= DSM 5.0, a Debian-based distribution). >>>> Command lines of the form: >>>> mount -t cifs -o username=3D,password=3D ///share/ /mnt/ succeed. >>>> However, command lines of the form: >>>> mount -t cifs -o credentials=3D ///share/ /m= nt/ fail with the error "Invalid argument". >>>> For diagnostic purposes, I have attempted to mount the volumes dir= ectly using mount.cifs (v5.5). >>>> Once again, commands of the form: >>>> mount.cifs /// /mnt// -o=20 >>>> username=3D,password=3D >>>> succeed. >>>> However, commands of the form: >>>> mount.cifs /// /mnt// -o credential= s=3D fail with the error message: >>>> error -1 (Unknown error 4294967295) opening credential file = =20 >>>> This is the case regardless of the location of the file (see >>>> http://samba.2283325.n4.nabble.com/Error-s-opening-credentials-fil= e >>>> - >>>> t >>>> d >>>> 2518214.html) or its privileges. The error persists, even when th= e=20 >>>> command is executed from a root session and the credentials file h= as permissions 0777 and is in a subdirectory of /root. >>>> How can I get mount to work using a credentials file? >>>> >>>> >>>> >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe linux-ci= fs" >>>> in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More=20 >>>> majordomo info at http://vger.kernel.org/majordomo-info.html >>>> >>>> >>>> -- >>>> To unsubscribe from this list: send the line "unsubscribe linux-ci= fs" >>>> in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More=20 >>>> majordomo info at http://vger.kernel.org/majordomo-info.html >>> >>> >>> >>> -- >>> Thanks, >>> >>> Steve >>> >>> -- >>> To unsubscribe from this list: send the line "unsubscribe linux-cif= s" >>> in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordom= o=20 >>> info at http://vger.kernel.org/majordomo-info.html >> >> >> >> -- >> Thanks, >> >> Steve >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-cifs= " >> in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo= =20 >> info at http://vger.kernel.org/majordomo-info.html >> > > > -- > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-cifs"= =20 > in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo=20 > info at http://vger.kernel.org/majordomo-info.html -- Thanks, Steve