Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Can't chroot into "mnt" to reinstall Grub

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
User avatar
fabien
Forum Helper
Forum Helper
Posts: 688
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 62 times
Been thanked: 161 times

Re: Can't chroot into "mnt" to reinstall Grub

#21 Post by fabien »

pbear wrote: 2024-03-01 05:41 That's goofy. Bash = Terminal = the thing you're using to generate the error message. What say apt list bash and ls -l /bin/bash?
or

Code: Select all

$> echo "$0"
bash
$> command -V "$0"
bash is /usr/bin/bash
Could also be something else:

Code: Select all

$> dash
$> echo "$0"
dash
$> command -V "$0"
dash is /usr/bin/dash
Very interesting topic.
/disruption

User avatar
mattikins
Posts: 21
Joined: 2023-11-25 18:22
Location: matthewcharlesallen@outlook.com
Has thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#22 Post by mattikins »

Code: Select all

user@debian:~$ sudo efibootmgr --create --label "debian" --loader "\EFI\DEBIAN\SHIMX64.EFI" -d /dev/nvme0n1 -p 1
sudo: efibootmgr: command not found

arzgi
Posts: 1198
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 32 times

Re: Can't chroot into "mnt" to reinstall Grub

#23 Post by arzgi »

mattikins wrote: 2024-03-02 08:23

Code: Select all

user@debian:~$ sudo efibootmgr --create --label "debian" --loader "\EFI\DEBIAN\SHIMX64.EFI" -d /dev/nvme0n1 -p 1
sudo: efibootmgr: command not found

Code: Select all

sudo apt install efibootmgr

User avatar
mattikins
Posts: 21
Joined: 2023-11-25 18:22
Location: matthewcharlesallen@outlook.com
Has thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#24 Post by mattikins »

After installing efibootmgr, I re-ran @pbear's script and here is the result before I attempt to reboot:

Code: Select all

user@debian:~$ sudo efibootmgr --create --label "debian" --loader "\EFI\DEBIAN\SHIMX64.EFI" -d /dev/nvme0n1 -p 1
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 000B,0001,0000,0002,2001,2002,2003
Boot0000*  USB
Boot0001* ADATA SX8200PNP                 
Boot0002* Linpus lite
Boot0003* Linpus lite
Boot0004* EFI Hard Drive (ADATA SX8200PNP)
Boot0005* EFI Hard Drive (ADATA SX8200PNP)
Boot0006* Linpus lite
Boot0007* EFI USB Device (SanDisk SanDisk Cruzer)
Boot0008* EFI USB Device 1 (Sony    Storage Media)
Boot0009* rEFInd Boot Manager
Boot000A* EFI USB Device (Sony    Storage Media)
Boot2001* EFI USB Device
Boot2002* EFI DVD/CDROM
Boot2003* EFI Network
Boot000B* debian

User avatar
mattikins
Posts: 21
Joined: 2023-11-25 18:22
Location: matthewcharlesallen@outlook.com
Has thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#25 Post by mattikins »

Here is the output from efibootmgr -v prior to reboot attempt:

Code: Select all

user@debian:~$ efibootmgr -v
BootCurrent: 0002
Timeout: 0 seconds
BootOrder: 000B,0001,0000,0002,2001,2002,2003
Boot0000*  USB  BBS(HD, USB,0x500)....................................................................*..
Boot0001* ADATA SX8200PNP                       BBS(HD,ADATA SX8200PNP                 ,0x500)..?.............+..P....#..P?..P.................................X.J*..
Boot0002* Linpus lite   HD(1,MBR,0xc7e6ef99,0x1b5c,0x2800)/File(\EFI\Boot\grubx64.efi)RC
Boot0003* Linpus lite   HD(1,MBR,0x23261683,0x11a4,0x4a20)/File(\EFI\Boot\grubx64.efi)RC
Boot0004* EFI Hard Drive (ADATA SX8200PNP)      PciRoot(0x0)/Pci(0x1d,0x4)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,GPT,9e6c3f61-897b-4f48-be7d-08bf8e34e521,0x800,0xfa000)RC
Boot0005* EFI Hard Drive (ADATA SX8200PNP)      PciRoot(0x0)/Pci(0x1d,0x4)/Pci(0x0,0x0)/NVMe(0x1,00-00-00-00-00-00-00-00)/HD(1,GPT,9e6c3f61-897b-4f48-be7d-08bf8e34e521,0x800,0xfa000)RC
Boot0006* Linpus lite   HD(1,MBR,0x23261683,0x11a4,0x4a20)/File(\EFI\Boot\grubx64.efi)RC
Boot0007* EFI USB Device (SanDisk SanDisk Cruzer)       PciRoot(0x0)/Pci(0x14,0x0)/USB(0,0)/HD(1,MBR,0x0,0x711090,0x2000)RC
Boot0008* EFI USB Device 1 (Sony    Storage Media)      PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/USB(0,0)/USB(1,0)/USB(1,0)/HD(1,MBR,0x9517325f,0x800,0x777800)RC
Boot0009* rEFInd Boot Manager   HD(1,GPT,9b86a387-64ca-47d9-948b-7b80b960a0e8,0x800,0x100000)/File(\EFI\refind\refind_x64.efi)
Boot000A* EFI USB Device (Sony    Storage Media)        PciRoot(0x0)/Pci(0x1d,0x0)/Pci(0x0,0x0)/Pci(0x2,0x0)/Pci(0x0,0x0)/USB(0,0)/USB(1,0)/USB(1,0)/HD(1,MBR,0x9517325f,0x800,0x777800)RC
Boot000B* debian        HD(1,GPT,9b86a387-64ca-47d9-948b-7b80b960a0e8,0x800,0x100000)/File(\EFI\DEBIAN\SHIMX64.EFI)
Boot2001* EFI USB Device        RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

User avatar
mattikins
Posts: 21
Joined: 2023-11-25 18:22
Location: matthewcharlesallen@outlook.com
Has thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#26 Post by mattikins »

@pbear @arzgi, and @fabien-I have entertained this dillema a little too long. I have to get back to my HOME. I mentioned this in an earlier post, but I was not able to run a Wayland sessions on the broken install because I could not get it to recognize the keyboard, and my computer runs realy smooth and fast on Wayland. So this issue has let me use Wayland instead of X11 and I like it. So I am throwing in the towel and pursing the reinstall route.

But I would ask one last favor, and that is to point me in the direction of the script you would recommend for doing a reinstall of Debian on a prexisting LUKs encrypted LVM scheme, where the existing HOME volume will not be formated or changed. I'm researching them now and not seeing a lot of consistency...

User avatar
pbear
Posts: 329
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 1 time
Been thanked: 57 times

Re: Can't chroot into "mnt" to reinstall Grub

#27 Post by pbear »

Wow. You basically ignored the thread for two days, then get in a huff over no one getting back to you right away on the reboot question. When the obvious way to answer the question was to try booting. Meanwhile, did you make any effort to understand the efibootmgr output? It's not difficult to see the debian entry was inserted; not only that but given first priority. And what about the rEFInd flash drive? That would have gotten you booted 36 hours ago.

Anyhoo, I don't know the answer to your reinstall question. My advice, though, would be that you switch to a more newbie-friendly version of Linux, e.g., MX or Mint.

So the thread won't be a total loss, I'll emphasize a point which may not be obvious. The main reason this was difficult is that you had failed to cull obsolete kernel images. That's why reinstall of Grub failed, which (as mentioned) doesn't normally require chroot. A separate boot partition needs at least a 20% free space cushion. Actually, there's no reason to keep more than three kernels, the current one plus two backups. Indeed, the default is to keep only two.

User avatar
mattikins
Posts: 21
Joined: 2023-11-25 18:22
Location: matthewcharlesallen@outlook.com
Has thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#28 Post by mattikins »

@pbear you made me sad. I was thrilled at your help and working with you If you want to see this through, I'm game. I will give the rEFInd flash drive a chance. I got the distinct impression you were tired of me:
Wouldn't call this a great long term solution, but should at least get you up-and-running. If you end up using long term, you might want to look at how to configure the app (timeout, etc.).
I read that as kind of like "this will get you going, good luck..." Which would have been totally reasonable given the help you have given. And I did look at the output of the eibootmgr, but I couldn't make sense of it. And to just push back a little, I've been using Linux for 3-4 years now. I was using Manjaro for the majority of that time, and don't remember having to resort to the forums to get me through an issue. I am no phenom, like yourself (in all seriousness), but you have to admit this was an issue that would have frustrated a lot of more experienced Linux users than me, And if I didn't have a business to run, I wouldn't have
ignored the thread
. So I said my peace on that...
I am going to give the flash drive a shot. I owe it to you for your help, and I am also curious about getting to a solution. I just have other factors to keep in mind in terms of how much longer I can not have access to the HOME directory on this laptop. Sorry for giving you the impression that I was in a huff and not being appreciative. That is not that impression I want to make or leave...so I won't. I'll post the results of the flash drive.

