Page 1 of 1

auchk taking too long

Posted: Thu Oct 03, 2024 7:47 pm
by wognath

On booting Fatdog 813, auchk appears to be taking longer with each boot; it's now up to almost 2 minutes.

Since my storage is SSD, my first guess was that maybe it needed to be trimmed. I did

Code: Select all

mount -o remount,discard /dev/mapper/dmcrypt0 /dev/sda2 ; fstrim -a

but this did not help. (For future reference, can the discard option be added during boot? )

Anyway, the problem seems to be pup_init = static busybox (initrd) according to faqs. Thanks in advance for suggestions.

Code: Select all

from dmesg
[   25.274275] random: crng init done
[   25.389816] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: (null)
[   25.580665] aufs test_add:291:exe[225]: uid/gid/perm /aufs/pup_ro 0/0/0755, 0/500/0755
[   25.580700] aufs test_add:291:exe[225]: uid/gid/perm /aufs/kernel-modules 0/0/0755, 0/500/0755
[   25.580731] aufs test_add:291:exe[225]: uid/gid/perm /aufs/pup_init 0/0/0755, 0/500/0755
[  133.220841] aufs test_add:291:busybox[15601]: uid/gid/perm /aufs/pup_ro10 0/0/0755, 0/500/0755
[  133.277962] udevd[15603]: starting version 3.2.5

lsblk
sda          	111.8G                                  
├─sda1           	4G ext4        	/mnt/sda1            
├─sda2        		10.3G crypto_LUKS                      
│ └─dmcrypt0  	10.3G             /mnt/sda2            
└─sda3        		48.8G ext4  

inxi
System:    Host: fatdog64-e26 Kernel: 4.19.320 x86_64 bits: 64 Desktop: Openbox 3.6.1
           Distro: Fatdog64 Linux 813
Machine:   Type: Laptop System: LENOVO product: 20021,2959 v: Lenovo Ideapad S12
           serial: 1S168002940000ZT
           Mobo: LENOVO model: MoutCook serial: EB14595608 BIOS: LENOVO v: 20CN23WW date: 07/17/2009
CPU:       Info: Single Core VIA Nano U2250 ( Capable) [UP] speed: 800 MHz min/max: 800/1600 MHz
Graphics:  Message: No device data found.
           Device-1: N/A type: USB driver: uvcvideo
           Display: server: X.Org 1.20.14 driver: loaded: openchrome resolution: 1280x800~60Hz
           OpenGL: renderer: llvmpipe (LLVM 8.0.1 128 bits) v: 4.5 Mesa 20.3.5

Re: auchk taking too long

Posted: Thu Oct 03, 2024 9:22 pm
by p310don

Why is auchk running each time you boot?

It usually only runs when there has been an unclean shutdown


Re: auchk taking too long

Posted: Fri Oct 04, 2024 12:19 am
by wognath

pc310don, thanks for asking! For some reason, /etc/booted is not getting removed. While I figure it out, I've remarked out auchk from rc.sysinit. I still wonder why auchk is taking so long.


Re: auchk taking too long

Posted: Fri Oct 04, 2024 4:03 am
by p310don

My next question would be, What's wrong with your hard drive? If it is always wanting to do a auchk, a filesystem check, is there something dying?

How old is it?

Is it doing anything else screwy?

Have you done a backup, just in case?


Re: auchk taking too long

Posted: Fri Oct 04, 2024 6:07 am
by wognath

As far as I know, the ssd is good. It is a good brand (Crucial) and hasn't had a lot of use. It's not doing anything screwy that I can see, but I have a backup.
I think if /etc/booted exists at boot, it means that there has been a shutdown that hasn't gone through rc.shutdown, where the file is deleted after services and processes have been stopped. Please correct me if that's wrong. If I'm right, then these auchks don't necessarily indicate a disk problem, but rather that I messed up some script so that the file is not getting deleted. Anyway, for now I have disabled the auchk on boot. I'll have to remember to run it manually if I have a bad shutdown.
Thanks again for telling me that auchk is not supposed to run at every startup.


Re: auchk taking too long

Posted: Fri Oct 04, 2024 8:41 am
by JakeSFR

Do you use savefile/dir in RAM mode (savefile=ram:...)?
If so, did you also disable periodic saves (RAM save interval = 0 in Fatdog64 Event Manager)?

That would make the /etc/booted file not being deleted from the savefile/dir at shutdown.

If that's the case, I'd suggest using a really big interval instead, like 999999999, in which case periodic saves are still disabled, but the session is saved on shutdown, what deletes the /etc/booted file, so there is no auchk on next boot.

Otherwise, it would require deleting that file at shutdown directly from savefile/dir, not only from tmpfs layer.

Greetings!


Re: auchk taking too long

Posted: Fri Oct 04, 2024 5:17 pm
by wognath
JakeSFR wrote:

Do you use savefile/dir in RAM mode (savefile=ram:...)?
If so, did you also disable periodic saves (RAM save interval = 0 in Fatdog64 Event Manager)?

That would make the /etc/booted file not being deleted from the savefile/dir at shutdown.

Yes and yes.

If that's the case, I'd suggest using a really big interval instead, in which case periodic saves are still disabled, but the session is saved on shutdown... Otherwise, it would require deleting that file at shutdown directly from savefile/dir, not only from tmpfs layer.

I prefer to save at shutdown only on demand, so I kept save interval=0, deleted /etc/booted from the savefile and altered my shutdown script to remove /etc/booted before optional save.
No more auchk! :)

Thanks, JakeSFR.

Edit: my "solution" fails in some cases. Better to add "[ $RAMSAVEINTERVAL -eq 0 ] && rm $SAVEFILE_MOUNT/etc/booted" to rc.local.shutdown