# Mount WIndows share permanently:

## kkinkouu

Hi,

Hope someone can help me with this; 

I can mount these shares without a problem while the system is running.

If I unmount them and then add the applicable lines to /etc/fstab and run "mount -a", the action is successful.

# Network Share: Physical machine

//llabmw7/d /home/[username]/Desktop/shareP cifs credentials=/home/[username]/.smbcredentials,iocharset=utf8,sec=ntlm,_netdev 0 0

# Network Share: Virtual machine

//DC1/share /home/[username]/Desktop/share cifs credentials=/home/[username]/.smbcredentials,iocharset=utf8,sec=ntlm,_netdev 0 0

* GENTOO system is virtual and running on vm workstation 10

The problems start when I reboot GENTOO - after POST runlevel3, the system errors with "mount error 101 blablabla"

I've had a look round the net & nothing I've come across has solved the problem. I'm still new to GENTOO and Linux in general.

What would be the best practice when it comes to NET shares? 

Thanks in advance 

kkinkouu

----------

## Maitreya

Network is unreachable at that point  :Smile: 

Can you post "rc-update show" ?

----------

## kkinkouu

I just booted of a live Gentoo ISO and mounted the VM system; then i commented out the additional net shares, rebooted the system and everything was fine.

Some users have suggested that i build a scripted and place it into /etc/local.d/ - so on login the scripted is run mounting the shares needed.

this is more of a work around than a fix, but it does the job i suppose 

Here's the output regarding the "rc-update show"

```
gentoo_vm XXXXX # rc-update show

            alsasound | boot                         

               binfmt | boot                         

             bootmisc | boot                         

           consolekit |      default                 

               cronie |      default                 

                devfs |                       sysinit

                dmesg |                       sysinit

                 fsck | boot                         

             hostname | boot                         

              hwclock | boot                         

              keymaps | boot                         

            killprocs |              shutdown        

    kmod-static-nodes |                       sysinit

                local |      default                 

           localmount | boot                         

             loopback | boot                         

              modules | boot                         

             mount-ro |              shutdown        

                 mtab | boot                         

             netmount |      default                 

               procfs | boot                         

                 root | boot                         

                samba |      default                 

            savecache |              shutdown        

                 sshd |      default                 

                 swap | boot                         

            swapfiles | boot                         

               sysctl | boot                         

                sysfs |                       sysinit

            syslog-ng |      default                 

         termencoding | boot                         

             tigervnc |      default                 

         tmpfiles.dev |                       sysinit

       tmpfiles.setup | boot                         

                 udev |                       sysinit

              urandom | boot                         

                  xdm |      default                 

                 xrdp |      default            
```

Let me know your thoughts!

Code tags added by NeddySeagoon to preserve original format

----------

## krinn

 *kkinkouu wrote:*   

> The problems start when I reboot GENTOO - after POST runlevel3, the system errors with "mount error 101 blablabla"

 

Can we get the real blablabla part?

----------

## kkinkouu

blablabla part - "mount error(101) network is unreachable"

----------

## kkinkouu

I haven't been able to find a solution regarding the original question, but think it lies somewhere in the topic - "restructuring the rc boot order" - in such a way, that the network stack boots up before the fstab config; just speculation though and haven't pursued this avenue yet.

Work-around: solution

Create a script file in the following location "/etc/local.d/" that looks something like the below:

#!/bin/bash

#

# Network Share: Physical machine

SERVER_IP="***.***.***.***"

HOSTNAME="hostname1"

SHARE_NAME="d"

CREDENTIALS="/home/[username]/.smbcredentials"

DOMAIN="WORKGROUP"

sudo mount //hostname1/d -o credentials=$CREDENTIALS,dom=$DOMAIN /home/[username]/Desktop/shareP 

#

# Network Share: Virtual machine

SERVER_IP="***.***.***.***"

HOSTNAME="hostname2"

SHARE_NAME="share"

CREDENTIALS="/home/[username]/.smbcredentials"

DOMAIN=DOMAIN.DOMAIN"

sudo mount //hostname2/share -o credentials=$CREDENTIALS,dom=$DOMAIN /home/[username]/Desktop/share

Now create a file ".smbcredentials" in example location - "/home/[username]/" with the following credentials needed for each share:

# Local Account:

username=[username]

password=**************

# Domain Account:

username=[domain\username]

password=**************

The specified username must be an NTFS account name either local or domain orientated. 

Now make sure "local" is started in "rc" by running the following command:

gentoo_vm # rc-update add local default 

gentoo_vm # rc 

Good to go!

kkinkouu[/code]

----------

