From: Mail@JoesLife.org   
      
   On Wed, 13 Dec 2023 21:16:49 -0000 (UTC), root wrote:   
      
   > or grub-install, whatever.   
      
   Since I almost always use Grub, I would likely try this:   
      
    grub-install --recheck --boot-directory    
      
   Here's a scenario:   
      
    -You have a Slackware installation which no longer boots. You believe   
   this to be due to a damaged boot sector.   
      
    -You boot a different Slackware installation in such a way that you   
   can "see" the device of the broken Slackware. I would do this using   
   Slackware on a bootable flashdrive, but I imagine this could be done in   
   other ways.   
      
    -You find your broken Slackware installation at /dev/sda1, and you   
   mount it at /mnt/to.   
      
    -Wipe the boot sector. This is a precaution and may not be needed:   
      
    dd if=/dev/zero of=/dev/sda bs=512 count=1   
      
    -This will install Grub to the MBR of /dev/sda (not /dev/sda1 !):   
      
    grub-install --recheck --boot-directory /mnt/to /dev/sda   
      
   Here is some discussion:   
      
    -I'm using "--boot-directory /mnt/to" instead of   
   "--boot-directory=/mnt/to". I think the syntax you will find in   
   documentation is the latter, but it seems I have been successful in using   
   a different syntax.   
      
    -I think you can actually use "/dev/sda1" for , but I'm   
   not sure. I don't ever do that, and I think there is a reason. I think   
   if you did, then your BIOS wouldn't see the boot instructions when it   
   boots your system. Perhaps the use of /dev/sda1 would be useful for   
   "boot chaining".   
      
    -For this to work in a "turn key" fashion you will need a Grub   
   configuration file. Grub exects to find it in the directory named by   
   "--boot-directory" at "boot/grub/grub.cfg". For example, in the above   
   scenario that would be here:   
      
    /mnt/to/boot/grub/grub.cfg   
      
   I think you can still boot without a grub.cfg file, but you will need to   
   know what to type at the Grub command line. That is a very interesting   
   and useful subject, but I will not address it here.   
      
   Here is a sample grub.cfg file with one stanza (0):   
      
    default='0'   
    timeout='3'   
    menuentry 'Slackware Linux on prodesk'{   
    ROOT=220506aa1Drive   
      
    search --label --set root $ROOT   
    echo 'Loading Linux kernel ...'   
    linux /boot/vmlinuz-generic ro root=LABEL=$ROOT \   
    rootfs=ext4 quiet   
    echo 'Loading initial ramdisk ...'   
    echo 'Starting Slackware Linux ...'   
    initrd /boot/initrd.gz   
    }   
      
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|