LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 01-02-2024, 01:47 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
seeking HOWTO fix a bootable HDD


Colleagues,
How do I modify an HDD so that it no longer thinks that it is bootable?

I have a removable HDD that used to hold a full Linux Mint (v19.x) I want to use this drive for other things but it holds several partitions that I don't want to clobber.

I was able to use gparted to remove the various Linux partitions that are not wanted. When I try to boot the workstation from power off, things get tangled in the bootable parts of this drive and those of base workstation. The result is that the box fails to boot.

I seek two sets of information:
  1. Is there some way to force power on boot to ignore this drive?
  2. Is there some way to remove the boot details from the partition table so that workstations won't get confused in the future?

I don't coonsider myself a linux wizard* though I have used linux for many years. I've never mastered using GRUB or GRUB2 with a keyboard. I don't feel comfortable using update grub either.
I am willing to learn,

Thank you in advance,
~~~ 0;-/ Dan


Follow-Up:
I've tried every form of one-time-boot that I could find. The workstation is a ThinkPad X220. The "external drive" is a module installed into the Lenovo docking station. The drive has a GPT partition table. I do not use Secure Boot.


NOTE: The workstation boots and runs Mint v21.2 without trouble absent this drive.
When the boot fails, I get something like the following:
Code:
    DMAR: [Firmware Bug]: No firmware reserved region can cover this
    RMRR: [ hex ] contact BIOS vendor for fixes
    ... TPM chip errors
    You are in emergency mode. After logging in type "journalctl -xb" to view
    system logs. "systemctl reboot" to reboot, "systemctl default" or "exit"
    to boot into default mode.

    Press ENTER for maintenamce
    (or press Control-D to continue)
_______________________________________
* wizard — If you remember Fantasia and the Sorcerer's Apprentice, I know where the wizard keeps his hat and I've learned how to swim. (^o^)

Last edited by SaintDanBert; 01-02-2024 at 02:13 PM.
 
Old 01-02-2024, 02:14 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
If this is an MBR style bootloader, you can delete the MBR bootloader without affecting the partition table with this:

Code:
dd if=/dev/zero of=/dev/sdQ bs=440 count=1
Replace sdQ with the device you wish to modify. Don't get it wrong!

But since you say you're not comfortable with "update grub", this is ... uhh ... well this is scarier than simple old update grub. And I'm not sure whether it applies with UEFI so ...

I dunno ... maybe don't do this until you try other things first. It's a very low level way of accomplishing this task, and if you mess anything up you could FUBAR your partition table ... even corrupt data on the partitions themselves ... not pretty stuff.

Instead, the first thing I would do is go into your BIOS settings and edit the hard drive boot priority. Depending on the BIOS, this should fix you right up.

Risk level = almost zero.

Second thing I would try is grub-install ... something like:

Code:
grub-install /dev/sdQ
Basically, instead of just erasing the bootloader, you overwrite it with a bootloader "pointed" to your currently active installation. This assumes you boot up to your desired installation, and then use grub-install to install the MBR bootloader on the other drive. That way, it doesn't matter which drive the BIOS decides to boot from, it'll still get pointed to the GRUB installation on the desired drive.

Risk level = very low, but it's also possible to get confused later on troubleshooting boot issues since you won't necessarily be sure which drive it's booting from and you might get confused updating the bootloader in one drive but not the other.
 
1 members found this post helpful.
Old 01-02-2024, 02:16 PM   #3
Arnulf
Member
 
Registered: Jan 2022
Location: Hanover, Germany
Distribution: Slackware
Posts: 312

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by SaintDanBert View Post
Colleagues,
How do I modify an HDD so that it no longer thinks that it is bootable?
man dd
man gdisk
 
Old 01-02-2024, 03:52 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 11,386

Rep: Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710
You should be able to select the drive on which you have an installed OS (not the Mint you refer to) in the BIOS firmware boot options. If that drive is set to first boot priority and has a bootable OS, you should have no problem. You haven't indicated what you do have and what you do want as far as operating systems on the same or other drive nor whether you are using an EFI install of Mint and your other OS, Legacy/MBR The information you have posted is not really helpful to get any specific help. You might try getting boot repair from the link below and running it using the 2nd option to Create BootInfo Summary. That would post a lot of detailed, specific and useful information. You can do it from Mint or any Ubuntu derivative 'live' usb.

https://help.ubuntu.com/community/Boot-Repair

Last edited by yancek; 01-02-2024 at 03:53 PM.
 
Old 01-02-2024, 04:05 PM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, OS/2, others
Posts: 6,496
Blog Entries: 1

Rep: Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230Reputation: 2230
Remove the boot flag from the GPT removable. This may be all that's needed. If it's not, and the GPT removable has an ESP partition, try either removing the content from its ESP's EFI directory, or reformatting its ESP, or removing its ESP partition (and possibly wiping the space it occupied).
 
