Advertisements

Dirty and fast way to mount a Windows shared folder

Here is a dirty and fast way to mount a Windows shared folder:

  • Check what the Windows server is providing with smbclient:

root@linux:/ # smbclient –L <hostname> -W <domain> -U <user>

root@linux:/ # smbclient -L CORESERVER -W WINLLAB -U nimda
Password:
Domain=[WINLAB] OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows Server 2003 5.2]

Sharename Type Comment
——— —- ——-
C$ Disk Default share
F$ Disk Default share
IPC$ IPC Remote IPC
Resources$ Disk “Event logging files”
ADMIN$ Disk Remote Admin
Address Disk “Access to address objects”
Domain=[WINLAB] OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows Server 2003 5.2]

Server Comment
——— ——-
CORESERVER2 DC / DHCP / WINS / DNS /PS
CORESERVER3 LCS [ST : ]
CORESERVER EXCHANGE [ST : CV1FX81]

Workgroup Master
——— ——-
SYSADM
MYGROUP SERVERCORE

  • Mounting the Windows Shared folder on RHEL5

root@linux:/ # mount -t cifs <hostname>:<share> <mount point on Linux> -ousername=<username>,domain=<domain>

root@linux:/ # mount -t cifs CORESERVER:F\$ /mnt/temp -ousername=nimda,domain=WINLAB
Password:

# cd /mnt/temp
# ls -lh
total 27G
drwxrwxrwx 1 root root 0 Jan 31 08:52 Arquivos
-rwxrwSrwt 1 root root 214M Feb 27 16:40 CD_sun4u_sparcv9__marTux_0.2__small_naked_demo_cd_bs512b.iso.bz2
-rwxrwSrwt 1 root root 2.3G Nov 19 16:33 CentOS-4.6-i386-binDVD.iso
-rwxrwSrwt 1 root root 3.6G Nov 24 19:31 CentOS-5.1-i386-bin-DVD.iso
-rwxrwSrwt 1 root root 5.6G Jan 15 14:47 eis-dvd.ISO
-rwxrwSrwt 1 root root 3.2G Nov 2 14:05 Fedora-8-i386-DVD.iso
-rwxrwSrwt 1 root root 647M Feb 14 07:22 in-preview2.iso
-rwxrwSrwt 1 root root 630M Nov 1 01:52 in-preview.iso
-rwxrwSrwt 1 root root 1.4G Feb 11 08:37 n1sm-1.3.3-ga-linux-x86.iso
-rwxrwSrwt 1 root root 251M Feb 15 12:07 oracle-xe-univ-10.2.0.1-1.0.i386.rpm
-rwxrwSrwt 1 root root 2.2G Feb 12 10:37 RHEL4.6-i386-AS-DVD.iso
-rwxrwSrwt 1 root root 3.4G Jan 21 14:03 sol-nv-b70b-x86-dvd.iso
-rwxrwSrwt 1 root root 932M Feb 6 13:50 SunSXDE108-1.zip
-rwxrwSrwt 1 root root 1.3G Feb 6 13:07 SunSXDE108-2.zip
-rwxrwSrwt 1 root root 338M Jun 28 2007 sxrt5.0x64_x86_5.0x64a.dvd2.tar.gz
-rwxrwSrwt 1 root root 163M Jan 6 14:46 systemrescuecd-x86-0.4.2.iso
-rwxrwSrwt 1 root root 394M Feb 28 09:15 ubuntu-6.06.2-server-sparc.iso
-rwxrwSrwt 1 root root 473M Feb 27 08:06 ubuntu-7.10-server-sparc.iso
-rwxrwSrwt 1 root root 101M Feb 15 11:53 VMware-server-1.0.4-56528.i386.rpm
-rwxrwSrwt 1 root root 147M Dec 26 13:21 VMware-server-installer-1.0.4-56528.exe

  • Using smbmount to mount a Windows shared folder. Deprecated in RHEL5 (no more smbfs, cifs available) and available for up to RHEL4

root@linux:/ # smbmount //<hostname>/<share> <mount point on Linux> -o username=<username>

root@linux:/ # smbmount //SERVERCORE/F$ /mnt/temp -o username=nimda/WINLAB
Password:

root@linux:/ # cd /mnt/temp
root@linux:/ # ls -lh
total 27G
drwxrwxrwx 1 root root 0 Jan 31 08:52 Arquivos
-rwxrwSrwt 1 root root 214M Feb 27 16:40 CD_sun4u_sparcv9__marTux_0.2__small_naked_demo_cd_bs512b.iso.bz2
-rwxrwSrwt 1 root root 2.3G Nov 19 16:33 CentOS-4.6-i386-binDVD.iso
-rwxrwSrwt 1 root root 3.6G Nov 24 19:31 CentOS-5.1-i386-bin-DVD.iso
-rwxrwSrwt 1 root root 5.6G Jan 15 14:47 eis-dvd.ISO
-rwxrwSrwt 1 root root 3.2G Nov 2 14:05 Fedora-8-i386-DVD.iso
-rwxrwSrwt 1 root root 647M Feb 14 07:22 in-preview2.iso
-rwxrwSrwt 1 root root 630M Nov 1 01:52 in-preview.iso
-rwxrwSrwt 1 root root 1.4G Feb 11 08:37 n1sm-1.3.3-ga-linux-x86.iso
-rwxrwSrwt 1 root root 251M Feb 15 12:07 oracle-xe-univ-10.2.0.1-1.0.i386.rpm
-rwxrwSrwt 1 root root 2.2G Feb 12 10:37 RHEL4.6-i386-AS-DVD.iso
-rwxrwSrwt 1 root root 3.4G Jan 21 14:03 sol-nv-b70b-x86-dvd.iso
-rwxrwSrwt 1 root root 932M Feb 6 13:50 SunSXDE108-1.zip
-rwxrwSrwt 1 root root 1.3G Feb 6 13:07 SunSXDE108-2.zip
-rwxrwSrwt 1 root root 338M Jun 28 2007 sxrt5.0x64_x86_5.0x64a.dvd2.tar.gz
-rwxrwSrwt 1 root root 163M Jan 6 14:46 systemrescuecd-x86-0.4.2.iso
-rwxrwSrwt 1 root root 394M Feb 28 09:15 ubuntu-6.06.2-server-sparc.iso
-rwxrwSrwt 1 root root 473M Feb 27 08:06 ubuntu-7.10-server-sparc.iso
-rwxrwSrwt 1 root root 101M Feb 15 11:53 VMware-server-1.0.4-56528.i386.rpm
-rwxrwSrwt 1 root root 147M Dec 26 13:21 VMware-server-installer-1.0.4-56528.exe

Advertisements
%d bloggers like this: