You are not logged in.

#1 2013-11-06 19:59:16

miky76
Banned
From: Italy
Registered: 2011-10-27
Posts: 137

[SOLVED] swap error on boot

Hi All,
when I boot my linux server i get this error message:

Failed to activate swap /dev/disk/by-label/mikswap.
See 'systemctl status dev-disk-by\x2dlabel-mikswap.swap for details
[DEPEND] Dependency failed for swap

the output of  the suggested command

[root@artemide ~]# systemctl status dev-disk-byx2dlabel-mikswap.swap
dev-disk-byx2dlabel-mikswap.swap - /dev/disk/byx2dlabel/mikswap
   Loaded: loaded
   Active: failed (Result: exit-code) since Wed 2013-11-06 18:42:54 CET; 18s ago
     What: /dev/disk/byx2dlabel/mikswap
  Process: 621 ExecActivate=/sbin/swapon /dev/disk/byx2dlabel/mikswap (code=exited, status=255)

Nov 06 18:42:54 artemide systemd[1]: Activating swap /dev/disk/byx2dlabel/mikswap...
Nov 06 18:42:54 artemide swapon[621]: swapon: stat failed /dev/disk/byx2dlabel/mikswap: No such file or directory
Nov 06 18:42:54 artemide systemd[1]: dev-disk-byx2dlabel-mikswap.swap swap process exited, code=exited status=255
Nov 06 18:42:54 artemide systemd[1]: Failed to activate swap /dev/disk/byx2dlabel/mikswap.
Nov 06 18:42:54 artemide systemd[1]: Unit dev-disk-byx2dlabel-mikswap.swap entered failed state.

I have looked around internet, but I did not find anything, can you please point me to the right direction?

thanks

Last edited by miky76 (2013-11-07 08:09:57)

Offline

#2 2013-11-06 20:04:37

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] swap error on boot

Is your system fully up to date?
Post your fstab.
Can you activate swap manually?

Last edited by karol (2013-11-06 20:05:26)

Offline

#3 2013-11-06 20:05:50

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: [SOLVED] swap error on boot

karol wrote:

Is your system fully up to date? Post your fstab.

He/she shouldn't have swap in /etc/fstab at all; systemd finds it automatically.  Also post the output of `lsblk -f`

Offline

#4 2013-11-06 20:10:23

miky76
Banned
From: Italy
Registered: 2011-10-27
Posts: 137

Re: [SOLVED] swap error on boot

my fstab

#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
tmpfs           /tmp    tmpfs   nodev,nosuid    0       0
LABEL=mikboot /boot ext2 defaults 0 1
LABEL=mikhome /home ext4 defaults 0 1 noauto,x-systemd.automount
LABEL=mikroot / ext4 defaults 0 1
LABEL=mikswap swap swap defaults 0 0

#/dev/sdd6      /mnt/oldUSBlinux/       ext4    auto
/dev/mapper/data_raid-data      /raid   ext4    auto
/dev/sda6       /data/  ext4    auto

I've found I do not have the dir /dev/disk/byx2dlabel/mikswap that is not found in the second part of the log I've copied in the first post

[root@artemide ~]# cd /dev/disk/byx2dlabel
-bash: cd: /dev/disk/byx2dlabel: No such file or directory
[root@artemide ~]# cd /dev/disk
[root@artemide disk]# ls -l
total 0
drwxr-xr-x 2 root root 640 Nov  6 18:40 by-id
drwxr-xr-x 2 root root 200 Nov  6 18:40 by-label
drwxr-xr-x 2 root root 100 Nov  6 18:40 by-partlabel
drwxr-xr-x 2 root root 180 Nov  6 18:40 by-partuuid
drwxr-xr-x 2 root root 120 Nov  6 18:40 by-path
drwxr-xr-x 2 root root 220 Nov  6 18:40 by-uuid
[root@artemide disk]# cd by-label/
[root@artemide by-label]# ls -l
total 0
lrwxrwxrwx 1 root root 10 Nov  6 18:40 boot -> ../../sdd1
lrwxrwxrwx 1 root root 10 Nov  6 18:40 mikboot -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov  6 18:40 mikhome -> ../../sda4
lrwxrwxrwx 1 root root 10 Nov  6 18:40 mikroot -> ../../sda3
lrwxrwxrwx 1 root root 10 Nov  6 18:40 mikswap -> ../../sda2
lrwxrwxrwx 1 root root 10 Nov  6 18:40 root -> ../../sdd3
lrwxrwxrwx 1 root root 10 Nov  6 18:40 swap -> ../../sdd2
lrwxrwxrwx 1 root root 10 Nov  6 18:40 tempdata -> ../../sda6

Offline

#5 2013-11-06 20:12:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] swap error on boot

graysky wrote:
karol wrote:

Is your system fully up to date? Post your fstab.

He/she shouldn't have swap in /etc/fstab at all; systemd finds it automatically.

Yup :-)

miky76, comment out the swap line in your fstab and reboot.

Offline

#6 2013-11-06 20:12:47

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: [SOLVED] swap error on boot

graysky wrote:

He/she shouldn't have swap in /etc/fstab at all; systemd finds it automatically.  Also post the output of `lsblk -f`

Offline

#7 2013-11-06 20:13:03

miky76
Banned
From: Italy
Registered: 2011-10-27
Posts: 137

Re: [SOLVED] swap error on boot

