9

I am running Ubuntu 14.04 on an Acer Chromebook C720. For some reason, my /etc/fstab file is "unconfigured."

me@chrubuntu:~$ cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM

Why does this happen? How can I properly configure my /etc/fstab file?

I Like to Code
  • 609
  • 2
  • 8
  • 12

4 Answers4

4

# UNCONFIGURED FSTAB FOR BASE SYSTEM is the fstab that debootstrap generates.

This then gets reused in a variety of images, including the Ubuntu Base image: http://cdimage.ubuntu.com/ubuntu-base/releases/18.04/release/

debootstrap uses that fstab because it tries to cover a wide variety of use cases. In container use case for example, fstab is not needed, because we use the host's configured disk devices.

The same goes for other init configuration files, notably networking.

Here I describe a detailed working debootstrap setup atht might inspire you on how to configure your fstab for emulation: https://unix.stackexchange.com/questions/275429/creating-bootable-debian-image-with-debootstrap/473256#473256

3

As for the first question, why /etc/fstab is not configured, I'm citing this ubuntuforums-thread:

/lib/init/fstab contains the filesystems that are always mounted on boot, like root / and the virtual filesystems. But you can still use /etc/fstab to override the entries from /lib/init/fstab or add your own ones.

So you can find the things that are mounted on boot in /lib/init/fstab and can override them in /etc/fstab. As Ubuntu now uses systemd, I'm wondering why it is still called /lib/init/fstab. (Searching for files called fstab, I have only the /etc/fstab and the /lib/init/fstab on my system that uses systemd)

Mitja
  • 153
2

By default Ubuntu uses UUID in your fstab when you install.

To show a created partitions, in a terminal, as user, type the following command:

 ls -l /dev/disk/by-uuid

It will output like this:

lrwxrwxrwx 1 root root 10 2014-07-25 21:43 348ea9e6-7879-4332-8d7a-915507574a80 -> ../../sda1
lrwxrwxrwx 1 root root 10 2014-07-25 21:43 610aaaeb-a65e-4269-9714-b26a1388a106 -> ../../sda2
lrwxrwxrwx 1 root root 10 2014-07-25 21:43 857c5e63-c9be-4080-b4c2-72d606435051 -> ../../sda5
lrwxrwxrwx 1 root root 10 2014-07-25 21:43 a83b8ede-a9df-4df6-bfc7-02b8b7a5f1f2 -> ../../sda6
lrwxrwxrwx 1 root root 10 2014-07-25 21:43 ad662d33-6934-459c-a128-bdf0393e0f44 -> ../../sda7

The next step is to enter the UUID partition to /etc/fstab.

During the boot process, file systems listed in /etc/fstab are automatically mounted except for the entries containing noauto.

This file contains entries in the following format:

device       /mount-point fstype     options      dumpfreq     passno

device: An existing device name, by default Ubuntu uses UUID

mount-point: An existing directory on which to mount the file system.

fstype: The file system type to pass to mount. The default Ubuntu file system is ext4.

options: Either rw for read-write file systems, or ro for read-only file systems, followed by any other options that may be needed. A common option is noauto for file systems not normally mounted during the boot sequence.

dumpfreq: Used by dump to determine which file systems require dumping. If the field is missing, a value of zero is assumed.

passno: Determines the order in which file systems should be checked. File systems that should be skipped should have their passno set to zero. The root file system needs to be checked before everything else and should have its passno set to one. The other file systems should be set to values greater than one. If more than one file system has the same passno, fsck will attempt to check file systems in parallel if possible.

To add it to your fstab file use a text editor with root privileges:

sudo -i
nano /etc/fstab

Example:

# <device file system>                         <mount point>    <type>  <options>       <dump> <pass>
UUID=ad662d33-6934-459c-a128-bdf0393e0f44            /             ext4      defaults              1      1

UUID=30ebb8eb-8f22-460c-b8dd-59140274829d            /home         ext4      defaults              1      1

UUID=7014f66f-6cdf-4fe1-83da-9cab7b6fab1a            swap          swap      defaults              0      0

Ctrl + O, save file. Ctrl + X, close nano.

Upon a reboot of the computer the filesystems will be mounted automatically.

It is not necessary to list /proc and /sys in the fstab unless some special options are needed.

The boot system will always mount them.

kyodake
  • 15,401
0

Note that I am seeing this with ZFS. There is no need to mount anything in /etc/fstab with ZFS according to the Arch Wiki.

zfs-import-cache.service imports the zfs pools reading the file /etc/zfs/zpool.cache.

muru
  • 197,895
  • 55
  • 485
  • 740
Alex
  • 141