From the course: Ubuntu Linux: Storage Management

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Mount volumes on demand

Mount volumes on demand

From the course: Ubuntu Linux: Storage Management

Start my 1-month free trial

Mount volumes on demand

- [Instructor] Using the autofs package, we can tell the system to mount file systems on demand, rather than needing them to be mounted at boot time and having them always online. We can install the autofs package with apt install autofs. And when it's installed, it starts up a service called autofs. In order to use autofs, we need to create a map file that tells it which mount to keep an eye on. The master map file, located at /etc/auto.master, holds a listing of entries that effectively correspond to directories for mount points and configuration files for them. These entries give us a path that we can use to mount various volumes as they are needed. Let's make my other disk, sdb1, automatically mount when we need it, rather than keeping it mounted all the time. To do that, I'll edit this auto.master file, to add a line with /misc, where I'll expect the device to be. I don't want to use /mnt because I don't want autofs to take over my regular mount. And then I'll provide a path to a…

Contents