Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I include another file in my fstab file?

I.e. can I have fstab execute lines from another file at an arbitrary point, and then return to the main file when completed?

share|improve this question
If you have so many mount points that this is an issue, you're probably looking for an automounter such as autofs. – Gilles Jan 28 '13 at 22:23
Related question from Ask Ubuntu: Why can't mount read files in “/etc/fstab.d/”? – Cristian Ciupitu Jun 19 '14 at 18:57
up vote 9 down vote accepted

Generally not, but with newer versions of mount/swapon/fsck... on Linux (from util-linux 2.19) at least, you can have more files (with .fstab extension) in /etc/fstab.d. So you can have a /etc/fstab.d/00_header.fstab, /etc/fstab.d/50_middle.fstab, /etc/fstab.d/99_end.fstab.

Another approach if all you want is mount -a to run some command is have an entry with your own filesystem type and create a /sbin/mount.own that does the work for you.

Note that recent versions of Ubuntu have that mountall that might get in the way.

Also note that some distributions process mounts in several stages using -t fstypes, which you may need to take into account as well.

share|improve this answer

I have never seen a Unixy system with such an fstab(5)-setup. Look at mount(8) for the gory details of what can be done at mount time.

What do yu want this for? If really useful in more than a narrow range of usecases it just might get implemented...

share|improve this answer
I have a lot of computers that mount the same nfs, I want to centralize the fstab life relating to that nfs (so I don't have to change it on all machines when it changes) – jsj Jan 28 '13 at 11:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.