Mounting Windows shared folders on Linux, how to boot automatically mount (mount)

Source: Internet
Author: User

Use the Mount command to hook up Windows shared folders on Ubuntu

sudo mount//192.168.0.1/linux/mnt/win-o username=user,password=pass dir_mode=777 file_mode=777

Description
192.168.0.1/linux Windows shared folder path
/mnt/win mount points in Ubuntu

---------------------------------------------------------------------------------------------------------

According to the general idea, we will first mount the folder, the command is as follows:

1 mkdir/mnt/share_software
2 mount//192.9.206.43/share_software /mnt/share_software -o username="edures",password="tj$123"

Then go into the/mnt/share_software directory, see all the current files, found that the owner and the group are root, try to use Chown and chmod command to modify, the result is permission denied.

Online access to the relevant information, the original parameter-O can also be added to an account of the UID and GID of the way to mount, after the successful mount of the directory all the file attributes belong to this account,

For example, I want to let/mnt/share_software belong to the user, user groups are www, www. First, you have to find out the UID of the user www by the following command, and the user group www guid is how many:

1 [[email protected] ~]# cat /etc/passwd
2 ......
3 www:x:501:501::/home/www:/bin/sh
4 mysql:x:502:502::/home/mysql:/usr/sbin/nologin
5 mongodb:x:503:503::/home/mongodb:/usr/sbin/nologin
6 ......

As shown above, the UID for WWW is 501,gid 501, and the last adjustment Mount command is as follows:

1 #先删除掉先前的挂载
2 umount/mnt/share_software
3
4 #挂载后,让Linux目录所属用户和用户组分别为 www:www
5 mount//192.9.206.43/share_software /mnt/share_software -o username="edures",password="tj$123",uid="501",gid="501"

Automatic mount on Boot:

Append the following command to the file/etc/rc.local (root user):

1 mount//192.9.206.43/share_software /mnt/share_software -o username="edures",password="tj$123",uid="501",gid="501"

Mount a problem rollup:

One, mount, user/Password error

Mount Error: Permission denied
Refer to the Mount.cifs (8) manual page (e.g. Mans mount.cifs)

Corresponding/var/log/messages Records

Oct 16:20:01 localhost kernel:status code returned 0xc000006d nt_status_logon_failure
Oct 16:20:01 localhost kernel:cifs vfs:send error in Sesssetup =-13
Oct 16:20:01 localhost kernel:cifs vfs:cifs_mount failed W/return code = 13

Second, no share directory

Retrying with upper case share name
Mount Error (6): No Such device or address
Refer to the Mount.cifs (8) manual page (e.g. Mans mount.cifs)

Corresponding/var/log/messages Records

1 Oct 12 16:20:06 localhost kernel: CIFS VFS: cifs_mount failed w/returncode = -6
2 Oct 12 16:20:17 localhost kernel: CIFS VFS: cifs_mount failed w/returncode = -6
3 Oct 12 16:20:17 localhost kernel: CIFS VFS: cifs_mount failed w/returncode = -6

Sometimes the mount fails, prompting for login failure, then enter the password:

Mount//192.9.206.43/share_software/mnt/share_software-o username= "Edures", uid= "$", gid= "500"

Re-enter the password tj$123

"Attached" Linux Mount Linux:mount-t NFS 172.16.8.113:/mnt/reslib/mnt/reslib-o proto=tcp-o nolock

Reference:

http://carllai.blog.51cto.com/1664997/1351447

Http://www.cnblogs.com/52linux/archive/2012/03/07/2384400.html

http://www.apoyl.com/?p=1432

Mounting Windows shared folders on Linux, how to boot automatically mount (mount)

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.