moving /var to persistent storage

Status
Not open for further replies.

Alan Johnson

Dabbler
Joined
Jul 2, 2013
Messages
12
I hope this is an OK place to post such questions. I plan to write a how-to on this but not until I get this straight. I expect such a how-to would easily fall under hacking. =)

I have managed to get /var mounted to /mnt/vol0/system/var with nullfs and added that to /etc/fstab and /conf/base/etc/fstab, but I doubt that is the right way to do it in FreeNAS. I expect /mnt/vol0 is mounted in some way after fstab is processed, so my next boot will get tripped up. Any tips on where to put this mount? Can I add /mnt/vol0 and /mnt/vol0/system to fstab before /var without breaking the boot or other zfs mounts?

Would I be much better off using some mount outside of my zfs pool? I could re-partition some drives to make that happen, but I would like to avoid that effort and would like to present both options in the how-to in case others do not have such luxury.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It wasn't an okay place to post. The How-To section is for guides, not questions. I moved it though. :)
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Would I be much better off using some mount outside of my zfs pool?
AFAIK, a persistent /var is currently supported if you use a whole device formatted as UFS. Not sure if it works with only a partition formatted UFS.
 

Alan Johnson

Dabbler
Joined
Jul 2, 2013
Messages
12
Any idea where I could find some info on that? Even developer level stuff could be fine. I can take my geek deep when necessary. I've been googling and searching the forums for weeks now, off and on, for anything to do with persistent /var on FreeNAS and have seen nothing useful.

This is for 8.3.1 p2, BTW.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Any idea where I could find some info on that? Even developer level stuff could be fine.
There is a ticket or two on Trac that at least obliquely references it. I didn't bookmark it though. The other references I saw when I was browsing the code months ago. Not what I was looking for at the time, I didn't make a note of it and I no longer recall even what sections it was in.

I know it was in-place before 8.2 betas.
 
Joined
Sep 10, 2013
Messages
5
I'm also looking for this information. Looking at the /etc/rc.freenas script, it just looks around to see if /var is mounted from anything other than /dev/md*. So the fix should be simple, just create the volume.

Now to figure out how to do that, my FreeBSD foo has perished.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Looking at the /etc/rc.freenas script, it just looks around to see if /var is mounted from anything other than /dev/md*. So the fix should be simple, just create the volume.
That sounds about right. IIRC, large AD domains was one of the drivers for this feature. I would suggest accomplishing this via the GUI as it will then persist through any upgrades.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
How might one do that? It's not documented anywhere that I could find.
AFAICT, use the UFS Volume Manager, which requires a separate disk, and simply set the custom path to /var. That and populate the new /var how the md backed /var is done.

Edit: If I get some time later I will run through this myself.
 
Joined
Sep 10, 2013
Messages
5
Thanks.. It's sad that we have this beautiful SSD boot drive and can't use it for anything but what a thumb drive would offer at vastly less reliability. FreeBSD doesn't seem to allow partitions to be changed once they are created, which seems so very 1994. I don't mind reinstalling the boot volume, but the installer seems to make no effort to allow the user to do something interesting with the drive before it's formatted.

Am I missing some means to have FreeNAS boot from the same drive that /var resides on?

Maybe some of this would be solved if FreeNAS was a set of packages that could be installed on top of vanilla FreeBSD. Then we could deal with partitioning in a more advanced manner.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
FreeBSD doesn't seem to allow partitions to be changed once they are created, which seems so very 1994.
Don't change them. Other operations are permitted.

I don't mind reinstalling the boot volume, but the installer seems to make no effort to allow the user to do something interesting with the drive before it's formatted.
The installer specifically takes the entire boot volume for itself by design. This is an appliance based NAS distro, not a general purpose OS.

Am I missing some means to have FreeNAS boot from the same drive that /var resides on?
The fact you can't use the boot drive for anything else. This is covered ad nauseam in the forums. Not without hacking at it anyway. Doing so will of course break upgrades and you would need to manually upgrade in the future.
 
Status
Not open for further replies.
Top