Mount location best practices

Status
Not open for further replies.

silversword

Dabbler
Joined
Nov 9, 2017
Messages
21
I was trying to mount another share into FreeNAS. I created it under
/mnt/newdir
but every time I reboot newdir disappears. Is there a recommended location or standard best practices for FreeNAS/FreeBSD to create folders that you're going to mount external shares into? Or do I just need to include in the startup and mount script to create the folder first?

Thx!
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I was trying to mount another share into FreeNAS. I created it under
/mnt/newdir
but every time I reboot newdir disappears. Is there a recommended location or standard best practices for FreeNAS/FreeBSD to create folders that you're going to mount external shares into? Or do I just need to include in the startup and mount script to create the folder first?

Thx!
You probably need to explain better what it is you are trying to do because you are not supposed to be mounting storage from another server.
 

silversword

Dabbler
Joined
Nov 9, 2017
Messages
21
I've got multiple NAS boxes in my network. I want to be able to map those other NAS shares so when I need to transfer files from NAS 1 to NAS to I can copy them between devices. Just using the native mount_smbfs function supported in FreeBSD: https://www.freebsd.org/cgi/man.cgi?mount_smbfs(8)

I just don't know where I should be putting the folder I'm going to mount into since apparently FreeNAS wipes, and recreates all objects in /mnt every time it restarts. Is there a recommended, or best practices for folder locations in FreeBSD? Should I just create my own /smb/ under the root?

I guess considering this: https://www.freebsd.org/doc/handbook/dirstructure.html

since it's a fstab script run as root would:
/root/smb/nas1
/root/smb/nas2
/root/smb/nas3


be appropriate?
 
Last edited:

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I just don't know where I should be putting the folder I'm going to mount into since apparently FreeNAS wipes, and recreates all objects in /mnt every time it restarts. Is there a recommended, or best practices for folder locations in FreeBSD? Should I just create my own /smb/ under the root?
FreeNAS is a NAS appliance built on the FreeBSD operating system, but it is heavily customized to make it an appliance. It is not the same as using FreeBSD directly and you should not be looking at the FreeBSD documentation thinking that it is also applicable to FreeNAS. Many things are not.

What you are trying to do is not a supported feature, if it were, there would be a way to do it through the GUI which is were almost all management of the NAS is supposed to happen. The only settings that are designed to survive a reboot are the settings that are made in the GUI because they are saved in the configuration database. Effectively every reboot of the NAS resets everything back to "factory default" and then adds the system configuration based on what is recorded in the database.

User directories survive reboot, so if you insist on doing this, you could create the directories inside the /root folder.
I have a scripts folder that I have created inside my /root folder where I have several useful scripts, some of which I start on a recurring basis using the scheduler.
Look at this: http://doc.freenas.org/11/tasks.html?highlight=post init#init-shutdown-scripts
You could have an init script that runs to restore the mounts.

I think that doing this is not a good idea. Why not move all the storage into a single NAS?
 
Last edited:

Inxsible

Guru
Joined
Aug 14, 2017
Messages
1,123
  1. You should not be mounting a NAS server on a NAS server as has been mentioned to you. Use a client to do that. Mount both servers and copy the data, if you have to.
  2. Why are you rebooting your NAS?
 

silversword

Dabbler
Joined
Nov 9, 2017
Messages
21
User directories survive reboot, so if you insist on doing this, you could create the directories inside the /root folder.
I have a /scripts folder that I have created inside my /root folder where I have several useful scripts, some of which I start on a recurring basis using the scheduler.
Look at this: http://doc.freenas.org/11/tasks.html?highlight=post init#init-shutdown-scripts
You could have an init script that runs to restore the mounts.

I think that doing this is not a good idea.

Ok, sufficiently warned. I understand I'm executing at my own risk.

Why not move all the storage into a single NAS?

Because I have multiple business units I'm managing, and for legal reasons each NAS is for the most part separated and for different uses. Also another 150TB+ server is not in the budget atm :)

  1. Why are you rebooting your NAS?

Updates, long duration power outages, moving premises etc.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
I have a /scripts folder that I have created inside my /root
I have a scripts folder that I have created inside my /root
Fixed that for ya ;)
 

Chris Moore

Hall of Famer
Joined
May 2, 2015
Messages
10,080
I have a scripts folder that I have created inside my /root
Fixed that for ya ;)
I think I got the meaning across... No?
/root/scripts
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Yeah I got your point but the leading slash normally indicates an absolute path from root /. I'm just being picky. :D
 
Status
Not open for further replies.
Top