Linux mint grub2 установка

Linux Mint Forums

Most of this information is readily available somewhere, but I’m not aware of anywhere with all of it in one place. Which method to use depends on the situation. If able to boot into the system, the first and simplest method usually will be sufficient. If unable, e.g., because a Windows update has overwritten the boot loader, boot a live session and try the second method. Usually this works. If not, escalate to chroot. If all else fails, try purge-and-reinstall. Notice I don’t mention the Boot Repair app. Have seen too many cases where it made the situation worse, but you have that option.

Simple method . Run sudo grub-install /dev/sdx , where x = device to which installing the boot loader. Works for both BIOS and UEFI. For example, returns control of Grub to the primary system after installing a second as a test box (by default, the last system installed controls Grub). As mentioned, for this to work, you have to be booted into the system you want to control Grub.

Live session method . Works with both BIOS and UEFI, but the commands are a bit different. First you mount the system partition to /mnt. If there is a boot partition, this must be mounted also; insert a new second step: sudo mount sdxn /mnt/boot , where sdxn is the boot partition’s ID. Then, in UEFI, you mount the EFI partition. The command to install Grub is very simple because it invokes a script which does most of the work behind the scenes. Notice the target for grub always is the device, for illustration sda. This is true in UEFI as well as BIOS. See GNU Grub Manual.

For BIOS, assuming the system/root partition is sda1. Modify as appropriate, of course, if the system partition is sda5, sdb1, etc.

sudo mount /dev/sda1 /mnt sudo grub-install /dev/sda --boot-directory=/mnt/boot
apt install grub-efi-amd64-signed shim-signed sudo mount /dev/sda2 /mnt sudo mount /dev/sda1 /mnt/boot/efi sudo grub-install /dev/sda --boot-directory=/mnt/boot --uefi-secure-boot

Notes: For reasons unknown, grub-install only installs the secure boot loaders if the live session is connected to the internet. If secure boot is disabled, will get a squawk to that effect, but the command will complete without issue. If you want to install Grub without secure boot, change the first line to apt install grub-efi-amd64 (no -signed or shim-signed) and omit —uefi-secure-boot from the last line; internet access not needed, but doesn’t hurt.

chroot . Mainly useful if for some reason you need to run update-grub, as well as install/reinstall Grub. For that matter, if all you need to do is update Grub from the live session, you do that the same way; just leave out the grub-install line. As with the regular live session method, if you have a boot partition, you need to insert a second step to mount it.

For BIOS, still assuming the system partition is sda1:

sudo mount /dev/sda1 /mnt for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done sudo chroot /mnt grub-install /dev/sda update-grub exit sudo umount -R /mnt

FYI, the second line is a compact way of doing bind mounts (sudo mount —bind /dev /mnt/dev, etc.), so those directories are available in the chroot environment. Per Arch Wiki, adding -R (—recursive) to the unmount command also releases the bind mounts.

Читайте также:  Linux get system time

For UEFI, assuming the system partition is sda2 and the EFI partition is sda1:

sudo mount /dev/sda2 /mnt sudo mount /dev/sda1 /mnt/boot/efi for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done sudo cp /etc/resolv.conf /mnt/etc modprobe efivars sudo chroot /mnt apt install grub-efi-amd64-signed shim-signed grub-install /dev/sda --uefi-secure-boot update-grub exit sudo umount /mnt/boot/efi sudo umount -R /mnt

As mentioned above, grub-install needs access to the internet to install the secure boot loader. That’s what the fourth and fifth lines do. Be sure to set up a connection in the live session before running the commands. As with the regular method, you’ll get a squawk if secure boot isn’t enabled. And you can install without secure boot; modify the apt install and grub-install lines as described above.

Purge-and-Reinstall . It’s rare to need to escalate this far. The few cases I’ve noticed entailed someone or something having bollixed the Grub scripts in /etc/grub.d (yes, I’m looking at you, Grub Customizer). If still able to boot, the commands are simple:

