Subject: /etc/fstab and systemd

From: Pol Hallen <[email-masked]>
Date: Mon, 19 Sep 2016 15:15:26 +0200

hi all :-)

I migrated my pc to systemd (!), in /etc/fstab I've

/dev/sdb1	/test	ext4	x-systemd.automount	0	0
(I use UUID but to semplify I wrote /dev/sdb1)

this line works but only on some pc

what is the correct way to mount a disk automatically at start up of system?

thanks!

Pol

---

From: Jimmy Johnson <[email-masked]>
Date: Mon, 19 Sep 2016 11:34:19 -0700

> what is the correct way to mount a disk automatically at start up of

"/dev/sdb1 /test ext4 auto,users,exec,relatime 0 0"

You do realize that will mount the folder named 'test' you have created 
on root.  If you do not have a folder named 'test' on root/ in will not 
work.
You may want to put the mount folder named 'test' in your home folder, 
ie /home/username/test. I mount to a folder named '1-Linux' so that it 
will be at the top of my home directory. I hope that helps.
-- 
Jimmy Johnson

Debian Sid/Testing - XFCE4 - AMD64 - EXT4 at sda24
Registered Linux User #380263

---

From: Mart van de Wege <[email-masked]>
Date: Mon, 19 Sep 2016 15:48:51 +0200

> what is the correct way to mount a disk automatically at start up of system?
Just remove the x-systemd.automount. Replace it with 'defaults' or
whatever other options you like.

Unless a volume is marked with specific systemd options to *not* mount
it automatically, systemd will mount everything in fstab at boot.

Mart

-- 
"We will need a longer wall when the revolution comes."
    --- AJS, quoting an uncertain source.

---

From: Greg Wooledge <[email-masked]>
Date: Mon, 19 Sep 2016 09:42:28 -0400

> (I use UUID but to semplify I wrote /dev/sdb1)

Changing the content of your files is not "simplifying".  It's mangling.

> what is the correct way to mount a disk automatically at start up of system?

This is what jessie does by default:

UUID=1a20ffb7-897c-4373-84c1-14089a6deab8 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda3 during installation
UUID=b8d67062-8262-476d-9370-8166f7572fd3 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

Or, on a system with a separate /home:

UUID=404cbcbe-cc34-44e6-b8cf-845c3ceb56e7 /home           ext4    defaults        0       2

In short, there's no special magic used by fstab on a jessie/systemd
system.  It's just like an fstab from wheezy.  Let systemd handle the
mounting in its regular way.

---

From: Teemu Likonen <[email-masked]>
Date: Mon, 19 Sep 2016 16:38:42 +0300

> what is the correct way to mount a disk automatically at start up of

Just like before. There's no need to change anything.

-- 
/// Teemu Likonen   - .-..   <https://github.com/tlikonen> //
// PGP: 4E10 55DC 84E9 DFF6 13D7 8557 719D 69D3 2453 9450 ///