Установка grub linux ubuntu

Установка grub linux ubuntu

For information on where GRUB should be installed on PC BIOS platforms, see BIOS installation.

In order to install GRUB under a UNIX-like OS (such as GNU), invoke the program grub-install (see Invoking grub-install) as the superuser (root).

The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The argument has to be either a device file (like ‘ /dev/hda ’). For example, under Linux the following will install GRUB into the MBR of the first IDE disk:

Likewise, under GNU/Hurd, this has the same effect:

But all the above examples assume that GRUB should put images under the /boot directory. If you want GRUB to put images under a directory other than /boot , you need to specify the option —boot-directory . The typical usage is that you create a GRUB boot floppy with a filesystem. Here is an example:

# mke2fs /dev/fd0 # mount -t ext2 /dev/fd0 /mnt # mkdir /mnt/boot # grub-install --boot-directory=/mnt/boot /dev/fd0 # umount /mnt 

Some BIOSes have a bug of exposing the first partition of a USB drive as a floppy instead of exposing the USB drive as a hard disk (they call it “USB-FDD” boot). In such cases, you need to install like this:

# losetup /dev/loop0 /dev/sdb1 # mount /dev/loop0 /mnt/usb # grub-install --boot-directory=/mnt/usb/bugbios --force --allow-floppy /dev/loop0 

This install doesn’t conflict with standard install as long as they are in separate directories.

On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at /boot/efi then you don’t need any special arguments:

Читайте также:  Red hat linux adding users

Otherwise you need to specify where your EFI System partition is mounted:

# grub-install --efi-directory=/mnt/efi 

For removable installs you have to use —removable and specify both —boot-directory and —efi-directory :

# grub-install --efi-directory=/mnt/usb --boot-directory=/mnt/usb/boot --removable 

Источник

How do I manually install GRUB? [duplicate]

I was installing Ubuntu 11.10 and the bootloader install failed. I tried installing it again but it didn’t work so I want to know how to install grub manually. Thanks.

2 Answers 2

I think this technique will not work. Because you don’t know in which position you installer crashed. Check your disk first.

If you want to install grub manually then: Login using livecd. Open terminal, login as root:

grub-install --root-directory=/mnt /dev/sda 

In certain cases sudo update-grub might not work — it happened to me when installing Debian beside Ubuntu.

In such a case I do one of the following:

  • Create a live CD/USB of Ubuntu Secure Remix, which is an Ubuntu live with supplementary rescue tools, boot from that and use Boot Repair.
  • If you already have a regular Ubuntu live iso, create live usb with UNetbootin, live boot from that and install Boot Repair

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

sudo apt-get install -y boot-repair && boot-repair &

(But apt-get update on a live USB might involve updates that take some time — and are also useless if the live usb is not persistent — so I recommend the first solution.)

Using Boot Repair to fix/reinstall GRUB is simple, just choose default/recommended repair option; more details here.

Источник

Оцените статью
Adblock
detector