Link to home
Start Free TrialLog in
Avatar of Sam Hill
Sam Hill

asked on

Linux boot issue.

I am running the Mint 19 Tara OS on my laptop and I have an issue with my startup (boot) sequence.  Something is telling the system to encrypt my swap partition but I do not have a swap partition...  The "job" tries to run but it times out and fails.  It repeats itself numerous times during the boot sequence and wastes a lot of time during startup.

I need to identify what application is trying to run this job and why?  Then I need to figure out how to stop it from occurring.  I have no need for encryption on my computer at this point in time.  I am attaching a copy of the boot.log file so that the event in question can be viewed & identified.  It starts out with the line: "[* ] (1 of 2) A start job is running for dev-mapper-cryptswap1.device (8s / [** ] " and it appears that it is trying to encrypt two drives but I am not sure.

I'm attaching the boot.log file, any help with this would be appreciated.
Ken_bootlog.pdf
Avatar of David Favor
David Favor
Flag of United States of America image

Well... You can can likely fix this + the problem is some future update will create the same problem again.

Just create a small swap space + the problem will be fixed.
Avatar of Sam Hill
Sam Hill

ASKER

Hello,
Thanks for the reply.  By "small swap space" do you mean a partition?
I'll let you know how it works when I clarify your response.
Ken
I assume you use systemd for startup.

systemctl disable swap

probably stops that behaviour.

Swap space can also be a file  somewhere.  (as root)

dd if=/dev/zero of=/swapfile.keep bs=1M count=10   # 10 MB swapfile
chmod 600 /swapfile.keep 
mkswap /swapfile.keep

#and a line pointing to this file in fstab:
echo >>/etc/fstab   "/swapfile.keep      swap swap   sw 0 0"

Open in new window

Hello All,

I tried noci's suggestions with no results...  There was no swap enabled on my machine so I created a small swapfile and then rebooted.

ken@BirdBrain:~$ sudo systemctl disable swap
[sudo] password for ken:
Failed to disable unit: Unit file swap.service does not exist.
ken@BirdBrain:~$ su -
Password:
root@BirdBrain:~# dd if=/dev/zero of=/swapfile.keep bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB, 10 MiB) copied, 0.0181344 s, 578 MB/s
root@BirdBrain:~# mkswap /swapfile.keep
mkswap: /swapfile.keep: insecure permissions 0644, 0600 suggested.
Setting up swapspace version 1, size = 10 MiB (10481664 bytes)
no label, UUID=4ec96d84-d0bb-489d-ae82-46763f5485fd
root@BirdBrain:~# echo >>/etc/fstab  "/swapfile.keep  swap swap  sw 0 0"
root@BirdBrain:~#

I'm attaching the latest boot.log file, nothing appears to have changed...
"Unit file swap.service does not exist"

I saw this and it made me think...  could this be part of the issue?  I'm not sure what swap.service is and whether or not it should be there on my system???
cd /etc
grep -r -i swap\.service *


Let us know what you find.
No reason to reboot.

Just use the swapon + swapoff commands.

This will save your waiting for several minutes of boot time to ensure all's well.

Use this to see an overview of your current swap setup...

net14 # swapon --show
NAME      TYPE       SIZE USED PRIO
/dev/sdc4 partition 29.3G 780K   -2
/dev/sdd4 partition 29.3G   0B   -3
/dev/sdb4 partition 29.3G   0B   -4
/dev/sda4 partition 29.3G   0B   -5

Open in new window

For systemd  that most probably is:

cd /lib
grep -r -i swap\.service *....

anyway: systemctl list-unit-files should show the status of all services. Also the names, and also the failed services.

systemctl list-unit-files | grep enabled        shows all enabled units
systemctl list-unit-files | grep swap        shows all swap units
systemctl list-unit-files | grep enabled | grep -i swap        should show any enabled swap unit.

Use the name that shows up here to disable the service.

There is a manpage about cryptsetup.target which is less than helpful:
http://man7.org/linux/man-pages/man7/systemd.special.7.html

And the unit file is also less than helpful:
[Unit]
...
Description=Local Encrypted Volumes
Documentation=man:systemd.special(7)
...

Open in new window


So it is something handled Somwhere, Somehow in the systemd blob of code.....
The classic sysv scripting at least could be traced ...... ( the past isn't always better, but the future with systemd doesn't exactly seem to be nice as well).
I solved the issue and am still working to understand everything that was involved in its cause.  The main problem was in the /etc/initramfs-tools files. Specifically, one named 'resume'.

I edited out the reference to a non-existent swap partition UUID=1405da9d-f911-40b1-abea-fe2e33c52fd6 from the "resume" file in /etc/initramfs-tools. Ran 'update-initramfs -u' once again without errors.  This was a leftover reference to a deleted swap partition (there were two of them).  I remarked the second one out of fstab and then updated grub and initramfs.  Finally, no more lags in the boot process!

first run:
ken@BirdBrain:~$ sudo cat /var/log/boot.log
[sudo] password for ken:
Gave up waiting for suspend/resume device
/dev/sda3: clean, 2307125/19202048 files, 30419392/76799744 blocks
Started bpfilter
ken@BirdBrain:~$ sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-4.18.16-041816-generic
W: initramfs-tools configuration sets RESUME=UUID=1405da9d-f911-40b1-abea-fe2e33c52fd6
W: but no matching swap device is available.
ken@BirdBrain:~$

The other deleted swap partition was referenced in the fstab file: uuid-0d093982\x2d751[ **] (1 of 2)  After removing these two references and updating the relevant files all is well and my system boot time has decreased by a large amount.  The reason I edited the grub file was because I was trying to suspend the resume function during bootup but this was not the problem.  I finally discovered that the resume command for encrypting these deleted partitions was coming from the ramdisk via initramfs.  Once I got that figured out and removed the references everything was fine.

Many thanks to all who pitched in and tried to help.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.