help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to install grub onto an added drive?


From: Pascal Hambourg
Subject: Re: How to install grub onto an added drive?
Date: Mon, 18 Nov 2019 20:20:44 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

Le 17/11/2019 à 20:20, Chris Green a écrit :

I want to add a new SSD to my current desktop system.  This in itself
isn't a major problem, I've done similar things before without
problems (in fact I did this already with the current small and
relatively slow SATA SSD that has the / filesystem on it).  The issue
is that I suspect the motherboard won't be able to boot from the new
NVME/PCIe SSD so I'm aiming to have a small, bootable drive to just
provide the boot files and have everything except for /boot on the
new, fast, SSD.

If the motherboard has an M.2 slot with NVMe support, the firmware should be able to boot from an NMVe SSD. If it has no M.2 slot and you added the NMVe SSD with a PCIe adapter card, it is unlikely the firmware is able to boot from an NVMe SSD.

So, I can move all the required OS files to the new hard disk but how
do I get grub installed on whatever I have as a 'small' boot disk?

You must install not only GRUB but the whole /boot on the boot drive.

Basic questions:-

     Presumably the disk where the /boot filesystem is has to be marked
     bootable using fdisk.

You cannot mark a whole drive as bootable. You can mark a primary partition as bootable, but this is needed only with broken firmwares which require it. A compliant BIOS does not require a bootable partition.

     How do grub-install and grub-mkconfig relate to each other?

grub-install installs GRUB in the specified locations and grub-mkconfig generates a configuration script on its standard output that you can write to the location where GRUB expects to find it, by default /boot/grub/grub.cfg. update-grub must be run from the target system (natively or chrooted). grub-install can be run from any other system if you specify the --boot-directory= location.

     Which do I run first?

It does not matter.

 Do I need to run both?

Yes.

     What do I need to tell them (parameter-wise)?

In BIOS/legacy mode, grub-install takes at least one parameter : the device node you want to install GRUB on. grub-mkconfig takes no parameter.

     Is there anything else I need to do?

Update fstab and the initramfs.

     I guess I need to run grub-install and grub-mkconfig on the system
     as I want it configured, i.e. with the new/small disk waiting for
     grub to be installed on /boot.  So, this feels a bit risky as,
     until grub has been installed there the system won't [re]boot.
     What's the best way to make sure I have a 'get out' if it all goes
     pear shaped?


Yes, I know that question about grub-install and grub-mkconfig seems
rather naive but I have to say none of the tutorials, man pages or
other help that I could find actually clarified this.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]