Linux: connect to Windows share via terminal

Associate
Joined
19 Jun 2003
Posts
1,680
Location
West Yorks, UK
Hi all,
I am trying to use a Ubuntu Live CD to copy data from an old PC's hard drive onto a shared Windows folder on my network. I can connect to the share using Nautilus fine, and can drag and drop the files onto it from the old PC. However, the transfers keep timing out or getting interrupted. I want the flexibility offered by the cp command in the terminal.

Sooooo, how can I connect to a Windows Shared folder (XP Pro machine) via the terminal to copy files across?

Cheers,
Matt
 
I'd do something like this

Code:
mkdir /mnt/windows
mount.cifs //server/share /mnt/windows -o username=you,dom=workgroup
rsync -av /mnt/windows/folder/ /where/to/put/files/

The advantage of rsync is that it'll carry on where it left off, if interrupted.

For single files you can use smbclient:

smbclient //server/share -U username -W workgroup
 
matja, thanks - that looks great. I can't try it just yet, but will tomorrow morning. Is mount.cifs a typo? I thought it could only be done as mount -t cifs.

Matt
 
'mount -t cifs' will work too :) the actual program name is mount.cifs, no difference except less typing :)

It's part of newer versions of Samba, which I'd guess that the Ubuntu live-cd should have, although I have never personally used that live-cd.
If mount.cifs doesn't work, it should have smbmount, which will work for mounting a share from Windows XP (smbmount has troubles with shares from Windows 2003 server unless you modify the policy settings a little)
 
M0KUJ1N said:
they're equivalent. mount -t cifs simply calls mount.cifs (it's all in man mount :eek: oo-err missus)
Reminds me when a friend asked "Where is the help file for mounting drives?" so I told him "You need to do a man mount."

Took about 10mins for him to be convinced I was telling the truth and not just on a silly wind up.
 
Hum, odd. The Ubuntu 6.06 Live CD does not have mount.cifs installed - I can't mount shares using the -t cifs method either.

Are there any alternatives ways to rsync data across from the hard drive to the Windows share? I had a look at smbclient, but couldn't quite work out how to transfer files.

Alternatively, how can I get hold of mount.cifs for the Live CD? Or, do you know of any Linux Live CD's that can mount hfsplus filesystems, and cifs?

Cheers,
Matt
 
Back
Top Bottom