# Mount HDD in NAS with rc.conf



## luca-b-1990 (Sep 13, 2011)

Sorry my English is not good: (I know FreeBSD System Administrator course, on windows platform. Freebsd I liked it and I tried it once. I find it a really powerful and with so many resources. I'm already using in my small servers.

being newbie and not knowing well freebsd ask your help with this question:

How can I mount a HDD with living in a NAS, with the FAT32 file system and protected by a password for access, with rc.conf?

 example of connection:

rc.conf start ---> mount HDDs on NAS (192.168.1.2) with a password to access the files in / media / NAS

please help me!

thanks


----------



## wblock@ (Sep 14, 2011)

The NAS will deal with the filesystem, so that doesn't matter.  What matters is the network protocol the NAS provides.  If it's SAMBA or CIFS, see mount_smbfs(8).  If it's NFS, see mount_nfs(8) and the Handbook NFS chapter.

These are both mounted from /etc/fstab.


----------



## luca-b-1990 (Sep 14, 2011)

NAS uses Samba network protocol, I'm interested in using the mount_smbfs .
Is it possible to use mount_smbfs in rc.conf?

Thanks for helping me with FreeBSD


----------



## wblock@ (Sep 14, 2011)

Why can't you edit /etc/fstab?


----------



## luca-b-1990 (Sep 15, 2011)

wblock said:
			
		

> Why can't you edit /etc/fstab?



Because the NAS is actually USB HDD adapter to NAS, the NAS is also not always online. When I have to reboot the server and the NAS is offline, fstab crashes.The server not start because the NAS is not online.

I want to use rc.conf for this, I want FreeBSD to reboot the server should fstab not crash because NAS is offline.


----------



## wblock@ (Sep 15, 2011)

Entries in /etc/fstab don't have to automount.  For example,

```
/dev/ufs/ltotherfs      /other          ufs     rw,[color="Red"]noauto[/color]       2       2
```

That doesn't automount, it only mounts when I do
`# mount /other`

The same can be done for the NAS.  In fact, it can even be automated.  Write a small script that sees if the NAS is online and, if it is, uses mount_smbfs(1).  Manual unmounting would be best.


----------