For BIOS: Run apt purge grub-common ; will be prompted to confirm removal of boot loader. Then run apt install grub-pc os-prober . Select destination for boot loader when prompted (tap space key to select). Unless you have a very good reason, install to the device, not the system partition.

os-prober is removed by purge but only a recommended package on reinstall, so specifying additionally. Same with shim-signed for UEFI.

For UEFI: Similar, but the packages to install are different. Run apt purge grub-common , then apt install grub-efi-amd64-signed os-prober shim-signed . Select destination for boot loader if prompted (probably won’t be).

Purge-and-Reinstall in chroot . This is for the scenario where can’t boot. Remember, if you have a boot partition, insert a second step to mount it.

For BIOS, assuming the system partition is sda1:

sudo mount /dev/sda1 /mnt for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done sudo cp /etc/resolv.conf /mnt/etc sudo chroot /mnt apt purge grub-common apt install grub-pc os-prober exit sudo umount -R /mnt

For UEFI, assuming the system partition is sda2 and the EFI partition is sda1. Again, you need to set up an internet connection.

sudo mount /dev/sda2 /mnt sudo mount /dev/sda1 /mnt/boot/efi for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done sudo cp /etc/resolv.conf /mnt/etc modprobe efivars sudo chroot /mnt apt purge grub-common apt install grub-efi-amd64-signed os-prober shim-signed exit sudo umount /mnt/boot/efi sudo umount -R /mnt

Frankly, if you’ve gotten this far and still no joy, probably no alternative except reinstall of the whole system.

Источник

Как можно через терминал установить grub в Linux mint’е

Вопрос такой: после установки Linux mint при загрузки системы показывается сам логотип системы! да и сама система полностью загружается и функционирует только интерфейс grub отсутствует.

2 ответа 2

нашёл решение!! *решил оставить пост МОЖЕТ комунибуть пригодится. решение проблемы оказывается куда прошё чем казалось. . Если ваш компьютер использует BIOS для загрузки, нажмите и удерживайте Shift клавишу во время загрузки GRUB, чтобы открыть меню загрузки. Если ваш компьютер использует UEFI для загрузки, нажмите Esc несколько раз во время загрузки GRUB, чтобы открыть меню загрузки.

Читайте также:  Linux изменить uuid разделов

Самый простой вариант — установить Grub Customizer и спокойно редактировать меню. https://launchpad.net/~danielrichter2007/+archive/ubuntu/grub-customizer Установка из PPA для Linux Mint 19 и ниже. Для Linux Mint 20 в терминале sudo apt install grub-customizer из официальных реп.

Или правите в терминале sudo xed /etc/default/grub GRUB_TIMEOUT_STYLE=»menu» — визуализация меню GRUB_TIMEOUT=»10″ — время в сек

После сохранения изменений в терминале sudo update-grub

Похожие

Подписаться на ленту

Для подписки на ленту скопируйте и вставьте эту ссылку в вашу программу для чтения RSS.

Дизайн сайта / логотип © 2023 Stack Exchange Inc; пользовательские материалы лицензированы в соответствии с CC BY-SA . rev 2023.7.14.43533

Нажимая «Принять все файлы cookie» вы соглашаетесь, что Stack Exchange может хранить файлы cookie на вашем устройстве и раскрывать информацию в соответствии с нашей Политикой в отношении файлов cookie.

Источник

compizomania

GRUB 2.00 был выпущен недавно.
После восьми лет разработки официально представлен первый стабильный релиз модульного многоплатформенного менеджера загрузки GNU GRUB 2.00 (GRand Unified Bootloader).

Если вы хотите обновить загрузчик, то эта инструкция покажет вам, как это сделать.

Откройте терминал (Ctrl+Alt+T), скопируйте и выполните команду ниже, чтобы загрузить последнюю версию GRUB:

wget -O- ftp://ftp.gnu.org/gnu/grub/grub-2.00.tar.xz | tar -xJ

Затем нужно войти в каталог grub-2.00/, выполнив следующую команду:

Затем в этом каталоге, установите эти два пакета следующей командой:

sudo apt-get install bison flex

