How to mount and access the windows shared directory in Centos6.4

Source: Internet
Author: User
Tags character set


Syntax: mount-t type-o mount mode source path target path
 
-T detailed options:
 
CD or CD Image: iso9660
DOS fat16 file system: msdos
Windows 9x fat32 file system: vfat
Windows NT ntfs file system: ntfs
Mount Windows File network sharing: Recommended cifs for smbfs (kernel support required)
Network sharing for UNIX (LINUX) files: nfs
 
-O detailed options:
 
Loop: used to connect a file to the system as a hard disk partition.
Ro: mounting a device in read-only mode
Rw: mounting a device in read/write mode
Iocharset: specifies the character set used to access the file system, for example, iocharset = utf8
Remount: remount
 

The core of Windows network sharing is SMB/CIFS. samba is required to mount windows Disk sharing in linux. But don't worry. Most popular linux distributions have installed samba packages by default.

1. Create a directory for mount point)

# Mkdir-p/mnt/test

2. mount the windows shared directory with mount. The format is as follows:

# Mount [-t vfstype] [-o options] device dir

Where:

1)-t vfstype specifies the type of the file system, which is usually not required. Mount automatically selects the correct type. Common types include:

CD or CD Image: iso9660

DOS fat16 file system: msdos

Windows 9x fat32 file system: vfat

Windows NT ntfs file system: ntfs

Mount Windows File network sharing: smbfs

Network sharing for UNIX (LINUX) files: nfs

2)-o options is mainly used to describe how a device or file is mounted. Common parameters include:

Loop: used to mount a file to a system as a hard disk partition.

Ro: mounting devices in read-only mode

Rw: mounting devices in read/write mode

Iocharset: specifies the character set used to access the file system

3) device to be mounted.

4) mount point of the dir device on the system ).

Example:

1
# Mount-t cifs-o username = "admin", password = "123456" // 192.168.1.1/share // mnt/test/
Note: admin and 123456 are the usernames and passwords of windows machines, and // 192.168.1.1/share/is the shared directory address of windows machines.

In this way, files on windows disks can be accessed through/mnt/test on linux.

3. If you want to cancel the mounting, use the unmount command.

# Unmount/mnt/test

 

The above operations are successfully tested in CentOS6.4 environment.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.