On 2/15/26 02:43, Tim via users wrote:
Samuel Sieb wrote:
If you ran that script then it might be time to reinstall the drive. Did
it run with no errors?

ToddAndMargo:
Could not get it to boot.  Removing and reinserting did not help

Samuel was referrring to reinstalling the software to the drive, not
reinserting the drive in the socket.


Oh.

This is a bootable Fedora dive I carry with me to
customer sites.  It has all my wonderful tools on it
for networking and rescuing corrupted Windows computers.

Problem: it is a one shot use.   I have to wipe and
reinstall the things every time I use it in the field.
As far as I can tell, something is royally corrupting
my /boot.  It is a total pain in my neck.

So I am after a script I can run at my office to repair
my ability to boot.  (Every thing else on the stick
is okay.)

Even though I have wonderful directions on how and what
to reinstall Fedora on the stick, I am tired of it and
am in no mood to continue reinstalling every thing
every time I use it in the field.

What I have so far



umount -R /mnt2
fsck -y /dev/sdb2
fsck.vfat -y /dev/sdb1


mkdir -p /mnt2
mkdir -p /mnt2/efi
mkdir -p /mnt2/lib
mkdir -p /mnt2/lib64
mkdir -p /mnt2/usr/lib
mkdir -p /mnt2/dev
mkdir -p /mnt2/proc
mkdir -p /mnt2/sys
mkdir -p /mnt2/run
mkdir -p /mnt2/sys/firmware/efi/efivars

mount /dev/sdb2 /mnt2
mount /dev/sdb1 /mnt2/efi

mount -o bind /lib /mnt2/lib
mount -o bind /lib64 /mnt2/lib64
mount -o bind /dev /mnt2/dev
mount -o bind /proc /mnt2/proc
mount -o bind /sys /mnt2/sys
mount -o bind /run /mnt2/run
mount -o bind /sys/firmware/efi/efivars


chroot /mnt2 /usr/bin/bash

dnf reinstall shim-* grub2-*
grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-install \
  --force \
  --target=x86_64-efi \
  --efi-directory=/boot/efi \
  --boot-directory=/boot \
  --removable \
  --recheck \
  /dev/sdb

exit
umount -R /mnt2


--
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://forge.fedoraproject.org/infra/tickets/issues/new

Reply via email to