Cannot get Buster to write /boot to my drive

Discussion in 'all things UNIX' started by Palancar, Jul 23, 2021.

  1. Palancar

    Palancar Registered Member

    Joined:
    Oct 26, 2011
    Posts:
    2,402
    I have been beating my brains out on this. Hell this is Linux 101 and yet no joy! I messed up a bare metal Buster OS with the last forensic backup being made June 26th so its pretty fresh. Not super big about 250 Gig. In June I spun out two forensic backups on two different externals and VERIFIED them using Reflect Pro. Stupid me lost the /boot backups, which are meant to write back to a USB flash OR can go on sda1, I don't care which. I use USB because I run multiple partitions each with a unique Linux OS. This process avoids juggling balls because each system has its own bootloader. Obviously I have written back both images just to double check against a fluke "bad" write back. No difference.

    I downloaded Debian 10.10 edu because it comes with Advanced -- > Rescue Mode. Using a USB ISO Debian 10.10 comes up perfectly and finds everything just fine. So I go through the process including obviously opening the LUKS container giving me access. When rescuing grub and trying to reinstall the bootloader files from the OS it doesn't work.

    Just to be clear, assuming you have completely lost the /boot files, how should I prep the USB or sda1 to prepare Rescue Mode to write the gub conf that is on the perfectly working bare metal drive.

    You will not insult me if you write steps that are newbie oriented. I am hesitant to change the fstab file but while using my Ubuntu Live ISO I can open and see everything as plain as day. Should I copy out something to write using another system? I have literally done this simple process over a dozen times, beats me why this won't complete. Help please.
     
  2. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    Greetings @Palancar- Wish I could be of any little help but Linux is alien to me except when to PenDrive windows and fix a mess. Not doing you a lick of good but I posted in hopes your Topic stays up where others who do know Linux can weigh in for you with useful suggestions. That 'beating my brains out' is exactly what i'm going thru but with Windows so I sincerely sympathize.

    Sure hope a solution presents itself for you soon.
     
  3. Brian K

    Brian K Imaging Specialist

    Joined:
    Jan 28, 2005
    Posts:
    12,175
    Location:
    NSW, Australia
    MBR or UEFI install?
     
  4. Palancar

    Palancar Registered Member

    Joined:
    Oct 26, 2011
    Posts:
    2,402
    MBR. I have 4 partitions on this SSD. The one I am working through in this thread is sda4 around 250 Gig. All the partitions are fully encrypted using different keys via LUKS, except sda1 (500 meg). I left it open to use for an instance just like this. Again, I can easily open the LUKS container and see it all using Ubuntu Live. And using Deb 10.10 ISO -- > Advanced --- > Rescue Mode comes up. I can restore the bootloader to sdc and it appears to write fine because it shows no errors, which to me means it writes. Assuming the USB Deb ISO is taking sdb and therefore the USB I want to use is sdc ------- correct?

    While I am waiting to see if anyone thinks of something I am going to grab another USB remove the partition, and then /dev/zero it to start from scratch. Want to make sure its perfectly clean and then formatted to Ext 2. I kept a pile of 500 meg flash drives to use for this /boot method I use. Frustrating me!
     
  5. Palancar

    Palancar Registered Member

    Joined:
    Oct 26, 2011
    Posts:
    2,402
    GOT IT!

    What a mess but in the end I figured it out ---- at least I got it working but still don't quite understand why I had to go about how I solved this.

    When I logged into graphical rescue mode along with another item, that did the trick. I kept getting an error that said to check my device.map because it wouldn't install or couldn't find the boot files on sdb! Remapping my drive seemed a little out of my "wheel house" so I thought about what would cause this. Then I remembered when I created this system back in the Jessie era I used a DVD installer and of course then when I inserted a USB for /boot it was SDB. But this time I used a USB-ISO (who uses DVDs still??) from Debian to open the installer in rescue mode. That meant that when I inserted my bootflash it was sdc, and not sdb. I dropped to root shell and tried writing grub to /dev/sdc but my machine "middle fingered me" every time. That is the part I don't quite get because this should be child's play, but it didn't fly.

    My solution after thinking about this was to write the Debian ISO to a DVD, and yes I still can use that fossil! After doing that I mounted the rescue ISO dropped to root shell and reinstalled Grub (sudo update-grub ---- sudo grub-install). For some reason when the bootflash was mounted as sdb (not sdc) it installed first time without any errors. Booted right up and good to go.

    Things that make you go Hmmmmmmmmmmmmmmm, LOL!
     
  6. EASTER

    EASTER Registered Member

    Joined:
    Jul 28, 2007
    Posts:
    11,126
    Location:
    U.S.A. (South)
    Great write-up and read @Palancar -Obviously you are coming along with Linux to satisfaction. Congrats to you and Yay on your successful result! Thanks for helping the forums with detailing your measures.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.