You are not logged in.

#1 2015-11-25 10:15:37

SmallAndSimple
Member
Registered: 2015-11-25
Posts: 50

[SOLVED]Systemd failes to mount swap, cryptswap gets mounted anyway

I have a fresh install of Arch with one issue:

Arch :: ~ » sudo systemctl --failed                                                                                                                                                                                                                                  
  UNIT          LOAD   ACTIVE SUB    DESCRIPTION
● dev-sdb2.swap loaded failed failed Swap Partition
● dev-sdb2.swap - Swap Partition
   Loaded: loaded (/run/systemd/generator.late/dev-sdb2.swap)
   Active: failed (Result: exit-code) since wo 2015-11-25 10:55:15 CET; 13min ago
     What: /dev/sdb2
     Docs: man:systemd-gpt-auto-generator(8)
  Process: 299 ExecActivate=/sbin/swapon /dev/sdb2 (code=exited, status=255)

nov 25 10:55:15 Arch systemd[1]: Activating swap Swap Partition...
nov 25 10:55:15 Arch swapon[299]: swapon: /dev/sdb2: read swap header failed
nov 25 10:55:15 Arch systemd[1]: dev-sdb2.swap: Swap process exited, code=exited status=255
nov 25 10:55:15 Arch systemd[1]: Failed to activate swap Swap Partition.
nov 25 10:55:15 Arch systemd[1]: dev-sdb2.swap: Unit entered failed state.

The swap at /dev/sdb2 does not mount. Which is weird for a couple of reasons. First: there is a cryptswap, defined in /etc/crypttab. This one works fine and is also the only swap partition defined in /etc/fstab. It is actually /dev/sdb2, so systemd is partially right in trying to mount that partition. But according to my fstab, it has no reason to even assume that /dev/sdb2 is a swap partition:

# /dev/sdb1
UUID=5cc31438-fb6d-4159-a61b-a9e1839ee245       /                               ext4            noatime                                                 0 1

tmpfs                                           /tmp                            tmpfs           defaults,noatime,mode=1777,nosuid                       0 0

#/dev/sda2
UUID=c39125db-11da-47bb-93e0-29560a5739ce       /opt                            ext4            defaults,data=writeback                                 0 2

#/dev/sdb
UUID=9F9F-3589                                  /boot                           vfat            dmask=000,fmask=0111,user                               0 0

/dev/mapper/home                        /home                    ext4            noatime                                                 0 2

/dev/mapper/cryptswap                           none                            swap            defaults                                                0 2

What is going on here?

Last edited by SmallAndSimple (2016-01-14 16:51:24)

Offline

#2 2015-11-25 10:36:55

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: [SOLVED]Systemd failes to mount swap, cryptswap gets mounted anyway

Systemd automatically detects and tries to mount the swap partition in a GTP disk, see https://wiki.archlinux.org/index.php/Sw … by_systemd.

Last edited by mauritiusdadd (2015-11-25 10:37:30)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2015-11-28 21:42:01

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,680
Website

Re: [SOLVED]Systemd failes to mount swap, cryptswap gets mounted anyway

Try masking the unwanted swap partition:

# systemctl mask dev-sdb2.swap

Offline

#4 2016-01-14 15:27:47

SmallAndSimple
Member
Registered: 2015-11-25
Posts: 50

Re: [SOLVED]Systemd failes to mount swap, cryptswap gets mounted anyway

That solved it for me. Thank you.

Offline

Board footer

Powered by FluxBB