panpan
Posts: 69
Joined: 2015-09-18 17:07
Has thanked: 3 times
Been thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#29 Post by panpan »

Another option that you can have is to follow this tutorial adjusting to your Debian: https://www.youtube.com/watch?v=h64PS3P-NnU
What you can do extra when you unlock your home partition is to copy it in another drive with the same size partition so you can keep and save your data.
P.S I do not get mail notification so I follow this topic by coming now and then to check if there is any new development.

User avatar
pbear
Posts: 329
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 1 time
Been thanked: 57 times

Re: Can't chroot into "mnt" to reinstall Grub

#30 Post by pbear »

Did you try booting after adding the debian entry to NVRAM? If it didn't work, there's a good chance the problem is that the boot partition is too full even for that. Which, if true, will be a problem for the rEFInd flash drive also (worth having anyway, though). If you can't get chroot to work, the only option left (I can see) would be to hack the boot partition by deleting old kernel images manually. Or you can say, never mind all that, time to reinstall. No skin off my nose.

By the way, if the object is to get on with things, never mind the clever reinstall strategy. Reinstall the regular way, then copy in the home folder from backup.

User avatar
mattikins
Posts: 21
Joined: 2023-11-25 18:22
Location: matthewcharlesallen@outlook.com
Has thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#31 Post by mattikins »

I''m going to retry Annie Oakley and then the rEFInd flash drive. I have go back review those posts again. I was installing a mailbox this morning and afternoon. A physical snail-mail box. I also got distracted researching distributions that would work better on my old Dell StudioXPS 1640. I switched from MX to Lubuntu, but was experiencing some hiccups. So now I'm giving Zorin a shot; I'll post my results tonight. I see you are West Coast time...

User avatar
pbear
Posts: 329
Joined: 2023-08-27 15:05
Location: San Francisco
Has thanked: 1 time
Been thanked: 57 times

Re: Can't chroot into "mnt" to reinstall Grub

#32 Post by pbear »

Sigh. Don't run the efibootmgr command again. Just try booting the computer. Bear in mind, if you're able to boot, this way or with the rEFInd flash drive, the first order of business is to run apt autoremove, which will delete the superseded kernels and clear oodles of space in the boot partition. Going forward, pick a method of kernel maintenance. There are several options, including running autoremove periodically.

Out of curiosity, I took a look at the reinstall question. AFAICT, there's no way to do it with the standard installer. The Calamares installer, though, used by the live versions, seems to support what you have in mind. Boot live session. Open LUKS container. Start installer. Select Manual Partitioning. Notice the logical volumes are listed. Select one; click Edit. Notice option to Keep or Format. Obviously you would format the system volume and keep the home volume. Understand, I've not tested the strategy. I'm drawing an inference based on how Linux installers generally work. Also, some clean-up would be required, including creating a crypttab file and updating initramfs (using your good friend chroot). As I said, would be easier and faster to reinstall the regular way (whatever you did last time), then copy in the home folder from backup.

Edit: Gave it a shot, modifying a default LVM-with-encryption system (standard installer) to add a home volume. Tried reinstall twice. Both times, got an error the system volume couldn't be formatted. Moreover, upon closing the installer, discover the LUKS partition is empty. :shock: Didn't lose anything - did the test in VirtualBox using a cloned VM and snapshots - but can't recommend the procedure. Further edit: Research turns up a workaround, but not a precise fit for this case and haven't tested.

By the way, I doubt the MX video can be adapted for Debian, as the installers are completely different.

User avatar
mattikins
Posts: 21
Joined: 2023-11-25 18:22
Location: matthewcharlesallen@outlook.com
Has thanked: 2 times

Re: Can't chroot into "mnt" to reinstall Grub

#33 Post by mattikins »

Hi @pbear and everyone. I have been out of pocket with work issues. So here is the update: I can successfully boot up to the rEFInd install consistently. I am getting up to speed to figure out how I can take advantage of this ray of light. I am still unable to actually boot into the Debian install, e.g. Root or Home.

Post Reply