LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-24-2017, 09:37 AM   #1
SecGuy
LQ Newbie
 
Registered: May 2017
Posts: 3

Rep: Reputation: Disabled
How do I copy files from CentOS 7.3.1611 (Core) to a Windows NFS Share


I created a bash script to backup some files on my CentOS (7.3.1611 (Core)) which are now in a tar.gz on my CentOS server. I need to copy these files from the CentOS server to a Windows Server NFS share. I tried using the command below but got an error message about wrong fs type.

Question 1: Guessing I need install cifs-utils for that to work?
Question 2: What other options are there to mount this Windows share on my CentOS box instead of using cifs-utils?


[splunk@Server321 windows]$ sudo mount -t cifs -o user=user123 //10.10.70.174/share /mnt/windows
mount: wrong fs type, bad option, bad superblock on //10.10.70.174/share,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)

In some cases useful info is found in syslog - try
dmesg | tail or so.
 
Old 05-24-2017, 10:27 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,799

Rep: Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724
1. Windows does not do NFS as a native service, you would have to load special software to present as NFS. Windows presents a share using SMB (older) or CIFS (newer). If you attempt something that either server does not support you will have problems.

2. Is your share offered using the native windows tools?
If it is, then something like smbclient from the samba package tools should work. It allows you to transfer to and from cifs/smb shares like you were using an ftp or sftp command-line file transfer tool. This does NOT require that it be mounted, but it DOES require that you have the path, authentication, server, and other options correct.

3. If you really want to mount it like that, did you check if you need the user password on the command line?

4. Did you try the mount.cifs tool as described in the messages?

5. did you check your syslog messages in /var/log and see if it looked additional information?

Last edited by wpeckham; 05-24-2017 at 10:29 AM.
 
1 members found this post helpful.
Old 05-24-2017, 10:28 AM   #3
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Did you install cifs-utils? Since you asked, the quick answer would be to try it and the package information would suggest that this maybe needed.

Code:
# yum info cifs-utils
...
Available Packages
Name        : cifs-utils
Arch        : x86_64
Version     : 6.2
Release     : 9.el7
Size        : 84 k
Repo        : base/7/x86_64
Summary     : Utilities for mounting and managing CIFS mounts
URL         : http://linux-cifs.samba.org/cifs-utils/
Licence     : GPLv3
Description : The SMB/CIFS protocol is a standard file sharing protocol widely deployed
            : on Microsoft Windows machines. This package contains tools for mounting
            : shares on Linux using the SMB/CIFS protocol. The tools in this package
            : work in conjunction with support in the kernel to allow one to mount a
            : SMB/CIFS share onto a client and use it as if it were a standard Linux
            : file system.
 
1 members found this post helpful.
Old 05-24-2017, 10:33 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,504

Rep: Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112Reputation: 4112
In addition, if running a desktop you should be able to use the file browser to browse and access windows shares without installing cifs-utils
 
1 members found this post helpful.
Old 05-24-2017, 11:31 AM   #5
SecGuy
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Follow up

Quote:
Originally Posted by wpeckham View Post
1. Windows does not do NFS as a native service, you would have to load special software to present as NFS. Windows presents a share using SMB (older) or CIFS (newer). If you attempt something that either server does not support you will have problems.

2. Is your share offered using the native windows tools?
If it is, then something like smbclient from the samba package tools should work. It allows you to transfer to and from cifs/smb shares like you were using an ftp or sftp command-line file transfer tool. This does NOT require that it be mounted, but it DOES require that you have the path, authentication, server, and other options correct.

3. If you really want to mount it like that, did you check if you need the user password on the command line?

4. Did you try the mount.cifs tool as described in the messages?

5. did you check your syslog messages in /var/log and see if it looked additional information?
My sysadmin told me that they loaded NFS on that Windows file server for those shares. With that being said, I could use either NFS or CIFS correct? Also, I would have to install either nfs-utils or the smbclient on the CentOS server correct? I like the idea of not having to mount the share so I may test out the smbclient method. Any advantage of using the NFS-UTILS over CIFS and smbclient?
 
Old 05-24-2017, 03:51 PM   #6
SecGuy
LQ Newbie
 
Registered: May 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Hey guys thanks for your help I went with the NFS client install app and all is working now.
 
Old 05-24-2017, 06:47 PM   #7
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,799

Rep: Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724Reputation: 1724
Quote:
Originally Posted by SecGuy View Post
My sysadmin told me that they loaded NFS on that Windows file server for those shares. With that being said, I could use either NFS or CIFS correct?
You clearly no longer need this information now, but the answer is "no". There is no forces relation between NFS shares and CIFS shares, so they will only match if the admin forced it that way.


I am very glad your problem is solved. Thank you for the interesting thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy file to Windows share on CentOS 6 pumtim Linux - Newbie 4 03-24-2016 05:06 AM
Want to copy files from Windows share to Linux rutpoule Linux - Newbie 2 11-02-2012 07:42 PM
Writing to NFS share leaves local copy of files Mark_667 Programming 2 06-21-2012 05:40 AM
copy files form windows app to samba share procfs General 1 07-19-2006 06:13 AM
Can I share files with Windows using NFS ? qs_tahmeed Solaris / OpenSolaris 3 01-30-2006 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration