What are all the spaces in the /etc/fstab for?

The number of spaces is a way to cosmetically separate the columns/fields. It has no meaning other than that. I.e. no the amount of white space between columns does not matter.

The space between columns is comprised of white space (including tabs), and the columns themselves, e.g. comma-separated options, mustn't contain unquoted white space.

From the fstab(5) man page:

[...] fields on each line are separated by tabs or spaces.

and

If the name of the mount point contains spaces these can be escaped as `\040'.

Example

With the following lines alignment using solely a single tab becomes hard to achieve. In the end the fstab without white space looks messier than what you consider disconcerting now.

/dev/md3 /data/vm btrfs defaults 0   0
/var/spool/cron/crontabs /etc/crontabs bind defaults,bind
//bkpsrv/backup /mnt/backup-server cifs iocharset=utf8,rw,credentials=/etc/credentials.txt,file_mode=0660,dir_mode=0770,_netdev

Can you still see the "columns"?


The spaces or tabs delimit the fields. Use as few or as many as suits. If you find fstab a little unreadable try using column to prettify it.

example of column -t usage for fstab