1 members found this post helpful.
Old 01-02-2024, 04:18 PM   #6
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by SaintDanBert View Post
Colleagues,
I've tried every form of one-time-boot that I could find. The workstation is a ThinkPad X220. The "external drive" is a module installed into the Lenovo docking station. The drive has a GPT partition table. I do not use Secure Boot.
Assuming you're using EFI, enter the system setup utility.
  • Use [Tab] to select "Startup".
  • Select "Boot".
  • Select the entry for Linux Mint from the list. Press [Delete] to remove it from the boot order.
  • Press [F10] to save and exit.

Hopefully that is the only Mint you have installed, and Mint gave its EFI entry a meaningful name. If you have multiple installations of Mint and just want to get rid of this one, things get a little more in depth.
 
1 members found this post helpful.
Old 01-03-2024, 12:45 PM   #7
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by goumba View Post
Assuming you're using EFI, enter the system setup utility.
  • Use [Tab] to select "Startup".
  • Select "Boot".
  • Select the entry for Linux Mint from the list. Press [Delete] to remove it from the boot order.
  • Press [F10] to save and exit.
As I understand, I have these options at power-up:
  • press the blue ThinkVantage button
  • press the F12 key
  • press ESC when Mint shows its splash screen
I do not find a way to alter the "boot order" as is days of olde.
F12 key gives me a dialog showing disk devices in some order. I can arrow up-doown to select one to boot from. If select my {supposed good} drive, I get the error that I reported above. I don't see any way to alter the order so that a failed selection will roll over to a different known-good disk.
ThinkVantage takes me into a Setup session. Again, no way to alter "boot order".

Thanks in advance,
~~~ 0;-Dan
 
Old 01-03-2024, 03:41 PM   #8
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by SaintDanBert View Post
As I understand, I have these options at power-up:
I do not find a way to alter the "boot order" as is days of olde.
F12 key gives me a dialog showing disk devices in some order. I can arrow up-down to select one to boot from. If select my {supposed good} drive, I get the error that I reported above. I don't see any way to alter the order so that a failed selection will roll over to a different known-good disk.
ThinkVantage takes me into a Setup session. Again, no way to alter "boot order".
Interesting, as my X220t allows me to do so.

When the Lenovo logo shows, I press F1, which I just mash repeatedly because you know, timing. This takes me into setup ("ThinkPad Setup", looks like an oldschool BIOS Setup).

I also get the prompt "Press Enter to interrupt normal boot...", which when pressed, gives me options
  • F1 for the Setup utility
  • F10 for diagnostics
  • F12 for a temporary boot device menu

At the top in Setup,
Code:
MAIN   CONFIG   DATE/TIME   SECURITY   STARTUP   RESTART
(My mistake, I said use TAB, one must use Left/Right to select.)

Another interesting thing is if you select the supposedly good boot entry with the drive connected you get an error, and no error with it disconnected. Are you sure you are in fact choosing the "good" entry?

If you still can't get into Setup to modify startup we can do it with EFIBootMgr.

Run, as root, efibootmgr.

Code:
efibootmgr
This will give you your boot entries, for the command below

Code:
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0003,0001
Boot0000* opensuse-secureboot   HD(1,GPT,)/File(\EFI\opensuse\shim.efi)
Boot0001  UEFI: ST500DM002-1BD142       PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,65535,0)/HD(1,GPT,)AMBO
Boot0003* MacOS (Clover)        HD(1,GPT,)/File(EFICLOVERCLOVERX64.efi)
Use this to rearrange the entries, putting the good first, using the numbers obtained above. Example

Code:
efibootmgr -o 3,1,0
Once you get that right, you can leave it alone, or delete unnecessary entries.

Last edited by goumba; 01-03-2024 at 03:53 PM.
 
Old 01-03-2024, 05:14 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,843

Rep: Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682Reputation: 1682
As has already been mentioned there isn't enough information to give any advice.
With linux installed on both an external and internal drive the problem can be any number of things. As has already been suggested post the output of boot-repair info script.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot fix broken package using "sudo apt --fix-broken install" to fix XFCE packages for Zorin OS 16 Core AltFantasy Zorin OS 8 09-25-2021 06:51 AM
seeking HOWTO us 'dd' to clone and copy HDD contents SaintDanBert Linux - Hardware 9 01-03-2019 07:41 AM
Run customised HDD driver for external HDD while generic HDD driver for bootable purpose sonia49 Linux - Newbie 1 09-28-2016 08:52 PM
seeking HOWTO create my own bootable live-media file system SaintDanBert Linux - Desktop 5 10-30-2015 03:04 PM
Bootable partion on external HDD? 40 gb firelight hdd. Trebile34 Linux - Hardware 1 03-14-2005 11:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration