Mounts order: ZFS, /etc/fstab...

Bobi B.

Well-Known Member

Reaction score: 197
Messages: 416

I'm running a small home server with /, /usr, /var, etc. on UFS (on a SSD) and a ZFS pool on a pair of HDDs. Since I also have an existing external NAS and run few jails, I'm searching for a documentation regarding FreeBSD mount order during boot time and I cannot find one. It seems /etc/fstab is processed first, ZFS mounts are next, but what to do if I want to mount a NFS export or do a nullfs-mount in a location in the ZFS pool in boot-time?

For example / is UFS (from /etc/fstab), /usr/jails is from ZFS and would like to mount NFS export at /usr/jails/pms/mnt/media during boot time?
 

Remington

Aspiring Daemon

Reaction score: 194
Messages: 562

You will need to create or edit /etc/fstab.pms and it will be mounted when Jail starts. It's much safer this way rather than editing /etc/fstab incorrectly could make your FreeBSD hang at boot.
 

Murph

Well-Known Member

Reaction score: 183
Messages: 297

Try adding the late option to any filesystems that you need deferred until after normal mount order. See mount(8).
 
Last edited by a moderator:
OP
Bobi B.

Bobi B.

Well-Known Member

Reaction score: 197
Messages: 416

You will need to create or edit /etc/fstab.pms and it will be mounted when Jail starts. It's much safer this way rather than editing /etc/fstab incorrectly could make your FreeBSD hang at boot.

Thank you, this is a good idea.

Try adding the late option to any filesystems that you need deferred until after normal mount order. See mount(8).

I saw late option, but it is not clear at what time during boot process mount is executed with -a and when with -l; can you point me to the related documentation?
 

Snurg

Daemon

Reaction score: 580
Messages: 1,349

.../etc/fstab.pms...
Great thing, probably better than the "late" mount option which solved my problem of the jail nullfs mounts happening before the ZFS mounts they depend on finished.
However, searching for fstab.pms yields me only one link, this forum page.
Is there any documentation available on this except of reading the source code?
 
OP
Bobi B.

Bobi B.

Well-Known Member

Reaction score: 197
Messages: 416

Snurg, I believe this is more like /etc/fstab.<jail-name>.
 

Snurg

Daemon

Reaction score: 580
Messages: 1,349

Snurg, I believe this is more like /etc/fstab.<jail-name>.
I think you are right.
Sadly this does not work on my computer.
At least it works with the late option in the "main" fstab, so I can proceed learning how jails work.
 
Top