1

I would like to install new encrypted debian or mint on external flash disk while already having windows and ubuntu installed in dual boot on internal drives. For booting I use ubuntu's grub on internal drives and I worry about possibility of overwriting this grub after installation of debian/mint on external disk. How to avoid that ? It would be nice to have option in ubuntu's grub to boot into debian on external drive after pluged in that external drive.

Can someone tell me how to achieve that ?

Thanks in advance.

Many
  • 111
  • 2
  • The best way is to unplug, disconnect or otherwise disable the internal drive. Then you can install your Linux system to the external drive without tampering with the internal drive. After the installation you can connect/enable your internal drive again. - There is usually a hotkey that you can use at boot in order to get a temporary menu to select which drive to boot from (and in this case you select the external drive). – sudodus Feb 05 '21 at 15:06
  • How to temporarily unplug internal drive then ? – Many Feb 05 '21 at 15:12
  • It depends on the computer, sometimes it is easy sometimes more difficult. What computer is it (brand name and model)? – sudodus Feb 05 '21 at 15:16
  • 1
    But I suppose it requires physical unplug, right ? Would like to avoid physical unplug, though – Many Feb 05 '21 at 15:17
  • Often you need unplugging, but in some computers it can be disabled via a menu option in the UEFI/BIOS system. - It is not too scary to unplug a drive, – sudodus Feb 05 '21 at 15:22
  • I have checked and it seems I have not such option in uefi.I believe it is not too scary but I just want to avoid that. – Many Feb 05 '21 at 15:29
  • Do you want to use the external drive only in the computer where you install the system, or also in other computers (as a drive with a portable system)? – sudodus Feb 05 '21 at 15:43
  • Portable system option sounds better, but I would pick the easier solution, my primary intention is to have it fully encrypted. – Many Feb 05 '21 at 15:46
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/119377/discussion-between-sudodus-and-many). – sudodus Feb 05 '21 at 15:46
  • I installed Debian several years ago to see if its installer would let me choose where to install grub. I believe Mint uses Ubuntu installer and choices do not work. Debian did install UEFI grub to an ESP on my sdb drive. If Mint or Ubuntu create ESP first and then you can reinstall grub to external drive. Or: https://askubuntu.com/questions/1296065/dual-booting-w10-ubuntu-with-2-separate-ssds-in-uefi-mode/1296153#1296153 – oldfred Feb 05 '21 at 16:55

2 Answers2

2

You could choose to not install a bootloader in the Debian installer (might require using "advanced mode" or something similar in the current iteration of the Debian installer, I think), then boot into Ubuntu, ensure the os-prober package is installed, mount the external drive and then run update-grub.

It should automatically detect the presence of Debian on the mounted external drive, and add it to Ubuntu's boot menu.

However, if your system boots in the classic BIOS style (i.e. not UEFI style), then external USB drives might be accessible at boot time only if you're actually trying to boot from them, or if the BIOS includes specific USB disk support for non-boot purposes and you have it enabled.

If you want to guard against mistakes, temporarily unplugging or otherwise disabling the internal drive when you're installing Debian, as suggested in the comments by @sudodus would be a good idea.

telcoM
  • 87,318
  • 3
  • 112
  • 232
  • So, if I click to not install it would be without risk of overwriting right ? assuming that I will not do any other mistake – Many Feb 05 '21 at 15:31
  • Right, if you avoid the "install a bootloader" installation step, then any existing bootloader won't be overwritten. The previous versions of the Debian installer had the option to skip installing the bootloader quite prominently available, but I haven't installed any Debian lately so my knowledge of the latest versions of the Debian installer is a little hazy. – telcoM Feb 05 '21 at 15:46
  • 1
    On the current Debian 12 Graphical install, when you get to the "Install the GRUB boot loader" question, you can choose No and click Continue, but then it still tells you that "You need to make the newly installed system bootable". So, then you have to click "Go back", select the "Continue without boot loader" option, and then click Continue. It will tell you "No boot loader installed", and then you click Continue again. – mmortal03 Jul 21 '23 at 01:14
1

If you can't (or don't want to) physically unplug internal drives or disable them in your BIOS settings, another option is to run the Debian or Linux Mint ISO from inside VirtualBox, with your USB external drive added in the USB device filters within your VirtualBox virtual machine's settings.

Then, you can install Debian or Linux Mint to the external drive, selecting your encryption options, and you'll have no chance of the grub installation seeing your physical system's internal disks/OSes.

I just did this with the Debian 12 Graphical install. When it finished I removed the drive, plugged it into another machine, chose it as the first boot priority in the BIOS settings, and it booted just fine, asking me for my password to decrypt the volume, and then booting into the OS.

mmortal03
  • 117
  • 5