Install grub on external hard disk

When you run into problems installing MX Linux XFCE
Post Reply
Message
Author
User avatar
shmu26
Posts: 247
Joined: Tue Sep 03, 2019 10:51 am

Install grub on external hard disk

#1 Post by shmu26 »

I installed MX on an external hard disk (in addition to the installation on my internal hard disk) but it looks like grub was installed on the internal hard disk. I don't see the external hard disk as a boot option in BIOS. How to get grub on the external hard disk, so it is a portable installation, sort of like a live flash drive installation?

Code: Select all

[code]
System:    Host: mx Kernel: 4.19.0-5-amd64 x86_64 bits: 64 compiler: gcc v: 6.3.0 
           Desktop: Xfce 4.12.3 Distro: MX-18.3_x64 Continuum May 26  2019 
           base: Debian GNU/Linux 9 (stretch) 
Machine:   Type: Desktop Mobo: ASUSTeK model: B150M-K D3 v: Rev X.0x serial: <filter> 
           UEFI: American Megatrends v: 0601 date: 11/20/2015 
Battery:   Device-1: hidpp_battery_0 model: Logitech Wireless Mouse MX Master charge: Low 
           status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i5-6500 bits: 64 type: MCP arch: Skylake-S 
           rev: 3 L2 cache: 6144 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 25536 
           Speed: 1855 MHz min/max: 800/3600 MHz Core speeds (MHz): 1: 1860 2: 1854 3: 1800 
           4: 1821 
Graphics:  Device-1: Intel HD Graphics 530 vendor: ASUSTeK driver: i915 v: kernel 
           bus ID: 00:02.0 
           Display: x11 server: X.Org 1.19.2 driver: modesetting unloaded: fbdev,vesa 
           resolution: 1920x1080~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 530 (Skylake GT2) v: 4.5 Mesa 18.2.6 
           direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-H HD Audio vendor: ASUSTeK driver: snd_hda_intel 
           v: kernel bus ID: 00:1f.3 
           Sound Server: ALSA v: k4.19.0-5-amd64 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: ASUSTeK 
           driver: r8169 v: kernel port: e000 bus ID: 02:00.0 
           IF: eth0 state: up speed: 100 Mbps duplex: full mac: <filter> 
Drives:    Local Storage: total: 1.14 TiB used: 404.89 GiB (34.8%) 
           ID-1: /dev/sda vendor: Crucial model: CT250BX100SSD1 size: 232.89 GiB temp: 29 C 
           ID-2: /dev/sdb vendor: Western Digital model: WD10EZEX-00BN5A0 size: 931.51 GiB 
           temp: 32 C 
Partition: ID-1: / size: 24.20 GiB used: 8.00 GiB (33.1%) fs: ext4 dev: /dev/sda7 
Sensors:   System Temperatures: cpu: 32.0 C mobo: N/A 
           Fan Speeds (RPM): cpu: 0 
Repos:     Active apt repos in: /etc/apt/sources.list.d/antix.list 
           1: deb https://mirrors.evowise.com/mxlinux-packages/antix/stretch/ stretch main
           Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list 
           1: deb http://ftp.am.debian.org/debian/ stretch-updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/debian.list 
           1: deb http://ftp.am.debian.org/debian/ stretch main contrib non-free
           2: deb http://security.debian.org/ stretch/updates main contrib non-free
           Active apt repos in: /etc/apt/sources.list.d/google-chrome.list 
           1: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
           Active apt repos in: /etc/apt/sources.list.d/mx.list 
           1: deb https://mirrors.evowise.com/mxlinux-packages/mx/repo/ stretch main non-free
           No active apt repos in: /etc/apt/sources.list.d/various.list 
Info:      Processes: 200 Uptime: 12m Memory: 7.67 GiB used: 5.17 GiB (67.4%) Init: SysVinit 
           runlevel: 5 Compilers: gcc: 6.3.0 Shell: bash v: 4.4.12 inxi: 3.0.33 
[/code]

User avatar
fehlix
Developer
Posts: 10383
Joined: Wed Apr 11, 2018 5:09 pm

Re: Install grub on external hard disk

#2 Post by fehlix »

shmu26 wrote: Thu Sep 12, 2019 2:44 am I installed MX on an external hard disk (in addition to the installation on my internal hard disk) but it looks like grub was installed on the internal hard disk.
I don't see the external hard disk as a boot option in BIOS. How to get grub on the external hard disk, so it is a portable installation, sort of like a live flash drive installation?
In UEFI boot external media would be scanned by UEFI-firmware during boot for the EFI-default boot loader /EFI/BOOT/bootx64.efi availalable on the ESP of that external media. When presented witht the UEFI-boot menu (after pressing a a certain Fn-key (F12 or F10 ...) you'll see a list all internal pre-registered entries and external found.
The latest installer should have populated the ESP on the installation disk with the default bootloader /EFI/BOOT/bootx64.efi. If not, a simple copy of /EFI/MX18x/grubx64.efi to /EFI/BOOT/bootx64.efi on the ESP of the external drive might help.
:puppy:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
shmu26
Posts: 247
Joined: Tue Sep 03, 2019 10:51 am

Re: Install grub on external hard disk

#3 Post by shmu26 »

Instead of the external hard drive being presented in BIOS, I see two entries for MX, and both are on the internal disk.

I tried the copy and paste, but still no luck.

User avatar
shmu26
Posts: 247
Joined: Tue Sep 03, 2019 10:51 am

Re: Install grub on external hard disk

#4 Post by shmu26 »

I guess the crude way to do it would be to physically disconnect my internal hard drives, connect the external drive, boot from live flash drive, and run boot repair?

User avatar
fehlix
Developer
Posts: 10383
Joined: Wed Apr 11, 2018 5:09 pm

Re: Install grub on external hard disk

#5 Post by fehlix »

shmu26 wrote: Thu Sep 12, 2019 3:58 am Instead of the external hard drive being presented in BIOS, I see two entries for MX, and both are on the internal disk.

I tried the copy and paste, but still no luck.
Hmm, "copy and paste" is certainly not sufficient as you have also to rename properly.
Perhaps show partition layout for both drives by running those commands:

Code: Select all

sudo fdisk --list
and

Code: Select all

sudo parted --list
And you might also show the current EFI-boot entries:

Code: Select all

sudo efibootmgr -v
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
ChrisUK
Qualified MX Guide
Posts: 299
Joined: Tue Dec 12, 2017 1:04 pm

Re: Install grub on external hard disk

#6 Post by ChrisUK »

shmu26 wrote: Thu Sep 12, 2019 4:27 am I guess the crude way to do it would be to physically disconnect my internal hard drives, connect the external drive, boot from live flash drive, and run boot repair?
No need to disconnect drives - just use groot... I posted about it here
Chris

MX 18 MX 19 - Manjaro

User avatar
shmu26
Posts: 247
Joined: Tue Sep 03, 2019 10:51 am

Re: Install grub on external hard disk

#7 Post by shmu26 »

I tried disconnecting drives, just to see what would happen, and one thing that happened is all the firmware boot entries for my linux partitions disappeared. Only Windows survived. That's one way to clean up the firmware! (I would colloquially call it the BIOS, but that's a little confusing, because really we are talking about EFI.)

But I think I have some weirdness due to differences between the various usb 2 and usb 3 outlets on my machine. Each one seems to work a little differently.
Thus my question: Can I install straight from my running MX system to a connected external hard drive, without resorting to installation media? If so, what would the steps be?
In the Live USB Maker, you need to select a source directory -- what to choose?

If anyone manages to recover from their laughing fit after reading this...

Post Reply

Return to “Installation”