1

I bought an external drive to put an Ubuntu in it. I will use it in multiple computers to work.

Problem is, when I installed it, it remplaced my initial grub by an another one, and the result of this is if the external disk is ejected, the grub won't boot.

This is all my blocks :

lsblk                                                                                                                                                                          Thu 20 Sep 2018 02:37:30 PM CEST
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 489.1G  0 disk 
├─sda1   8:1    0    16M  0 part 
├─sda2   8:2    0 488.2G  0 part 
└─sda3   8:3    0   843M  0 part 
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0   450M  0 part 
├─sdb2   8:18   0    99M  0 part /boot/efi
├─sdb3   8:19   0    16M  0 part 
├─sdb4   8:20   0 686.8G  0 part 
├─sdb5   8:21   0 236.3G  0 part /
└─sdb6   8:22   0   7.9G  0 part [SWAP]
sdc      8:32   0 223.6G  0 disk 
├─sdc1   8:33   0  23.3G  0 part 
├─sdc2   8:34   0   7.9G  0 part 
└─sdc3   8:35   0 192.3G  0 part 
sr0     11:0    1  1024M  0 rom 

And my partitions list :

Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 64 MiB, 67108864 bytes, 131072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sda: 489.1 GiB, 525112713216 bytes, 1025610768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: D4080E08-6C49-4D5D-AFAC-8E0ED13DE19C

Device          Start        End    Sectors   Size Type
/dev/sda1        2048      34815      32768    16M Microsoft reserved
/dev/sda2       34816 1023879907 1023845092 488.2G Microsoft basic data
/dev/sda3  1023881216 1025607679    1726464   843M Windows recovery environment




Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1EE8F2AF-A6B3-477E-B1C8-79858BA104CD

Device          Start        End    Sectors   Size Type
/dev/sdb1        2048     923647     921600   450M Windows recovery environment
/dev/sdb2      923648    1126399     202752    99M EFI System
/dev/sdb3     1126400    1159167      32768    16M Microsoft reserved
/dev/sdb4     1159168 1441523711 1440364544 686.8G Microsoft basic data
/dev/sdb5  1441523712 1937000447  495476736 236.3G Linux filesystem
/dev/sdb6  1937000448 1953523711   16523264   7.9G Linux swap


Disk /dev/sdc: 223.6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 02086807-3D19-4BE7-BEFE-13021ABC9846

Device        Start       End   Sectors   Size Type
/dev/sdc1      2048  48939547  48937500  23.3G Linux filesystem
/dev/sdc2  48941056  65540095  16599040   7.9G Linux swap
/dev/sdc3  65540096 468860927 403320832 192.3G Linux filesystem

The question is, do you know what I need to do to have my initial grub back, without the external disk ? And if I plug the disk, that the Ubuntu that is on this disk adds up on the grub list ? If it's not possible, is it possible to install a grup on that drive, so I would just need to switch the disk I boot up on start up ?

1
  • You don't really need a classic install. What you want looks more like a "live" disk...
    – xenoid
    Commented Sep 20, 2018 at 13:12

1 Answer 1

1

There's a step during Ubuntu installation in which it asks where do you want to install Grub. It's on that step where you have to indicate the program on which drive it'll be installed.

To do what you want, you have to:

  • Configure BIOS boot order, put USB drive first and then internal HDD second.
  • Install Grub on your internal HDD AND in your external drive. You can't add nor remove entries dinamically in Grub.

By doing so, every time you boot without your drive, it'll get the grub on your internal HDD. But if you plug your external drive, it should show that grub then. By the way, if you have problems with Grub, check out this tool. You can use it to restore Grub on your drive.

Hope this helps. Good luck.

2
  • Thanks ! During the Ubuntu installation I put the grub on my sdc (the external one), so it should have worked but I have the impression that during a grub update it broke the grub of my internal one. Is it possible ? Commented Sep 20, 2018 at 13:27
  • @DimitriDanilov It's possible, yes, since after every Grub update it'll check for other installations and every partition available. To solve that you can use boot-repair, I left a link on the answer. But, as a general note, you should manipulate Grub without any other drive that had it installed plugged in or at least not available for the system.
    – dCarMal
    Commented Sep 20, 2018 at 13:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .