Page 1 of 1

Connect to Windows Shares?

Posted: 25 Feb 2012, 09:41
by nickh
Last weekend I was replacing an antique PC with a brand new Win7 laptop. What I was going to do was copy the whole old PC to a folder on the new one using Porteus. The idea of using Porteus is that Windows locks some of its own files and they don't then copy. The target machine was a Win7 laptop. On the Win7 laptop I had a share which the old WinXP machine could connect to without a password. I successfully copied over one partition WinXP -> Win7, so the share works. I then booted the old laptop off Porteus (1.0 as it would not do a USB boot where I had 1.1). Try how I might I could not connect to the WinXP box, or, at least, every time I tried to connect I was prompted for a username and password. Since there were none required this always failed. I also tried the user name of the Win7 user (password not required) and I failed again. I tried Guest, I temporarily set a password on the user account and so on and I failed every time.

Typically I was trying to connect with smb://192.168.10.100/OldLaptop, either through the remote places or directly in konquerer. I also tried using samba shares but this failed for another reason (something not running). Was I doing anything wrong? How can I connect to a Win7 share?

Re: Connect to Windows Shares?

Posted: 25 Feb 2012, 10:01
by fanthom
@nickh

create your share on Windows box with lower case and try these commands in terminal:

Code: Select all

mkdir /mnt/oldpc
mount.smb //192.168.10.100/oldpc /mnt/oldpc -o guest
if that wont work then create new user (let's say nickh) without password and then:

Code: Select all

mkdir /mnt/oldpc
mount.cifs //192.168.10.100/oldpc /mnt/oldpc -o user=nickh,password=
let us know about the errors you get (if any).

Re: Connect to Windows Shares?

Posted: 25 Feb 2012, 10:59
by nickh
Using 1.1 now.

1 - mount.smb command does not exist
2 - error is :

Code: Select all

mount.cifs //192.168.2.100/sharetest /mnt/pc -o user=nick,password=
mount error 5 = Input/output error
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
This is using a specially created share on my own PC and I have no password on the account. I've tried setting PASSWD to nothing but it did not help.

Re: Connect to Windows Shares?

Posted: 25 Feb 2012, 11:53
by fanthom
@nickh
was trying to search google for 'mount.cifs mount error 5 = Input/output error' string but got too many hits with different resolutions.
let's forget about Windows, samba and do it the 'porteus way'

a) boot Porteus on Win7 notebook with 'copy2ram' and 'toroot' cheatcodes (so you will be able to use the stick/cd on second laptop)
b) once you log in please make sure you have connection with the router then run following command:

Code: Select all

sh /etc/rc.d/rc.sshd start
(this command will start ssh server)
c) run 'ifconfig' and note ip address of this PC
d) boot Porteus on older laptop with 'toroot' cheat, make sure you have connection with the router then run following commands:

Code: Select all

mkdir /mnt/win7
sshfs 192.168.2.xxx:/mnt /mnt/win7
password is 'toor' (default root's password in porteus unless you have changed it)
now you can copy all data to win7 share. you can use mc, konqueror, etc.. but the best idea is to create a tar archive to make sure all data will be copied despite of upper/lower case, non english characters, permissions. please run (while still being on older laptop):

Code: Select all

tar czfv /mnt/win7/sdXY/archive.tar.gz /mnt/partition_you_want_to_backup/*
now all data from old laptop partition (or folder) will be transferred to win7 laptop on sdXY partition.

if you succeed with this task then please write a HOWTO for using Porteus as the only tool to copy data across the network.

btw: on Monday i'll try to find what's wrong with mount.cifs in Porteus.

Re: Connect to Windows Shares?

Posted: 26 Feb 2012, 12:16
by nickh
Plonker alert.

Everything appears to be working now with smb:// and mount.cifs (and mount -t cifs ....). In my test here I forgot to allow blank passwords (an extra setting in Win7).

The mount.cifs command with no user and password on the command line prompts for a password but <enter> is accepted.

I wonder if the mount -t cifs succeeding allowed the smb:// to succeed? I am not going to be able to set up a test to the original target machine for a while now as it is 50 miles away.

Posted after 22 hours 13 minutes 32 seconds:
I've managed to test with the remote PC down the VPN. I can never get smb:// to work but both "mount.cifs" and "mount -t cifs" both work with no user and <enter> when prompted for a password. I guess smb:// is just the wrong protocol/method to use, but it is fine for accessing my fileserver running samba.