Le 10/01/2020 à 13:27, Simon Hobson a écrit :
Chris Green <[email protected]> wrote:
So what's the easiest/simplest way to move /boot from one SATA drive
to another? In my case I want to move it from /dev/sda1 to /dev/sdb1.
There's nothing on either sda1 or sdb1 that needs to be preserved.
Several ways cone to mind, but probably what I'd do is :
• partition your current sdb so it has an appropriately sized boot partition on
it - setting flags accordingly (bootable, active, whatever)
• create a new filesystem on it
• copy all the files from your current /boot
For this, I'd normally use rsync - a bit overkill but it's my tool for choice for copies
that involve large amounts of stuff or enclosed directories. "rsync -av /boot
/mnt" assuming your new boot is mounted on /mnt
• Get the new UID for the filesystem and edit your fstab
Shutdown the system cleanly, remove your old spinning disk, see if it boots
It won't boot, because GRUB is not installed on the new boot disk and
grub.cfg is not updated with the new /boot UUID. Several steps are
required before rebooting.
Unmount the old /boot.
Mount the new /boot.
Install GRUB on the new boot disk with grub-install /dev/sdb.
Update grub.cfg with update-grub.
Now you can reboot.
If not, I reach for my trusty Grub rescue stick
(https://www.supergrubdisk.org/?pid=10, works nicely on a USB memory drive).
It is better to not break things than fixing them.