You are not logged in.

#1 2014-01-26 08:48:11

saf
Member
Registered: 2009-02-01
Posts: 39

systemctl and mountdirective ssd for btrfs

Hi,

I'm new to systemctl, and I didn't get yet how to give explicitely the ssd parameter for booting my root-btrfs partition.
In older times this was done in /etc/fstab but now, my /etc/fstab is just empty.

systemctl looks really great to me, where can I add those lines, and other mounting directives? i didnt find it in english and german archlinux wiki.

thanks,
saf

Offline

#2 2014-01-26 08:53:14

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,604

Re: systemctl and mountdirective ssd for btrfs

It's still done in fstab. You can alternatively write mount units for systemd, but fstab is still the normal method.

Offline

#3 2014-01-26 12:07:24

saf
Member
Registered: 2009-02-01
Posts: 39

Re: systemctl and mountdirective ssd for btrfs

Ok thanks,

this is my  /etc/systemd/system/root.mount file

<code>
[Unit]
Description = root

[Mount]
What = LABEL=ROOT
Where = /
Type = btrfs
Options = ssd
</code>

when I try to mount it with

<code>
# systemctl daemon-reload
# systemctl start root.mount
</code>

I get this error:
<code>
Failed to issue method call: Unit root.mount failed to load: Invalid argument. See system logs and 'systemctl status root.mount' for details.
</code>

the output of
#systemctl status root.mount
<code>
# systemctl status root.mount
root.mount - root
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
    Where: /
     What: LABEL=ROOT

Jan 26 13:00:17 localhost systemd[1]: root.mount's Where setting doesn't match unit name. Refusing.
Jan 26 13:02:28 localhost systemd[1]: root.mount's Where setting doesn't match unit name. Refusing.
Jan 26 13:03:20 localhost systemd[1]: root.mount's Where setting doesn't match unit name. Refusing.
Jan 26 13:05:29 localhost systemd[1]: root.mount's Where setting doesn't match unit name. Refusing.
</code>

Any suggestions to make it work? and then how do I make it automount under archlinux?

thanks

Offline

#4 2014-01-26 12:16:34

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: systemctl and mountdirective ssd for btrfs

Why did you not try the first suggestion; your fstab. Have a look at `systemctl status /` and you should find that it's all loaded from your fstab. If your fstab is empty you didn't follow the install manual because that tells you to run genfstab. Now that it is empty, you should add the correct line anyway to pass additional options

Last edited by Spider.007 (2014-01-26 12:17:32)

Offline

#5 2014-01-26 15:15:13

saf
Member
Registered: 2009-02-01
Posts: 39

Re: systemctl and mountdirective ssd for btrfs

ok, i generated it.
the ssd option was already loaded and added to fstab by default.

thanks

Offline

#6 2014-01-26 16:33:05

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: systemctl and mountdirective ssd for btrfs

btrfs autodetects whether the drive is rotational or not and applies the 'ssd' mount option as necessary.  The exception of course would be if you have an ssd that is connected via USB, where the abstraction of the bus does not allow for that kind of information to get through.


If you really want to use native mount units, you should read the systemd.mount man page.  The naming scheme for those units are very specific, and must match the path of your mount.  An easy way to see how things are done is to use the fstab, then look at the units generated by systemd-fstab-generator.service.  These units live in /run/systemd/generators.

Offline

Board footer

Powered by FluxBB