---
title: "Gentoo, Mounting a remote Shared Folder"
author: "iammonster"
date: "2011-02-23T15:04:56Z"
tags: []
categories: ["操作系统"]
slug: "gentoo-mounting-a-remote-shared-folder"
draft: false
lastmod: "2011-02-23T16:22:16Z"
id: 919644
url: "https://jiajun.iteye.com/blog/919644"
---

http://en.gentoo-wiki.com/wiki/Mounting\_a\_remote\_Shared\_Folder

 

In order to mount a remote filesystem, you must configure your kernel accordingly.

 

 

cd /usr/src/linux

make menuconfig

 

**Linux Kernel Configuration:** CIFS File system support

```
File Systems  --->
     [*] Network File Systems  --->
          <*>   CIFS support (advanced network filesystem, SMBFS successor)
          [*]     CIFS Statistics
          [*]     CIFS Extended attributes
```

 

 

make clean && make bzImage && make modules && make modules\_install && make install

cp arch/x86\_64/boot/bzImage /boot/kernel-2.6.32-gentoo-r7

reboot 

更详细参考：http://jiajun.iteye.com/blog/538820

 

After that, you have to emerge the package mount-cifs.

emerge mount-cifs

Refer to the [official kernel configuration article](http://www.gentoo.org/doc/en/kernel-upgrade.xml) to compile and install your fresh kernel.

## Usage

Use the following terminal command to mount a remote folder, replacing **IP\_OR\_NAME** with the IP or the computer name, **SharedFolderName** with the the Shared folder name and /mnt/sharedfolder with the local folder you want to link with.

### \[[edit](http://en.gentoo-wiki.com/w/index.php?title=Mounting_a_remote_Shared_Folder&action=edit&section=3 "Edit section: CIFS (Windows)") ] CIFS (Windows)

Make a target directory:

mkdir /mnt/sharedfolder

Mount the remote share:

mount -t cifs //IP\_OR\_NAME/SharedFolderName /mnt/sharedfolder

If you need credentials to access the remote folder, use the following :

mount -t cifs //IP\_OR\_NAME/SharedFolderName /mnt/sharedfolder -o "username=X,passwd=Y"

You can also specify if the share is read/write (rw), read only (ro) or write only (wo) with the -o parameter. Here is a complete working example :

mount -t cifs //192.168.1.101/SharedDocs /mnt/sharedfolder -o "rw,username=admin,passwd=password"