Install Ubuntu to hard disk without overwriting mbr?
Solution 1
To do this you will need to set up the partitions for Ubuntu manually. I suggest you do this with Gparted after selecting "try Ubuntu". You should then go ahead and install Ubuntu but when Ubiquity asks how you want to install select "something else" and it will take you to the advanced mode.
You then need to specify the partitions manually, and also tell it where to install grub. Down the bottom of the advanced partitioner, you will it has probably defaulted to installing grub on /dev/sda. Change this to the correct device name for the USB you want to install grub to.
After installation the machine will only boot into Ubuntu when you boot grub off the USB drive; the MBR on the hard drive will not be changed.
Solution 2
- Boot the installer
- Click "Try Ubuntu"
- Start a terminal (Alt+F2 then typing
gnome-terminal
is one way to do this) - Type
ubiquity --no-bootloader
- (
--no-bootloader
literally means "Do not install a bootloader") - To install grub to another location, such as a USB drive, run
sudo grub-install /dev/usb_device_name
(see How to install grub on usb flash drive? and Can I Install grub on an USB and make it a rescue disk?)
Related videos on Youtube
Bob
Updated on September 18, 2022Comments
-
Bob over 1 year
What's the best way to install Ubuntu without putting GRUB on the MBR? I would think I can install to another partition (logical?), and then install GRUB on a bootable USB. When I want to boot to Ubuntu, just plug in the USB.
Would this work? How can I get the installer to do that?
-
Bob about 11 yearsThis is exactly what I want to do. I will try it. I didn't know that ubiquity lets you choose the place to install grub. Perhaps I've missed it in the past. Thanks!
-
Bob about 11 yearsWhy don't you want to install GRUB on the MBR? Because I've been burned by this before. Granted it was an older version of Ubuntu, and a much older version of Windows - but I've had to spend hours trying to repair the MBR b/c Win wouldn't boot - it can be really finicky with stuff like this.
-
fabricator4 about 11 yearsGrub replaces the MBR, as you know, however there should be no problems booting either Windows or Ubuntu from Grub. There are sometimes problems where the OS proper does not find the Windows boot partition however this can normally be fixed by running 'sudo update-grub' afterwards.
-
jiggunjer almost 8 yearstwo bootloader fighting for control? I doubt that, I think that is why there is a boot priority listing in the BIOS...
-
Shauna almost 8 yearsIt's likely more prone to happen on older systems and likely involves an autodetect setting in BIOS, but I've seen it happen. If I had to guess, I'd say it's probably a sort of race condition, where which one loads depends on which device the BIOS picks up first, and it may not always be the same (or expected) order.
-
mook765 over 6 yearsThis sounds a bit dangerous, copying the first 448 bytes of the disk will include the first partition-table-entry and the first two bytes of the second partition-table-entry. Copying them back after installation might lead to a heavy problems if the first and/or second partition have been changed during installation. ALso this will put Grub in the MBR, so this does not answer the question.
-
mook765 over 6 yearsThis will not install Grub at all, but it seems that the OP want to install Grub to a different location.
-
bain over 6 yearsGood point, I've added links to that info
-
user149408 over 6 yearsIt does temporarily install GRUB in the MBR but restores the old MBR, thus the final result of not having GRUB in the MBR is ultimately reached. As for the size, according to en.wikipedia.org/wiki/Master_boot_record#Sector_layout the first partition table entry begins at 446 (not 448—I’ll correct that). Depeding on the boot sector format used, anything shorter than 446 may cripple the boot loader. That said, as some boot managers support additional partition table entries before byte 446, it’s probably a good idea to partition your drive first, and only then mess with the MBR.