Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to setup an automatically mounted volume, and noticed that there is now an /etc/fstab.d/ on my server. I created a new file in the directory with the following contents:

# backupstore: large volume
/dev/mapper/bagend-backupstore  /mnt/backupstore        ext4    auto,relatime,users,sync        0       0

But when I run mount -a the volume is not mounted. Also, when I run mount /mnt/backupstore or /dev/mapper/bagend-backupstore I get told that the system couldn't find the entry in fstab (and to pre-empt: yes, the device and mount-point are correct - I can easily mount this with mount -t ext4 /dev/mapper/bagend-backupstore /mnt/backupstore)

When I delete the file from /etc/fstab.d/ and put the entry into the main /etc/fstab file, I have no problems mounting the volume.

So, can the mount command be made to check for entries in /etc/fstab.d/ and if yes, what do I do to make it happen?

share|improve this question

2 Answers 2

up vote 14 down vote accepted
  • /bin/mount cannot read /etc/fstab.d yet, only the library (libmount) can.
  • This is a known "wishlist" bug in util-linux, the package which provides mount
  • The feature has been added in the latest util-linux 2.21 (the release notes say "Use filter arg of scandir* to pickup /etc/fstab.d/*.fstab files")
  • Since even Debian Unstable (Sid) is on version 2.20-x of util-linux, I doubt we'll see 2.21 in Ubuntu until 13.04
  • If you need it sooner, you can either compile 2.21 from the kernel.org source, but I'd recommend you wait until it at least makes its way into Debian (util-linux provides a number of other critical system utilities/libraries as well)
share|improve this answer
    
As an update, Ubuntu 13.04 is still using version 2.20.1 of util-linux. –  Blair May 6 '13 at 23:19
    
As an update Ubuntu 14.04 is still using version 2.20.1 of util-linux –  couling May 23 at 14:13

The /etc/fstab.d support has been reverted from mount(8) after upstream discussion. The mount tab directories are supported by libmount only. It's not planned to support fstab.d in mount(8) by default.

The problem is that /etc/fstab is de facto standard used on many places (libc, systemd, UI programs, ..) and it's unreal wish that all the places can be changed to support fstab.d.

Anyway, you can use a new mount(8) from util-linux >= 2.21 and a new option --fstab <path> to specify alternative mount table, this option also supports directories. It means you have to explicitly specify the directory -- mount(8) will not read it by default. See mount(8) man page for more details.

share|improve this answer
    
libmount might have superseded getfsent and made the exact files an implementation detail. Or getfsent might have been updated. Oh well, there's always Augeas. –  Tobu Jun 19 '13 at 15:44

Your Answer

 
discard

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.