i did a build from http://cgit.freedesktop.org/systemd/systemd/commit/?id=982e44dbc3e70c97e83464a30354b80973d52b41 and now my swap partition won't mount automatically at boot cat /etc/fstab # # /etc/fstab: static file system information # # <file system> <dir> <type> <options> <dump> <pass> # UUID=0249fe74-9da0-4ce8-9d02-6af38224ba02 /dev/mapper/root / ext4 defaults,relatime 0 1 # UUID=9b6caf94-e5fe-461c-9fad-1a395d9d0da4 /dev/sda1 /boot ext4 defaults,relatime 0 2 /dev/sda2 none swap defaults 0 0 it was working when i did a build around a week ago :) How can I check logs for why this isn't working anymore? thank you :)
manually doing swapon -a enables the swap partition.
I just saw this commit: http://cgit.freedesktop.org/systemd/systemd/commit/?id=4f0be680b5323e037314cfbd3dba34f03e637c8f build-sys: prepare 207 Please take a look at this bug before releasing systemd 207
this checkin is what broke it for me: http://cgit.freedesktop.org/systemd/systemd/commit/?id=64347fc2b983f33e7efb0fd2bb44e133fb9f30f4
WORKSFORME ~$ fgrep swap /etc/fstab UUID=0a5847a8-358d-454f-ab98-8592de5ca4ba swap swap defaults 0 0 ~$ cat /proc/swaps Filename Type Size Used Priority /dev/sda4 partition 6029308 0 -1 $ fgrep -r swap.target /lib/systemd/system/ /lib/systemd/system/sysinit.target:Wants=local-fs.target swap.target /lib/systemd/system/sysinit.target:After=local-fs.target swap.target emergency.service emergency.target ~$ echo /run/systemd/generator/*.swap /run/systemd/generator/dev-disk-by\x2duuid-0a5847a8\x2d358d\x2d454f\x2dab98\x2d8592de5ca4ba.swap ~$ cat /run/systemd/generator/*.swap # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab [Swap] What=/dev/disk/by-uuid/0a5847a8-358d-454f-ab98-8592de5ca4ba ~$ find /run/systemd/generator.late/ -name '*swap*' /run/systemd/generator.late/swap.target.wants /run/systemd/generator.late/swap.target.wants/dev-sda4.swap /run/systemd/generator.late/dev-sda4.swap $ systemctl show 'dev-disk-by\x2duuid-0a5847a8\x2d358d\x2d454f\x2dab98\x2d8592de5ca4ba.swap' Id=dev-disk-by\x2duuid-0a5847a8\x2d358d\x2d454f\x2dab98\x2d8592de5ca4ba.swap Names=dev-disk-by\x2duuid-0a5847a8\x2d358d\x2d454f\x2dab98\x2d8592de5ca4ba.swap Following=dev-sda4.swap Wants=system.slice BindsTo=dev-disk-by\x2duuid-0a5847a8\x2d358d\x2d454f\x2dab98\x2d8592de5ca4ba.device RequiredBy=swap.target WantedBy=dev-disk-by\x2duuid-0a5847a8\x2d358d\x2d454f\x2dab98\x2d8592de5ca4ba.device Conflicts=umount.target Before=umount.target swap.target
[hussam@hades linux]$ fgrep swap /etc/fstab UUID=085d0683-1c42-436e-9218-642a81a31830 swap swap defaults 0 0 [hussam@hades linux]$ cat /proc/swaps Filename Type Size Used Priority [hussam@hades linux]$ fgrep -r swap.target /lib/systemd/system/ /lib/systemd/system/sysinit.target:Wants=local-fs.target swap.target /lib/systemd/system/sysinit.target:After=local-fs.target swap.target emergency.service emergency.target [hussam@hades linux]$ echo /run/systemd/generator/*.swap /run/systemd/generator/dev-disk-by\x2duuid-085d0683\x2d1c42\x2d436e\x2d9218\x2d642a81a31830.swap [hussam@hades linux]$ cat /run/systemd/generator/*.swap # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab [Swap] What=/dev/disk/by-uuid/085d0683-1c42-436e-9218-642a81a31830 [hussam@hades el_linux]$ find /run/systemd/generator.late/ -name '*swap*' find: `/run/systemd/generator.late/': No such file or directory
I do have /run/systemd/generator/dev-disk-by\x2duuid-085d0683\x2d1c42\x2d436e\x2d9218\x2d642a81a31830.swap though.
Fixed in git. http://cgit.freedesktop.org/systemd/systemd/commit/?id=90060fa6605446bef7078867423b691e4effa575
Now I have: [hussam@hades ~]$ fgrep swap /etc/fstab UUID=085d0683-1c42-436e-9218-642a81a31830 swap swap defaults 0 0 [hussam@hades ~]$ cat /proc/swaps Filename Type Size Used Priority [hussam@hades ~]$ fgrep -r swap.target /lib/systemd/system/ /lib/systemd/system/sysinit.target:Wants=local-fs.target swap.target /lib/systemd/system/sysinit.target:After=local-fs.target swap.target emergency.service emergency.target [hussam@hades ~]$ echo /run/systemd/generator/*.swap /run/systemd/generator/dev-disk-by\x2duuid-085d0683\x2d1c42\x2d436e\x2d9218\x2d642a81a31830.swap [hussam@hades ~]$ cat /run/systemd/generator/*.swap # Automatically generated by systemd-fstab-generator [Unit] SourcePath=/etc/fstab [Swap] What=/dev/disk/by-uuid/085d0683-1c42-436e-9218-642a81a31830 [hussam@hades ~]$ find /run/systemd/generator.late/ -name '*swap*' find: `/run/systemd/generator.late/': No such file or directory But i still need to manually swapon -a
reopening as this is still broken for me and I have verified which checking breaks it.
http://sprunge.us/cTWB journalctl -b output.
perhaps this will help too: systemctl show 'dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap' Id=dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap Names=dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap Wants=system.slice BindsTo=dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.device RequiredBy=swap.target WantedBy=dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.device Conflicts=umount.target Before=umount.target swap.target After=systemd-journald.socket dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.device system.slice Description=/dev/disk/by-uuid/5ad323ca-ad74-4f4d-baea-8d89c9072560 LoadState=loaded ActiveState=inactive SubState=dead FragmentPath=/run/systemd/generator/dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap SourcePath=/etc/fstab InactiveExitTimestampMonotonic=0 ActiveEnterTimestampMonotonic=0 ActiveExitTimestampMonotonic=0 InactiveEnterTimestampMonotonic=0 CanStart=yes CanStop=yes CanReload=no CanIsolate=no
I just found out systemctl start 'dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap' enables the swap partition (for this session) Also '/usr/lib/systemd/system-generators/systemd-fstab-generator' outputs nothing.
first time I run /usr/lib/systemd/system-generators/systemd-fstab-generator after a reboot, it says nothing. second time it outputs warnings. [root@hades hussam]# /usr/lib/systemd/system-generators/systemd-fstab-generator [root@hades hussam]# /usr/lib/systemd/system-generators/systemd-fstab-generator Failed to create mount unit file /tmp/-.mount, as it already exists. Duplicate entry in /etc/fstab? Failed to create mount unit file /tmp/boot.mount, as it already exists. Duplicate entry in /etc/fstab? Failed to create swap unit file /tmp/dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap, as it already exists. Duplicate entry in /etc/fstab? boot partition is mounted correctly from fstab
Confirmed also by thrice in #systemd channel on freenode that it is still broken in latest git.
(In reply to comment #14) > Confirmed also by thrice in #systemd channel on freenode that it is still > broken in latest git. yep, here on an up-to-date arch install, too.
Could you please post the 'systemctl status' of the swap unit, the swap target and the corresponding device unit? I'll have a look at this tonight.
systemctl status swap.target swap.target - Swap Loaded: loaded (/usr/lib/systemd/system/swap.target; static) Active: active since Sun 2013-09-15 17:12:47 EEST; 1h 40min ago Docs: man:systemd.special(7) Sep 15 17:12:48 hades systemd[1]: Starting Swap. Sep 15 17:12:48 hades systemd[1]: Reached target Swap. systemctl status dev-disk-by\x2dlabel-swap.device dev-disk-byx2dlabel-swap.device Loaded: loaded Active: inactive (dead)
(In reply to comment #16) same for me, even though something's wrong with my journalctl it seems. on every reboot, it claims that the journal has been rotated, which shouldn't be the case: ------------ [root@laptop phani]# systemctl status swap.target swap.target - Swap Loaded: loaded (/usr/lib/systemd/system/swap.target; static) Active: active since Sun 2013-09-15 21:03:38 IST; 10min ago Docs: man:systemd.special(7) Sep 15 21:03:39 laptop systemd[1]: Starting Swap. Sep 15 21:03:39 laptop systemd[1]: Reached target Swap. Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable. ------------ can't find any "swap unit," but will look into the device unit you requested...
(In reply to comment #18) > (In reply to comment #16) > > same for me, even though something's wrong with my journalctl it seems. on > every reboot, it claims that the journal has been rotated, which shouldn't > be the case: > > ------------ > [root@laptop phani]# systemctl status swap.target > swap.target - Swap > Loaded: loaded (/usr/lib/systemd/system/swap.target; static) > Active: active since Sun 2013-09-15 21:03:38 IST; 10min ago > Docs: man:systemd.special(7) > > Sep 15 21:03:39 laptop systemd[1]: Starting Swap. > Sep 15 21:03:39 laptop systemd[1]: Reached target Swap. > Warning: Journal has been rotated since unit was started. Log output is > incomplete or unavailable. > ------------ > > can't find any "swap unit," but will look into the device unit you > requested... it says your journal is rotated because on reboot, the following happens: systemd closes all your applications. not all of them close gracefully. it tries to log crash data to journal, fails because the crash data is too big => bad shutdown => journal corruption. but that's a different story :D
ah, thanks for the explanation. and my device unit shows the same failure as hussam's of course.
@hussam: Based on what you have posted so far I'm a bit confused :-) It appears swap.target correctly requires the swap unit and the device correctly wants the swap unit, but swap.target is active without the swap unit being active... That shouldn't be possible... After a fresh boot, could you please do systemctl status dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap systemctl status dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.device systemctl status swap.target ?
replacing the UUID with my own, i get this: [root@laptop phani]# systemctl status dev-disk-by\x2duuid-de358999\913d\477d\a077\5704a4ef9f2b.swap dev-disk-byx2duuid-de358999913d477da0775704a4ef9f2b.swap - /dev/disk/byx2duuid/de358999913d477da0775704a4ef9f2b Loaded: loaded Active: inactive (dead) What: /dev/disk/byx2duuid/de358999913d477da0775704a4ef9f2b [root@laptop phani]# systemctl status dev-disk-by\x2duuid-de358999\913d\477d\a077\5704a4ef9f2b.device dev-disk-byx2duuid-de358999913d477da0775704a4ef9f2b.device Loaded: loaded Active: inactive (dead) [root@laptop phani]# systemctl status swap.target swap.target - Swap Loaded: loaded (/usr/lib/systemd/system/swap.target; static) Active: active since Mon 2013-09-16 03:08:08 IST; 19min ago Docs: man:systemd.special(7) Sep 16 03:08:09 laptop systemd[1]: Starting Swap. Sep 16 03:08:09 laptop systemd[1]: Reached target Swap. Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable. [root@laptop phani]# (still couldn't figure out what screws up the journal on shutting down.)
[root@hades el_linux]# systemctl status dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.swap dev-disk-byx2duuid-5ad323cax2dad74x2d4f4dx2dbaeax2d8d89c9072560.swap - /dev/disk/byx2duuid/5ad323cax2dad74x2d4f4dx2dbaeax2d8d89c9072560 Loaded: loaded Active: inactive (dead) What: /dev/disk/byx2duuid/5ad323cax2dad74x2d4f4dx2dbaeax2d8d89c9072560 [root@hades el_linux]# systemctl status dev-disk-by\x2duuid-5ad323ca\x2dad74\x2d4f4d\x2dbaea\x2d8d89c9072560.device dev-disk-byx2duuid-5ad323cax2dad74x2d4f4dx2dbaeax2d8d89c9072560.device Loaded: loaded Active: inactive (dead) [root@hades el_linux]# systemctl status swap.target swap.target - Swap Loaded: loaded (/usr/lib/systemd/system/swap.target; static) Active: active since Mon 2013-09-16 00:56:00 EEST; 17min ago Docs: man:systemd.special(7) Sep 16 00:56:00 hades systemd[1]: Starting Swap. Sep 16 00:56:00 hades systemd[1]: Reached target Swap. Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
btw, can't you simply review the culprit checkin I mentioned and see what it could have broken?
i had my uuids mixed up, but with the correct ones it still gives the same result, plus the "What: " line with 'systemctl status ~.swap'.
Turns out that our lazy unit loading got me fooled, as calling 'systemctl show' would trigger the default dependency logic, hiding the bug... I pushed a fix to git just now, at least it works for me. Could anyone confirm?
works now, thank you :D
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.