now that you tell me, I think the error started when I've start to use systemd... can be?

[root@artemide by-label]# lsblk -f
NAME                 FSTYPE            LABEL      UUID                                   MOUNTPOINT
sda
|-sda1               ext2              mikboot    c501350f-a1f7-4875-a876-db4ae820862d   /boot
|-sda2               swap              mikswap    1d89d7a4-78eb-4f87-bea3-96a251783e78   [SWAP]
|-sda3               ext4              mikroot    7bf202c5-7b5c-45f4-a832-f985d48a1091   /
|-sda4               ext4              mikhome    b9a8ebee-a800-40a2-877e-ff22a082a485   /home
|-sda5               linux_raid_member artemide:0 b1bb3967-26bd-833a-c496-5f9a9ab21ac9
`-sda6               ext4              tempdata   edbbb9bd-9dd7-4932-b6a8-c420bdd1d4e6   /data
sdb
`-sdb1               linux_raid_member artemide:0 b1bb3967-26bd-833a-c496-5f9a9ab21ac9
  `-md0              LVM2_member                  6GJ4bd-7Ynp-LMEY-SX8P-NIhX-kcdH-mAaOUi
    `-data_raid-data ext4                         8fc66c30-4465-4e6f-91af-9e6d22586c7a   /raid
sdc
`-sdc1               linux_raid_member artemide:0 b1bb3967-26bd-833a-c496-5f9a9ab21ac9
  `-md0              LVM2_member                  6GJ4bd-7Ynp-LMEY-SX8P-NIhX-kcdH-mAaOUi
    `-data_raid-data ext4                         8fc66c30-4465-4e6f-91af-9e6d22586c7a   /raid
sdd
|-sdd1               ext2              boot       a7c6c5c6-f928-4b05-a73d-35286cca71f0
|-sdd2               swap              swap       bee183a8-8464-4d60-90c0-02f2cd830ae4
`-sdd3               ext4              root       8de7f98a-d398-49c5-970b-3cf57bc7d317

Offline

#8 2013-11-06 20:18:52

miky76
Banned
From: Italy
Registered: 2011-10-27
Posts: 137

Re: [SOLVED] swap error on boot

Removing the swap line in the fstab. the error disappeared, but I think just beacuse it is not looking for it anymore.

How can I be sure, the swap partition is used from the system?

Offline

#9 2013-11-06 20:20:36

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: [SOLVED] swap error on boot

You appear to have two swap partitions (sda2 and sdd2); I do not know how systemd will handle that hmm  It does appear that sda2 is mounted/active swap.

Offline

#10 2013-11-06 20:20:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] swap error on boot

miky76 wrote:

How can I be sure, the swap partition is used from the system?

Check if it's being activated.
If you put heavy pressure on your memory, you should be able to see swap being used in 'free -m'.

Offline

#11 2013-11-06 22:05:05

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: [SOLVED] swap error on boot

"swapon -s" shows active swap partitions/files.

Offline

#12 2013-11-06 22:22:36

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: [SOLVED] swap error on boot

lucke wrote:

"swapon -s" shows active swap partitions/files.

It's sda2:

miky76 wrote:
[root@artemide by-label]# lsblk -f
NAME                 FSTYPE            LABEL      UUID                                   MOUNTPOINT
sda
|-sda1               ext2              mikboot    c501350f-a1f7-4875-a876-db4ae820862d   /boot
|-sda2               swap              mikswap    1d89d7a4-78eb-4f87-bea3-96a251783e78   [SWAP]
|-sda3               ext4              mikroot    7bf202c5-7b5c-45f4-a832-f985d48a1091   /
|-sda4               ext4              mikhome    b9a8ebee-a800-40a2-877e-ff22a082a485   /home
|-sda5               linux_raid_member artemide:0 b1bb3967-26bd-833a-c496-5f9a9ab21ac9
`-sda6               ext4              tempdata   edbbb9bd-9dd7-4932-b6a8-c420bdd1d4e6   /data
sdb
`-sdb1               linux_raid_member artemide:0 b1bb3967-26bd-833a-c496-5f9a9ab21ac9
  `-md0              LVM2_member                  6GJ4bd-7Ynp-LMEY-SX8P-NIhX-kcdH-mAaOUi
    `-data_raid-data ext4                         8fc66c30-4465-4e6f-91af-9e6d22586c7a   /raid
sdc
`-sdc1               linux_raid_member artemide:0 b1bb3967-26bd-833a-c496-5f9a9ab21ac9
  `-md0              LVM2_member                  6GJ4bd-7Ynp-LMEY-SX8P-NIhX-kcdH-mAaOUi
    `-data_raid-data ext4                         8fc66c30-4465-4e6f-91af-9e6d22586c7a   /raid
sdd
|-sdd1               ext2              boot       a7c6c5c6-f928-4b05-a73d-35286cca71f0
|-sdd2               swap              swap       bee183a8-8464-4d60-90c0-02f2cd830ae4
`-sdd3               ext4              root       8de7f98a-d398-49c5-970b-3cf57bc7d317

Offline

#13 2013-11-07 08:09:29

miky76
Banned
From: Italy
Registered: 2011-10-27
Posts: 137

Re: [SOLVED] swap error on boot

yes it's sda2

[root@artemide ~]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/sda2                               partition       2047996 0       -1

thank you all for your help.

I'll set this as [SOLVED]

Offline

Board footer

Powered by FluxBB