• [gentoo-user] Removing or renaming old /boot/grub directory warning

    From Dale@21:1/5 to All on Sat Feb 5 07:40:01 2022
    Howdy,

    I asked about this in a thread recently but can't find it now.  Not sure
    why because it wasn't that long ago.  In that thread, I was asking about deleting /boot/grub as it was used for the old grub, not the new and
    improved monster sometimes referred to as grub2.  I think it was Neil
    that suggested just renaming the directory to grub.old.  Thought that
    was a reasonable suggestion so that's what I did.  Dang, Neil gives some seriously good advice plus he has those nifty signature lines.  ;-)  I
    had some kworker process that just wouldn't go away and was using a good
    bit of CPU time for some reason.  I decided to reboot to reset that and
    guess what, grub puked all over my keyboard about a missing file. 
    Anyone care to guess where that file lives? 

    TLDR, skip to last paragraph.  After the nasty puking job, I had a grub
    rescue prompt.  No freaking clue what to do so out comes the cell phone
    and a bit of googling.  Couldn't figure it out so I dug around and found
    a old Knoppix DVD and used that to boot with.  I used the mv command to
    rename the directory after starting lvm, mounting stuff etc etc.  I
    wanted to reinstall grub but had issues using chroot.  Anyway, I
    rebooted and grub worked. 

    Of course, I recently updated to a new kernel, it got about 2 seconds
    into the boot up and it puked on my keyboard with a panic.  Reboot again
    and use previous kernel, anyone not understand why I keep backup
    kernels?  ROFL  Now here's the kicker.  After getting booted up with the previous kernel, screen 2 on my video card wouldn't work.  That's my TV screen.  I ended up having to do a complete power off, what some call a
    hard reset.  Rebooted witha working grub, a known good kernel, that can
    find all the files it needs, and my second screen comes up. 

    Should I reinstall grub after removing the old directory so it puts
    things where it needs to be or what?  Or does a new install have that
    old directory too?  While at it, is there something that can give me
    better options in cases like this or do I need to stop renaming stuff?

    The reason for the post is the above questions and this.  If you have a
    old grub directory in /boot, do not delete or rename that until you know
    grub has all the files it needs elsewhere.  It will get upset and it
    won't do you any good either.  Right now, I don't have to wash my hair,
    I can just polish my head.  I pulled out a lot of hair dealing with this
    and I'd rather no one else had to. 

    Dale

    :-)  :-)

    P. S.  Since my old system rescue CD didn't work, I think it's
    scratched, I'm off to make some rescue options, sysrescue and Knoppix
    too, just to be sure. 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Arve Barsnes@21:1/5 to Dale on Sat Feb 5 09:00:02 2022
    On Sat, 5 Feb 2022 at 07:37, Dale <rdalek1967@gmail.com> wrote:
    Should I reinstall grub after removing the old directory so it puts
    things where it needs to be or what? Or does a new install have that
    old directory too? While at it, is there something that can give me
    better options in cases like this or do I need to stop renaming stuff?

    For what it's worth, this machine is new enough to only ever having
    had grub2 on it, and the directory in /boot is still named /boot/grub

    Regards,
    Arve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Arve Barsnes on Sat Feb 5 09:40:02 2022
    Arve Barsnes wrote:
    On Sat, 5 Feb 2022 at 07:37, Dale <rdalek1967@gmail.com> wrote:
    Should I reinstall grub after removing the old directory so it puts
    things where it needs to be or what? Or does a new install have that
    old directory too? While at it, is there something that can give me
    better options in cases like this or do I need to stop renaming stuff?
    For what it's worth, this machine is new enough to only ever having
    had grub2 on it, and the directory in /boot is still named /boot/grub

    Regards,
    Arve



    I have a grub, old from original install, and grub2, that was added when
    I switched to the new grub.  I would have thought the old directory was
    no longer needed but it appears it is for some reason.  I've reinstalled
    using the grub-mkconfig command but have not reinstalled using the
    grub-install command.  I'm tempted to rename the old directory, install
    like I would from a fresh new install, MBR and all, then see if it
    boots.  Thing is, having to use the rescue tools if it fails is a bit of
    a pain.  Also, I need to let my hair regrow a bit.  ;-)

    I'm so glad I had printed the info I needed and filed it in a folder.  I
    would have been in a real bad situation if I hadn't. 

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Michael on Sat Feb 5 10:40:02 2022
    Michael wrote:
    On Saturday, 5 February 2022 08:37:48 GMT Dale wrote:
    Arve Barsnes wrote:
    On Sat, 5 Feb 2022 at 07:37, Dale <rdalek1967@gmail.com> wrote:
    Should I reinstall grub after removing the old directory so it puts
    things where it needs to be or what? Or does a new install have that
    old directory too? While at it, is there something that can give me
    better options in cases like this or do I need to stop renaming stuff?
    For what it's worth, this machine is new enough to only ever having
    had grub2 on it, and the directory in /boot is still named /boot/grub

    Regards,
    Arve
    I have a grub, old from original install, and grub2, that was added when
    I switched to the new grub. I would have thought the old directory was
    no longer needed but it appears it is for some reason.
    You don't provide enough information about your /boot, fs layout, etc., so it is difficult to know why the new GRUB2 failed to work. As a rule of thumb, if
    GRUB2 had worked before the likely problem is file corruption, or forgetting to run grub-mkconfig after you made and copied over your new kernel and initrd
    - it depends on what the message was when it failed to boot and what file it couldn't find.

    I'd run fsck on the /boot partition to make sure there is no fs corruption and
    hdparm on the disk would be advisable too.


    It failed with a missing normal.mod file.  That file is in the old grub directory.  Once I renamed the directory back to what grub expected, the system loaded grub fine.  There's been other threads about kernel boot problems and the one I recently built could be having one of those
    problems.  I haven't looked into that.  I doubt there is any file system problem.  The problem was me renaming a directory that grub still needs
    files from.  There is likely a way around this but my post was to warn
    others that renaming that directory could cause problems. 


    I've reinstalled
    using the grub-mkconfig command but have not reinstalled using the
    grub-install command. I'm tempted to rename the old directory, install
    like I would from a fresh new install, MBR and all, then see if it
    boots. Thing is, having to use the rescue tools if it fails is a bit of
    a pain. Also, I need to let my hair regrow a bit. ;-)
    Take a look at this page to make sure you don't remove some GRUB file needed for a boot:

    https://wiki.gentoo.org/wiki/GRUB2_Migration

    There are other GRUB related pages in the wiki to help with configuring GRUB2.

    BTW, you don't need the old legacy GRUB as a fall back to boot your system. You can use a LiveCD/DVD/USB and you can configure your GRUB2 to boot this from your /boot, or some rescue partition on disk. Of course, if GRUB or your
    /boot fs/partition is borked, then a LiveUSB is always handy. ;-)


    That's the page I followed way back when I switched.  It worked fine and
    was nice to have it chainload which gives one a backup boot method. 

    I don't have the old grub installed, just a directory that was installed
    by the old grub but contains files that the new grub needs.  The file
    and path it needs is this:  /boot/grub/i386-pc/normal.mod  Why that
    isn't installed in the new grub directory and told to look there for it,
    I have no idea at the moment.  I may test it one day but don't feel the
    desire to try it today. 

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sat Feb 5 09:12:33 2022
    On Saturday, 5 February 2022 08:37:48 GMT Dale wrote:
    Arve Barsnes wrote:
    On Sat, 5 Feb 2022 at 07:37, Dale <rdalek1967@gmail.com> wrote:
    Should I reinstall grub after removing the old directory so it puts
    things where it needs to be or what? Or does a new install have that
    old directory too? While at it, is there something that can give me
    better options in cases like this or do I need to stop renaming stuff?

    For what it's worth, this machine is new enough to only ever having
    had grub2 on it, and the directory in /boot is still named /boot/grub

    Regards,
    Arve

    I have a grub, old from original install, and grub2, that was added when
    I switched to the new grub. I would have thought the old directory was
    no longer needed but it appears it is for some reason.

    You don't provide enough information about your /boot, fs layout, etc., so it is difficult to know why the new GRUB2 failed to work. As a rule of thumb, if GRUB2 had worked before the likely problem is file corruption, or forgetting
    to run grub-mkconfig after you made and copied over your new kernel and initrd - it depends on what the message was when it failed to boot and what file it couldn't find.

    I'd run fsck on the /boot partition to make sure there is no fs corruption and hdparm on the disk would be advisable too.


    I've reinstalled
    using the grub-mkconfig command but have not reinstalled using the grub-install command. I'm tempted to rename the old directory, install
    like I would from a fresh new install, MBR and all, then see if it
    boots. Thing is, having to use the rescue tools if it fails is a bit of
    a pain. Also, I need to let my hair regrow a bit. ;-)

    Take a look at this page to make sure you don't remove some GRUB file needed for a boot:

    https://wiki.gentoo.org/wiki/GRUB2_Migration

    There are other GRUB related pages in the wiki to help with configuring GRUB2.

    BTW, you don't need the old legacy GRUB as a fall back to boot your system.
    You can use a LiveCD/DVD/USB and you can configure your GRUB2 to boot this
    from your /boot, or some rescue partition on disk. Of course, if GRUB or your /boot fs/partition is borked, then a LiveUSB is always handy. ;-)

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmH+P4EACgkQseqq9sKV ZxkvpA//QXqEOxXzmTOgPqffgk6gR2OMEU99/MYGLk783prMkQwLmxPzGdF0oXOx M+45MdCm5AIq3BcfNMw8qK3r/jOdU/SwpXLvzNRa+s+NZuH1wEFjeBXcXkdleo5e 5JwzcbrQZLXAl5ArU2h4166E1xXfufhRKHbEu6lLlNMMPzpLR0VJnQOe2FWlNYNv LhdE+AT0W4hf3HxfbqCDummej5aNhT93kBbSSls2vAvuAgVW1c6zpz+2vEchmDky rYKE9Et25ckaPeIedbRo3c45GAMl1xQkklfXfduatS9SEVvq7KtIX23nvsJO7k1k A7DR5xhJN+kKj1FoEXajTRfLcbXLPvUTboN3WEn1iQUis16+nKCCb7zz68vFNLo9 aG5TyHdzs0yLjS291ZfYoS9/fBQfQXYbQIyU90TBDTjNCGhTyI4ZLEjPaLDxxVG0 WrUDk7siiz/efRpbj/i9N8CINEy/LxwOnM+jsfJ01BDGiqtvZoHYLu8kx1mvm4md 46b3+hHOvk3Ke+p6IzlOtNAqPfw0DpSVzdn7zZoSfDR4Lhu8UOo2ZyvcNnnzF4Vi 83Na4RXS0WjGTyVWjGkUvPSK6bGivDAHW6+TlnAdcjoAOEcLVIXqQX3PSPuOp94u n+hTorRTvmXeZJmog8b6q2xHYebx3D9Lp3dJzy+vosZMyAxBFGc=
    =sZMa
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Sat Feb 5 11:21:34 2022
    On Saturday, 5 February 2022 09:36:44 GMT Dale wrote:

    It failed with a missing normal.mod file. That file is in the old grub directory. Once I renamed the directory back to what grub expected, the system loaded grub fine.

    Ahh! The normal.mod command:

    http://www.gnu.org/software/grub/manual/grub/html_node/normal.html

    You won't get a boot menu without this file, or a lot of GRUB commands. However, in a GRUB2 installation this file is found here:

    # find /boot/ -name normal.mod
    /boot/grub/i386-pc/normal.mod

    It should not exist the old legacy filesystem. :-/

    I wonder if you have somehow mixed the legacy and new GRUB2 files?

    Anyway, the solution is to go fishing for it from the GRUB rescue prompt, using the ls command and then set root and set prefix before you can insmode it.


    There's been other threads about kernel boot
    problems and the one I recently built could be having one of those
    problems. I haven't looked into that. I doubt there is any file system problem. The problem was me renaming a directory that grub still needs
    files from. There is likely a way around this but my post was to warn
    others that renaming that directory could cause problems.

    Right, renaming should be done carefully as you could mix the legacy and GRUB2 filesystems.


    I've reinstalled
    using the grub-mkconfig command but have not reinstalled using the
    grub-install command.

    Right, the 'grub-mkconfig' command only generates a new grub.cfg file and overwrites the old one. It does not *install* GRUB, whereby install involves dropping GRUB's bootloader code in the MBR and also copying all GRUB files into /boot.

    TBH, once GRUB2 is installed properly and it works, it tends to carry on doing so. So the question remains, why did it barf at its normal.mod path ...


    [snip ...]
    I don't have the old grub installed, just a directory that was installed
    by the old grub but contains files that the new grub needs.

    Hmm ... that should not be the case. The legacy and GRUB2 filesystems are different.

    The file
    and path it needs is this: /boot/grub/i386-pc/normal.mod Why that
    isn't installed in the new grub directory and told to look there for it,
    I have no idea at the moment. I may test it one day but don't feel the desire to try it today.

    Life's a mystery! :-)
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmH+Xb4ACgkQseqq9sKV ZxkhJBAAjRlwoqqfcSMRfiE9i2V71iM9Ti0yxfKvSELD++OK+vC6dasMIXHidnxZ +dI7ONDX/Rb4vC1DXXMxjmMT4MdvCJ2X0S+zqp5UXH/mSnm6jAdQGYKkB7RAhim1 Nm98S8nd0wMQRRR4zqeT3zWKFqWrHh0jL1j+a364hVon988OpbzrJMyMBZUiAprN GGBAZSxTrJwgiZI3PTrnXrgkLMd2r5dmoukWfO79pBREpCKqmMoVRIyhoWLPRWwV 4CljyDCtW0kTIyi4/ZsB6ZaHntbGM8B49SIjykAEqZlOCy/3DKbQn/36R8WVBsp2 zKCutB0FhZPphDdHjGpG6Bmcn7PWNM5eid1ZF5XGmzpucXW9qJ9s/bB5Y0cHQsnn 5nIgzQ9UPX+ZEg8RsuiXtT53Ky2LwKIm+ZxLzkWl3hDswro0KxvudaIkKzsIn83N E5ZadoO40N4e8Skzr5ySyiBfdrfTr1ePtQm0/LZ5RI9Sl9eTPxplfEnUEsTs/rYm lxjXeXSpb2CPfHBZBDHGFoeVyOpmPmDjp2/xBFO/NVqKf0m3tJ57//EhmwFimNio Szxw3qONynhp0pI26m6TFPG8Vf0hBcXGZ8ht785KslGn5bqAs5p7x1sq1cFoyPXE zJt8itC7Tt5oudfLHGbqI+i2NJOTdDKVx+e4huXPP/xuPPsL+N8=
    =oMuJ
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Wols Lists@21:1/5 to Michael on Sat Feb 5 15:00:02 2022
    On 05/02/2022 11:21, Michael wrote:
    On Saturday, 5 February 2022 09:36:44 GMT Dale wrote:

    It failed with a missing normal.mod file. That file is in the old grub
    directory. Once I renamed the directory back to what grub expected, the
    system loaded grub fine.
    Ahh! The normal.mod command:

    http://www.gnu.org/software/grub/manual/grub/html_node/normal.html

    You won't get a boot menu without this file, or a lot of GRUB commands. However, in a GRUB2 installation this file is found here:

    # find/boot/ -name normal.mod
    /boot/grub/i386-pc/normal.mod

    It should not exist the old legacy filesystem. :-/

    I wonder if you have somehow mixed the legacy and new GRUB2 files?

    Anyway, the solution is to go fishing for it from the GRUB rescue prompt, using
    the ls command and then set root and set prefix before you can insmode it.


    My gentoo /boot directory doesn't have a /boot/grub directory in it.
    Look and see if your grub.cfg has references to /boot/grub or
    /boot/grub2. (SUSE put one in its setup ...)

    The easy thing to do is rename BOTH your grub and grub2 directories, run grub-mkconfig, and check if the .cfg contains any reference to your
    renamed directories.

    Then when everything boots successfully, try backing up and removing
    them, and see if everything still works.

    Cheers,
    Wol

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dale@21:1/5 to Michael on Sat Feb 5 20:30:02 2022
    Michael wrote:
    On Saturday, 5 February 2022 09:36:44 GMT Dale wrote:

    It failed with a missing normal.mod file. That file is in the old grub
    directory. Once I renamed the directory back to what grub expected, the
    system loaded grub fine.
    Ahh! The normal.mod command:

    http://www.gnu.org/software/grub/manual/grub/html_node/normal.html

    You won't get a boot menu without this file, or a lot of GRUB commands. However, in a GRUB2 installation this file is found here:

    # find /boot/ -name normal.mod
    /boot/grub/i386-pc/normal.mod

    It should not exist the old legacy filesystem. :-/

    I wonder if you have somehow mixed the legacy and new GRUB2 files?

    Anyway, the solution is to go fishing for it from the GRUB rescue prompt, using
    the ls command and then set root and set prefix before you can insmode it.


    I kind of tried to do that.  Thing is, it doesn't do tab completion or anything and I forgot I had renamed that directory until I booted a
    rescue media and did a ls on it from that.  Then I remembered renaming
    it and simply renamed it back.  After that, grub was happy.  Of course,
    then I ran into the bad kernel and after that my second screen wasn't
    working either.  Things sort of ganged up on me all at once.  It's one
    reason I hate rebooting.  I have to say tho, dracut has been good to me
    so far.  Only had one init thingy go bad.  I simply booted a old kernel
    and fixed the new bad init thingy.  Still, I hate rebooting.  From uprecords: 


    root@fireball / # uprecords
         #               Uptime | System                                    
    Boot up ----------------------------+---------------------------------------------------
         1   303 days, 11:46:23 | Linux 4.5.2-gentoo        Sat Jul 29 23:20:27 2017
         2   227 days, 22:10:30 | Linux 5.6.7-gentoo        Wed Oct 28 13:59:36 2020
         3   200 days, 06:51:46 | Linux 4.18.12-gentoo      Sat Jan 12 03:42:55 2019
         4   193 days, 09:28:37 | Linux 3.5.3-gentoo        Sat Sep 22 07:50:38 2012
         5   184 days, 15:47:57 | Linux 3.18.7-gentoo       Tue Dec 15 21:53:59 2015
         6   166 days, 20:47:12 | Linux 5.6.7-gentoo        Thu May 14 00:47:09 2020
         7   143 days, 15:05:26 | Linux 4.5.2-gentoo        Sun Oct 23 20:09:26 2016
         8   138 days, 11:27:28 | Linux 4.5.2-gentoo        Tue May 29 13:27:44 2018
         9   135 days, 11:11:44 | Linux 4.5.2-gentoo        Thu Mar 16 11:58:17 2017
        10   119 days, 02:59:44 | Linux 4.19.40-gentoo      Wed Jul 31 12:12:08 2019



    There's been other threads about kernel boot
    problems and the one I recently built could be having one of those
    problems. I haven't looked into that. I doubt there is any file system
    problem. The problem was me renaming a directory that grub still needs
    files from. There is likely a way around this but my post was to warn
    others that renaming that directory could cause problems.
    Right, renaming should be done carefully as you could mix the legacy and GRUB2
    filesystems.

    Well, I expected everything the new grub needed to be in the new grub2 folder.  I think that is what Neil was expecting as well.  Just renaming
    the directory instead of deleting it was a really good idea tho.  Of
    course, everything is in /usr and can be restored from there but that
    means having to set up lvm since /usr is on a lvm as is /var as well. 



    I've reinstalled
    using the grub-mkconfig command but have not reinstalled using the
    grub-install command.
    Right, the 'grub-mkconfig' command only generates a new grub.cfg file and overwrites the old one. It does not *install* GRUB, whereby install involves dropping GRUB's bootloader code in the MBR and also copying all GRUB files into
    /boot.

    TBH, once GRUB2 is installed properly and it works, it tends to carry on doing
    so. So the question remains, why did it barf at its normal.mod path ...


    [snip ...]
    I don't have the old grub installed, just a directory that was installed
    by the old grub but contains files that the new grub needs.
    Hmm ... that should not be the case. The legacy and GRUB2 filesystems are different.

    The file
    and path it needs is this: /boot/grub/i386-pc/normal.mod Why that
    isn't installed in the new grub directory and told to look there for it,
    I have no idea at the moment. I may test it one day but don't feel the
    desire to try it today.
    Life's a mystery! :-)


    Yea, I'm working on it.  Pulling out install info and may rename the
    directory and do a complete reinstall process.  Just like I would on a
    fresh install.  That should fix it.  If not, I understand more about the
    grub rescue terminal at least.  I'm going to look that info up and do
    some printing with my nifty duplex laser printer.  I hate the cost of
    toner but I love the printing it does. 

    Dale

    :-)  :-) 

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)