2

I've got a weird problem with my Ubuntu Ubuntu 20.04.1. Actually release version doesn't matter because the problem was even before release upgrade. During every boot the system does something for 2 minutes. dmesg shows following:

[    3.882138] ata3.00: ATA-10: ST2000DM008-2FR102, 0001, max UDMA/133
[    3.882831] ata3.00: 3907029168 sectors, multi 16: LBA48 NCQ (depth 32), AA
[    3.933436] ata3.00: configured for UDMA/133
[    3.934299] scsi 2:0:0:0: Direct-Access     ATA      ST2000DM008-2FR1 0001 PQ: 0 ANSI: 5
[    3.935284] sd 2:0:0:0: Attached scsi generic sg1 type 0
[    3.935293] sd 2:0:0:0: [sdb] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    3.936220] scsi 3:0:0:0: Direct-Access     ATA      ST2000DX002-2DV1 CC41 PQ: 0 ANSI: 5
[    3.936749] sd 2:0:0:0: [sdb] 4096-byte physical blocks
[    3.937663] sd 3:0:0:0: Attached scsi generic sg2 type 0
[    3.937710] sd 3:0:0:0: [sdc] 3907029168 512-byte logical blocks: (2.00 TB/1.82 TiB)
[    3.937711] sd 3:0:0:0: [sdc] 4096-byte physical blocks
[    3.937719] sd 3:0:0:0: [sdc] Write Protect is off
[    3.937720] sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00
[    3.937732] sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.938193] sd 2:0:0:0: [sdb] Write Protect is off
[    3.942949] sd 2:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    3.942960] sd 2:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.951078]  sdc: sdc1
[    3.951910] sd 3:0:0:0: [sdc] Attached SCSI disk
[    3.991298] sd 2:0:0:0: [sdb] Attached SCSI disk
[    4.013571] random: fast init done
[    4.028472] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    4.028473] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    4.028504] random: systemd-udevd: uninitialized urandom read (16 bytes read)
[    4.153986] raid6: sse2x4   gen() 15011 MB/s
[    4.201978] raid6: sse2x4   xor() 10212 MB/s
[    4.249981] raid6: sse2x2   gen() 12737 MB/s
[    4.297979] raid6: sse2x2   xor()  8628 MB/s
[    4.345979] raid6: sse2x1   gen() 10930 MB/s
[    4.393982] raid6: sse2x1   xor()  7474 MB/s
[    4.394456] raid6: using algorithm sse2x4 gen() 15011 MB/s
[    4.394916] raid6: .... xor() 10212 MB/s, rmw enabled
[    4.395369] raid6: using ssse3x2 recovery algorithm
[    4.396664] xor: automatically using best checksumming function   avx
[    4.397942] async_tx: api initialized (async)
[    4.405574] device-mapper: raid: Loading target version 1.14.0
[    4.428421] md/raid1:mdX: active with 2 out of 2 mirrors
[    9.604725] random: crng init done
[    9.605236] random: 8 urandom warning(s) missed due to ratelimiting
[  120.809255] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
[  132.661535] systemd[1]: Inserted module 'autofs4'

/etc/fstab output:

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
UUID=5b736f72-d735-45ca-a5db-fd0a4eef2fa7 /               ext4    errors=remount-ro 0       1
UUID=C824-BAB7  /boot/efi       vfat    defaults      0       1
UUID=d986c290-d182-474b-a05b-91b649aea538                                 none            swap    sw              0       0
UUID=942e0b01-4bf8-4dfe-a9ee-5d4a59dcb0ce       /mnt/mirror     ext4    errors=remount-ro,x-systemd.device-timeout=300 01
UUID=f2c269d7-9346-4686-b697-325d44ad1023       /mnt/storage    ext4    errors=remount-ro       0       1

When I look at the monitor during boot I see something regarding checking the root file system. But later on I can't find this entry anywhere in the logs. Also during this 2 minutes pause I hear heavy usage of the HDD although my root file system is located on SDD (I have 2 mirrored HDDs).

What could it be? Not that it's a big problem but annoys a little.

Ralfeus
  • 133
  • After a boot, you can run systemd-analyze blame. This will give you an idea of how long a unit takes to load. If you see some numbers out of the ordinary, it might help pinpoint the offending service. For more info about the command: https://www.freedesktop.org/software/systemd/man/systemd-analyze.html#systemd-analyze%20blame – Dan Nov 23 '20 at 19:02
  • At once after a reboot sudo cat /proc/sys/kernel/random/entropy_avail this shows if it is really an entropie problem. – nobody Nov 23 '20 at 19:12
  • How are you mounting sda2? And what is it? Post this: cat /etc/fstab Does it need a full fsck? – oldfred Nov 23 '20 at 19:19
  • sda2 is my root FS. fstab is added to the post – Ralfeus Nov 23 '20 at 19:24
  • @nobody:
    3054
    

    is it large or small?

    – Ralfeus Nov 23 '20 at 19:34
  • @Dan, delay occurs before units are loaded: Startup finished in 2min 12.595s (kernel) + 9.797s (userspace) = 2min 22.392s – Ralfeus Nov 23 '20 at 19:36
  • @ralfeus that is okay. – nobody Nov 23 '20 at 19:41
  • Are your mirror & storage drives internal or external? I just add noatime for SSD mounts and relatime for HDD internal drive mounts. Some reason for timeout of 300, you if that slow you may want noauto or autofs, if external drive. https://askubuntu.com/questions/1047109/how-can-i-delay-mount-of-secondary-internal-hard-drive-on-boot – oldfred Nov 24 '20 at 03:46
  • @oldfred, /mnt/mirror and /mnt/storage FS are located on mirrored and simple lvm volumes respectively. HDDs are internal, separated from root FS (which is on SDD). I tried to add noauto to their entries in /etc/fstab - no luck. Moreover /mnt/mirror contains DB files so MySQL doesn't start if one isn't mounted automatically – Ralfeus Nov 24 '20 at 07:30
  • Just noticed the mirror entry has 01 not 0 1, is that something from copy or is that in your entry in fstab? My / on SSD has this for mount noatime,errors=remount-ro 0 1 but data partition use 0 2, See man fstab as only root should be 1 and others 2. Or if not ext4, then 0. – oldfred Nov 24 '20 at 14:46
  • @oldfred it was "0 1". I've changed it to "0 2" as you suggested. No changes though are in outcome – Ralfeus Nov 24 '20 at 17:41

1 Answers1

0

This message is usually the result of something that exhausts the entropy pool on your system. This is typically refilled over time through various actions (such as disk activity, keyboard timings, mouse movements, etc). The simplest solution would be to use something like haveged:

apt-get install haveged

To have this start at boot, use this:

update-rc.d haveged defaults
  • Can you explain why would this solve the HDD usage and boot time the OP is having? – Dan Nov 23 '20 at 18:52
  • Ah, forgot to address the hard disk thrashing. When this is seen with the issue is often — but not always — something to do with initramfs. This usually solves it: sudo update-initramfs -uk all. From here the system should boot noticeably faster. –  Nov 23 '20 at 19:06
  • 1
    @Matigo, I have that installed and yet it yields no results. Also I tried update-initramfs -uk all. Still there is no joy. – Ralfeus Nov 23 '20 at 19:13