/etc/fstab and systemd

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

/etc/fstab and systemd

Debian EN
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

Reply | Threaded
Open this post in threaded view
|

Re: /etc/fstab and systemd

Greg Wooledge
On Mon, Sep 19, 2016 at 03:15:26PM +0200, Pol Hallen wrote:
> 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)

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.

Reply | Threaded
Open this post in threaded view
|

Re: /etc/fstab and systemd

Teemu Likonen-2
In reply to this post by Debian EN
Pol Hallen [2016-09-19 15:15:26+02] wrote:

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

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

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 ///

signature.asc (834 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: /etc/fstab and systemd

Mart van de Wege
In reply to this post by Debian EN
Pol Hallen <[hidden email]> writes:

> 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!
>
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.

Reply | Threaded
Open this post in threaded view
|

Re: /etc/fstab and systemd

Jimmy Johnson-8
In reply to this post by Debian EN
On 09/19/2016 06:15 AM, Pol Hallen wrote:

> 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

"/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