Теперь скопируйте и последовательно выполните следующие команды, для установки GRUB2.00:

sudo ./configure —prefix=/usr
sudo make
sudo make install

Далее установите GRUB 2.00 на тот раздел диска, на котором он должен быть установлен, т.е. в той системе, которая будет загружаться первой:

sudo grub-install /dev/sda

И наконец обновите GRUB, выполнив приведенную ниже команду:

Перезагрузите компьютер, чтобы убедится в установке нового GRUB 2.00.

Источник

Linux Mint Forums

How do I install grub2 after linux mint installation

Forum rules
Before you post please read how to get help. Topics in this forum are automatically closed 6 months after creation.

How do I install grub2 after linux mint installation

Post by Adam_more » Sat Aug 05, 2017 11:13 pm

please I am new to Linux Mint, I installed it along side windows 10 trying to dual boot, but Linux Mint wouldn’t install grub2 keep popping up this message ‘rub-efi-amd64-signed’ failed to install into /target/ Without the GRUB boot loader, the installed system will not boot.’, tried all the options I saw online try to fix it but didn’t work so I skip the grub installation and launch Linux Mint installer 18.2 from the terminal and installed Linux mint now trying to boot Linux Mint with windows 10, how can I installed grub into Linux mint or is there an alternative to boot Linux Mint. please help.

Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.

Re: How do I install grub2 after linux mint installation

Post by WharfRat » Sun Aug 06, 2017 1:00 am

Following these instructions will walk you through the process of installing the GRUB boot loader.

Re: How do I install grub2 after linux mint installation

Post by Adam_more » Sun Aug 06, 2017 11:53 pm

Читайте также:  Задержка выполнения команды linux

thank u, I installed grub 2 but I still don’t the grub menu when I restart, so I get into my boot manager saw Ubuntu listed select it and press enter, and I get command line with a message

«GNU GRUB version 2.02~beta2-36ubuntu3

Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions.

what does it mean pls and how do I get into grub menu.

Re: How do I install grub2 after linux mint installation

Post by hcentaur13 » Mon Aug 07, 2017 3:45 am

Thee will no need to install grub after installation when the install was done right.

Since more than 10 years there are 3 different boot methods i1. n BIOS:

That is the method a BIOS does since IBM foundet it. It has a range of limits that makes it unuseable on any boot device bigger than 2 TB:
max. number of heads: 255
max number uf zylinders: 65535
selctor size: 512 Bytesmax
nuber of sectors: 63
max number of partitions: 4
wheras 1 of them can be an extended partition that is a container of logical drives wheras each of them emolates a single partition.
wheras track 0 lives unpartitioned while sector 0 of that track is defined as MBR, the Master Boot Record that contains the boot record of the installed OS or as trick a bootloader that selects the boot record of the OS to boot in multiple boot selection.

2. UEFI that based on GPT — General Partition Table — that contains a unlimited number of partitions wheras 1 defined partition contains the boot records of an unlimited number of bootable systems.

You needs to have a disk with partition type GPT if
— the disk is greater than 4 TB
— an already installed windows is installed using UEFI

In all other cases you can use compatibility mode.

Windows boot CD/stick and linux live system are both use very tricky both to boot either CSM (msdos) or UEFI boot to boot up themself. Windos boots up defailt in UEFI linux in comatibility Mode. The way the bootup is done defines the Way the installer installs the system it installs. The installation medium defines both — it is your choice to select either UEFI or CSM to define the way the system will bootup itself and configures the system to be installed.

If you be sure to select the right method you will select manually in BIOS what to boot.

For boot in CSM (msdos) mode grub has to be installed in MBR. For boot up up in UEFI mode grub has to be installed in the only UEFI boot partition in its own directory,

It is your choice to boot up the live system the right way (the same as windows is installed) to get the installer in the right direction.

A good way to get boot up any system when the bootup seems unuseable is a very small USB stick with installed supergrub. supergrub is able to boot any system that is installed. So you can use it to get the defective boot repaired.

When you needs more help tell us in which mode UEFI or CSM is your windows installed.

Источник

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