Ubuntu – Automatic Adding of Filesystems to /etc/fstab

filesystemfstab

I use lvcreate and mkfs to create new filesystems on my Ubuntu Server 18.04 LTS systems. One thing I find confusing is that the system does not automatically add any new filesystems that I create to the /etc/fstab file. The only ones added are the ones that were created when the system was initially created during install.

Is there any way (mkfs flag, or separate apt package) that new filesystems could be inserted automatically in the /etc/fstab file rather than requiring the administrator to manually edit the file?

Best Answer

That's normal, because there is no way for tools or operating system to know where do you want to mount the partitions, logical volumes or etc that you have just created.

The ones you create while installing system are detected by your choices (When you select your root, home, etc) and are added to fstab because they are necessary for booting your system.

you have to manually edit the fstab.

BUT, there is other ways to automatically mount partitions, tools like udisks.

https://help.ubuntu.com/community/AutomaticallyMountPartitions

Related Question