0

Since some time I have problems that my Linux Ubuntu 18.04 is very slowly booting (sometimes 5-10 minutes). Strangely, this seems to have started since I edited the Swapfile or/and that I used Gparted. The top command and swapon -s command show that the Swapfile is working (I reserved 4 GB).

But the following command showed something weird:

sudo findmnt --verify --verbose

All lines are fine except the following warning appears:

[W] non-bind mount source /swapfile is a directory or regular file

What does that line exactly mean? Does it mean that it could not mount the swapfile? (while actually in the end it is working). So I wondered if something is wrong in my fstab file.

cat /etc/fstab

The swap line gives the following:

/swapfile none swap sw 0 0

I heard that problems of finding and mounting the swapfile during boot can slow down the whole process. The swapfile is running from the main disk so I wondered if the above line should be changed in something like this:

UUID=xx9999x9-9x99-9xx9-9999-xx9x9xx99xx9/swapfile none swap sw 0 0

Where the UUID is the hard disk. I did not use any partitioning.

Systemd-analyze blame gives the following output:

systemd-analyze blame | head
 17.041s dev-sda1.device
 11.192s dev-loop9.device
 11.056s dev-loop16.device
 10.964s dev-loop14.device
 10.704s dev-loop6.device
 10.703s dev-loop1.device
 10.703s dev-loop7.device
 10.703s dev-loop2.device
 10.702s dev-loop4.device
 10.687s dev-loop13.device

After having used sudo apt-get purge snapd this is the following:

systemd-analyze blame | head
    7.902s dev-sda1.device
    7.152s NetworkManager-wait-online.service
    5.121s ufw.service
    4.792s systemd-udevd.service
    4.539s docker.service
    4.298s accounts-daemon.service
    4.152s systemd-journal-flush.service
    3.970s apparmor.service
    3.808s avahi-daemon.service
    3.751s bluetooth.service

The command sudo blkid gives one line (I anonymized the ID). Previously, there were a lot of lines /dev/loopX: TYPE="squashfs"

    /dev/sda1: UUID="xx9999x9-9x99-9xx9-9999-xx9x9xx99xx9" TYPE="ext4"   PARTUUID="9999xx999-01"

A screenshot of Disks parameters:

SMART Data

Output of syslog:

grep -i FPDMA /var/log/syslog*

[ 48.245514] ata6.00: failed command: READ FPDMA QUEUED [ 48.247916] ata6.00: failed command: READ FPDMA QUEUED [ 48.250316] ata6.00: failed command: READ FPDMA QUEUED [ 48.252774] ata6.00: failed command: READ FPDMA QUEUED

Here follows a screenshot of Gparted:

Gparted

Another observation: when I start the computer, the screen stays black 5-10 minutes. Then after long waiting, it gives a title screen with the laptop mark. From there all seems to run smoothly. Just wanted to say this as it may indicate where during the booting something is going wrong. I wondered if the boot loader (Grub) can be broken, since I previously run dual boot on this system and removed Windows 7 recently.

File system table

sudo cat /etc/fstab
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=ae2158a5-6f28-4da8-8082-cc6d6bb20ed2 /               ext4       errors=remount-ro 0       1
/swapfile none            swap    sw              0       0


sudo blkid /dev/sda1: UUID="ae2158a5-6f28-4da8-8082-cc6d6bb20ed2" TYPE="ext4" PARTUUID="630bb523-01"

BIOS version

sudo dmidecode -s bios-version
1.03.05

Motherboard infos:

TUXEDO Book DC1504
Model: W650SJ
Clevo CO

sudo dmidecode -t 2

dmidecode 3.1

Getting SMBIOS data from sysfs. SMBIOS 2.8 present.

Handle 0x0002, DMI type 2, 15 bytes Base Board Information Manufacturer: Notebook
Product Name: W65_67SJ
Version: Not Applicable
Serial Number: Not Applicable
Asset Tag: Tag 12345 Features: Board is a hosting board Board is replaceable Location In Chassis: Not Applicable Chassis Handle: 0x0003 Type: Motherboard Contained Object Handles: 0

I am running Ubuntu 18.04.5 LTS.

Grub

The command dpkg -l grub* | grep ii gives the following output:

ii  grub-common           2.02-2ubuntu8.18 amd64        GRand Unified Bootloader (common files)

ii grub-gfxpayload-lists 0.7 amd64 GRUB gfxpayload blacklist

ii grub-pc 2.02-2ubuntu8.18 amd64 GRand Unified Bootloader, version 2 (PC/BIOS version)

ii grub-pc-bin 2.02-2ubuntu8.18 amd64 GRand Unified Bootloader, version 2 (PC/BIOS binaries)

ii grub2-common 2.02-2ubuntu8.18 amd64 GRand Unified Bootloader (common files for version 2)

Thank you for your help!

1 Answers1

2

You probably made a mistake when you "edited" the /swapfile.

  • "seems to have started since I edited the Swapfile"

  • "/swapfile is a directory or regular file"

The correct process for creating/resizing to a 4G /swapfile...

Note: Incorrect use of the dd command can cause data loss. Suggest copy/paste.

sudo swapoff -a           # turn off swap
sudo rm -i /swapfile      # remove old /swapfile

sudo dd if=/dev/zero of=/swapfile bs=1M count=4096

sudo chmod 600 /swapfile # set proper file protections sudo mkswap /swapfile # init /swapfile sudo swapon /swapfile # turn on swap free -h # confirm nnG RAM and 4G swap

Confirm this line in /etc/fstab... and confirm no other “swap” lines...

/swapfile    none    swap    sw      0   0

reboot                    # reboot and verify operation

Update #1:

You have some NCQ errors with your disk.

Native Command Queuing (NCQ) is an extension of the Serial ATA protocol allowing hard disk drives to internally optimize the order in which received read and write commands are executed.

Edit sudo -H gedit /etc/default/grub and change the following line to include this extra parameter. Then do sudo update-grub to write the changes to disk. Reboot. Monitor hangs, and watch /var/log/syslog or dmesg for continued error messages.

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash libata.force=noncq"

If this doesn't help cure the problem, we'll come back and bad block the disk.

Update #2:

Since you're still having problems, we'll do this to troubleshoot the slow startup times.

Edit /etc/default/grub.

change this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash libata.force=noncq"

to this:

GRUB_CMDLINE_LINUX_DEFAULT="libata.force=noncq"

then:

sudo update-grub

reboot

This will now show a lot of text on the screen during the reboot. When it stalls or pauses, the last item on the screen will give us a clue as to what's wrong. Take a clear picture of that and upload it into your question, and then ping me.

Your SMART data doesn't show any bad block problems. It DOES show lots of read errors, which the NCQ patch MAY have taken care of.

Update #3:

Note: You should have good backups, just in case of problems.

We'll update your ramdisk, and reinstall GRUB.


ls -al /boot/initrd* # note the size of these files

sudo update-initramfs -c -k $(uname -r) # recreate the ramdisk file

ls -al /boot/initrd* # note if the file sizes have changed

reboot # see if it boots any faster now


dpkg -l grub* | grep ii # show current grub file packages installed

sudo apt install --reinstall package_name_here # for each GRUB package listed above

sudo update-grub # update GRUB

reboot # see if it boots any faster now

Update #4:

To check for a newer BIOS, you must create a user account at https://www.tuxedocomputers.com/index.php?module=account

To contact Tuxedo support, call tel:+4982189982992, and email at https://www.tuxedocomputers.com/en/Contact.tuxedo

heynnema
  • 73,649