From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UGCzGYFugmIPiAAAbAwnHQ (envelope-from ) for ; Mon, 16 May 2022 17:32:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AIW2GYFugmKNPwAA9RJhRA (envelope-from ) for ; Mon, 16 May 2022 17:32:17 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BD7B2F3B5 for ; Mon, 16 May 2022 17:32:16 +0200 (CEST) Received: from localhost ([::1]:43960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nqchj-0004qo-U6 for larch@yhetil.org; Mon, 16 May 2022 11:32:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nqcRM-0000Xk-NJ for help-guix@gnu.org; Mon, 16 May 2022 11:16:04 -0400 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]:34617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nqcRE-00047w-7w for help-guix@gnu.org; Mon, 16 May 2022 11:15:15 -0400 Received: by mail-il1-x12e.google.com with SMTP id j7so1317025ila.1 for ; Mon, 16 May 2022 08:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=gnuV3eTBjfdYVC4qK2hHUQOUbNTUoghRfnx02/KtX+c=; b=U/uX6jaE6rCSvQkzTxO4QnRjkh0zFUDxi08vcx9A7xe/tp5Ke2Qsa4VZlw6nxCvWsr Hl3r4OMOrDbUxBjwc5yhJpEUrpabHQCM7CfNKofNXedo9wZflAoINK4uBIviamDO8dtO OLlN6Boi8Q1PD1YqgqJfTTmQYB72bfbgNDxUSGRCD260xbB7OwudUCfzVYfEHTzQ4TrN ImE9/5c+/ZaBMAZh8VCK0OQyvAVvZd0wQvWCSJweVtIJqRuSkYAf5FixDkxwq6fikY2/ iTSVkgczEH6bepoiwd9d1EZkv+F7KdQEZPeThVUZ4i3jwOAEf+9e6vpvyYAEF+RUsi+T HZUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=gnuV3eTBjfdYVC4qK2hHUQOUbNTUoghRfnx02/KtX+c=; b=LWZu1lXIim6pKpBIFxO7tK0Y8CyOZxp2xM7FKtOLZ6Dh1oOOefE0iYXex+AF1GkaD1 t8y5stWCiBC6g6xKE9/qrf545/maX0BfIn/jq4DXFVWHVDi0YPRwT17Dbwi1bG8ueGiU wv/O8XSgqMY0p+a1/1xDyG4Ph0f4Hz0UIVwcfEJLdu4/aBm/g/vNC6YfVUn1WC+kfUSm cJhuAI3wa+KFfqZz3q9gQFDHzPrKLJiREG6YdUu8+MU5s7bSKU/nFIUXBwulkfXb/c20 gSRIDvaZ5O5eL2KQp5A5NYNY1kc3hipnp3I0QJ7qZabvP+8+GjS3CkXoZYD9Rqgk2J60 79UA== X-Gm-Message-State: AOAM531GyqHnZcxmhD9eBRH+mpRbGG4wbCqlXDC02FfL6LCKr3gMu7Xw 3nj/EbRILexpw8JZvWHwqu7DVmN8ZzE= X-Google-Smtp-Source: ABdhPJxYAmiIplW63CZ+EIFPCDg7GOf5QT45u9MoMygd8KHNQ3WBXVFMchMFGMCU4ZAINUi5arS2qA== X-Received: by 2002:a05:6e02:1a64:b0:2d1:1e5c:103f with SMTP id w4-20020a056e021a6400b002d11e5c103fmr2879440ilv.275.1652714108232; Mon, 16 May 2022 08:15:08 -0700 (PDT) Received: from washu-v4 (172-221-246-205.res.spectrum.com. [172.221.246.205]) by smtp.gmail.com with ESMTPSA id k17-20020a02ccd1000000b0032e40f3e40dsm457682jaq.124.2022.05.16.08.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 May 2022 08:15:07 -0700 (PDT) From: Katherine Cox-Buday To: raingloom Cc: Guix Help Subject: Re: Why does setting a language in Grub take 1.5 minutes? References: <87ee0u2y66.fsf@gmail.com> <20220516020421.0fbfad9c@riseup.net> Date: Mon, 16 May 2022 10:15:07 -0500 In-Reply-To: <20220516020421.0fbfad9c@riseup.net> (raingloom@riseup.net's message of "Mon, 16 May 2022 02:04:21 +0200") Message-ID: <87fsl9y0ec.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::12e; envelope-from=cox.katherine.e@gmail.com; helo=mail-il1-x12e.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URI_NOVOWEL=0.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652715136; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=gnuV3eTBjfdYVC4qK2hHUQOUbNTUoghRfnx02/KtX+c=; b=aYUQNqloSjcQm1PW6S8pZf5rKaMqjIrBFL3RfrfGh/vrv9jXtY/3IngkZ+qX7EWoE07BMm thm7KPpoX1NiW8qNbSlxrehQ4AYZHc6A/UKjnYfOcgtOAZQdbegb8MGdc+jOEttrKJYuyh lylf35pJUi3bUticCt+oimswJw5CC1CP0AQu/znoUsY+jTv7gNyTkBm3Zp2fF7egluuLju j3wmv2zNmRPfy09yWtiqHWmaX2ycpBVSyLITA/WKUCVhporg2gc+GZqFnGvJPJYsDfrO5r IvV4+YnrBoTPhHl5cS2NOH+OHqwXQYaZiA0sw+S3608z6VFVB3b1nMSsRRtxeA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652715136; a=rsa-sha256; cv=none; b=pI7qxxJcNQqbw45psNmVBQCWtC+uuxGj1xMbuviq/8k/9Z+/XFIqedd/QDlTzIT0wBHQca 6zLGLY8RjwVX85A/fOZqk0wqmXyKFHM6ke3/CVgkpAK5S9FOuCSFHCUD5+TxASEF8Z8/qG roFLVQjFg6KZMt3+cWLzoqPCoY/HwMVch9aSX9bvVOQKnDDlkNJV09mVeBNbHRh/YLaNCP zd3OYdZFb/aqkz88ZcDkI7jef2BDItgN1X+3HNkkLqun4kIYuvIJP42cPTh95dQOVYqSNC 4g+gg6qeDZYu8ZVzvbgwDT+mUotVBGaHMtlnfrwwurccDmxVJugR6TqxD9NkZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="U/uX6jaE"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -7.83 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="U/uX6jaE"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: BD7B2F3B5 X-Spam-Score: -7.83 X-Migadu-Scanner: scn0.migadu.com X-TUID: hcEEQmQ3g91z raingloom writes: > On Sun, 15 May 2022 18:06:41 -0500 > Katherine Cox-Buday wrote: > >> At some point, after a long time with no problems, my system began >> taking an unreasonably long time to boot. I only reboot my system >> ~1/week for updates, so I never took the time to debug the problem, >> and therefore, I couldn't really connect the issue with any changes >> that either I or Guix had made. >>=20 >> I'm now trying to debug a wake from hibernate issue, and this >> involves a lot of rebooting, so I had to figure this out. I have, and >> I'm unsure why what I found is causing issues, and whether it's a >> Guix bug, or something wrong with my setup. >>=20 >> Here's my partition layout: >>=20 >> #+begin_example >> $ lsblk >> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS >> nvme0n1 259:2 0 931.5G 0 disk >> =E2=94=9C=E2=94=80nvme0n1p1 259:3 0 549M 0 part /boot/efi >> =E2=94=94=E2=94=80nvme0n1p2 259:4 0 931G 0 part >> =E2=94=94=E2=94=80cryptroot 253:0 0 931G 0 crypt /var/lib/dock= er >> /gnu/store >> / >> #+end_example >>=20 >> There are no filesystem errors. >>=20 >> Here's the bootloader portion of my operating-system: >>=20 >> #+begin_example >> (bootloader >> (bootloader-configuration >> (bootloader grub-efi-bootloader) >> (targets (list "/boot/efi")) >> (keyboard-layout keyboard-layout))) >> #+end_example >>=20 >> Here's part of my /boot/grub/grub.cfg, generated by Guix. I've added >> some echo statements to help debug. >>=20 >> #+begin_example >> echo "C" >>=20 >> # Set 'root' to the partition that contains /gnu/store. >> search --file --set >> /gnu/store/9lcbyg3pkb38chhv0yzk6hn3arxfjfgk-grub-image.png echo "D" >>=20 >>=20 >> if loadfont unicode; then >> set gfxmode=3Dauto >> insmod all_video >> echo "E" >> insmod gfxterm >> echo "F" >> fi >>=20 >> terminal_output gfxterm >> echo "G" >>=20 >> insmod png >> echo "H" >> if background_image >> /gnu/store/9lcbyg3pkb38chhv0yzk6hn3arxfjfgk-grub-image.png; then echo >> "H.1" set color_normal=3Dlight-gray/black >> echo "H.2" >> set color_highlight=3Dyellow/black >> echo "H.3" >> else >> set menu_color_normal=3Dcyan/blue >> set menu_color_highlight=3Dwhite/blue >> fi >> echo "I" >> Localization configuration. >> search --file --set >> /gnu/store/mdrdpd6aw9ikx1wzx6ljydpzvnvwpq0y-grub-locales/en@quot.mo >> echo "J" set >> locale_dir=3D/gnu/store/mdrdpd6aw9ikx1wzx6ljydpzvnvwpq0y-grub-locales >> echo "K" set lang=3Den_US >> echo "L" >> insmod keylayouts >> echo "M" >> keymap /gnu/store/pgg50qzm7d2q6k0f82c43fmsxwpwrjvx-grub-keymap.us >> echo "N" >> #+end_example >>=20 >> And here are the time elapsed between steps (at least the ones that >> didn't go by too quickly), in seconds: >>=20 >> C -> D : 13 >> H -> I : 13 >> I -> K : 27 >> K -> M : 157 (!!!!) >> M -> N : 20 >>=20 >> That's almost 4 minutes from unlocking the luks volume to get to the >> Grub menu, and then another 4 minutes to boot into the Kernel. >>=20 >> I then removed the keyboard configuration and changed the theme so >> that it wouldn't load an image: >>=20 >> #+begin_example >> (bootloader >> (bootloader-configuration >> (bootloader grub-efi-bootloader) >> (targets (list "/boot/efi")) >> (theme (grub-theme >> (inherit (grub-theme)) >> (image #f))))) >> #+end_example >>=20 >> It produces a grub.cfg with this in it (again, echoes added): >>=20 >> #+begin_example >> echo "A" >> set >> locale_dir=3D/gnu/store/mdrdpd6aw9ikx1wzx6ljydpzvnvwpq0y-grub-locales >> echo "B" set lang=3Den_US >> echo "C" >> #+end_example >>=20 >> Between B -> C, it still takes 157 seconds. >>=20 >> Does anyone know why this is taking so long or how to fix it? As it >> is, I'll have to manually edit my grub.cfg after every system >> reconfigure. >>=20 >> Thank you, > > A guess: since LUKS seems to be involved, mayyybe it's an entropy > issue? There was a time when booting took a while on my Thinkpad > because the ssh key generations was not set up correctly or something. Do you recall any more details? I'm struggling to think of how ssh key generation would impact startup? Unless you meant they both had the same symptom which led you to look into entropy? When I first started investigating, my first guess was something related to LUKS too, but it actually unlocks the drive pretty quickly, which is why I began investigating the steps in Grub. Also, I'm not very familiar with LUKS, but doesn't it only use Linux's random facilities for key generation? I didn't think it used it to unlock or decrypt. There are also some comments[1] in Guix's grub code suggesting that traversing the store is an expensive operation. I'm not sure why this is, since it's pointing to pretty specific files. If this is the case, I wanted to open an issue to determine what it is about configurations like mine that make booting take so long (I assume everyone would be complaining if this was more prevalent), and if it's something we can avoid, explore alternative grub.cfg generation to mitigate the problem. > A quick way to check would be to hit random keys, if it makes booting > much faster, it's probably an entropy issue. I kind of doubt this is it. Linux generates entropy from mouse movement too, doesn't it? When I play games on this machine, it involves a lot of mouse movement, and it hasn't ever seemed to impact the time it's taken to boot. And actually, once the boot time got worse, it never really changed after that, for better or for worse. Still, I'm often wrong, so I'll try it! [1] - https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/bootloader/grub.s= cm?h=3Dmaster#n454 Thank you! --=20 Katherine