Chinaunix首页 | 论坛 | 博客
  • 博客访问: 746232
  • 博文数量: 217
  • 博客积分: 2401
  • 博客等级: 大尉
  • 技术积分: 2030
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-16 06:58
个人简介

怎么介绍?

文章分类

全部博文(217)

文章存档

2023年(2)

2022年(3)

2021年(29)

2020年(12)

2019年(5)

2018年(5)

2017年(5)

2016年(3)

2015年(6)

2014年(12)

2013年(16)

2012年(9)

2011年(6)

2010年(15)

2009年(30)

2008年(59)

我的朋友

分类: LINUX

2015-04-09 18:54:24

http://www.cnblogs.com/qq78292959/archive/2012/05/09/2492052.html

Check which shares are available for mount

Now before you mount you can also check which shares (folders/drives) are available on your Windows machine that you can mount by giving the following command:
# smbclient -L infohighway -U kushal
where
infohighway = Name (NetBIOS Name) of my computer
kushal = Username on my Windows Machine

Password:

You will get an output similar to this:
Domain=[HOME] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Sharename Type Comment
--------- ---- -------
myshare Disk
IPC$ IPC Remote IPC
mydownloads Disk
ADMIN$ Disk Remote Admin
C$ Disk Default share
Domain=[HOME] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
Server Comment
--------- -------
Workgroup Master
--------- -------

From the above output you can see that I have shared folders called “myshare” and “mydownloads” on my Windows XP machine as highlighted in bold letters. This means that I can mount these folders on my Linux machine.

Mount the Windows Share

Now the real thing. There are two ways to mount: The traditional SMBFS or the newer CIFS. It seems that CIFS is going to replace SMBFS which will soon become obsolete. I will show you both the methods:

SMBFS Method Command (Old/Deprecated/Not Recommended):
# mount -t smbfs -o username=kushal,password=******** //infohighway/drivers /mnt/
where
kushal = Username on my Windows Machine
******* = Password for the user 'kushal'
infohighway = Name (NetBIOS Name) of my computer
drivers = Windows folder shared on my Windows XP machine
/mnt = Target mount directory on my Linux Machine

CIFS Method Command:
# mount -t cifs //infohighway/drivers /mnt/ -o username=home/kushal,password=*********
where
home = DomainName/Workgroup of your LAN network
Rest of the parameters are same as in SMBFS

Note:If you get any error messages after you give the mount command refer to the “Some typical errors” section below.

Now you can access the contents of the Windows share now by giving the command:
# ls /mnt/drivers
# ls /mnt/
audio INFCACHE.1 network Security storage video
#

Some typical errors:

You might see some typical error messages as follow in case if you missed any steps above:

Error 1:CIFS VFS: cifs_mount failed w/return code = -22

Solution:apt-get install smbfs

Error 2: smbfs: mount_data version 1919251317 is not supported

Solution:apt-get install smbfs

You can see the above error messages (if they do occur) by giving the following command just after you issue the mount command as mentioned in Step 5 above:

# dmesg | tail

Error 3: mount error 13 = Permission denied

Solution:Give the name of your Domain/Workgroup as shown in bold letter in Step 5 when mounting with CIFS method otherwise you will likely get this error message

阅读(1202) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~