help-grub
[Top][All Lists]
Advanced

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

Re: How to change /boot disk?


From: Simon Hobson
Subject: Re: How to change /boot disk?
Date: Fri, 10 Jan 2020 12:27:26 +0000

Chris Green <address@hidden> wrote:

> Currently /boot is on a 500Gb SATA hard disk which is otherwise
> completely redundant so I'd quite like to move /boot to the 120Gb SATA
> SSD which originally had the OS on it.
> 
> 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 - 
may need to change boot device in BIOS.

If not, I reach for my trusty Grub rescue stick 
(https://www.supergrubdisk.org/?pid=10, works nicely on a USB memory drive).

If it does boot cleanly (or after getting it booted via the rescue tools), I'd 
then update the initrds and grub config since there have been changes to the 
system since they were created.

As an alternative to steps 3 & 4, create a new partition of exactly the same 
size and "dd" the filesystem across. You need to unmount /boot first, then you 
can just "dd if=/dev/sda1 of=/dev/sdb1 bs=1M". Warning, dd will do exactly what 
you tell it to do so make sure that is what you want it to do - it has very few 
safeties and will happily destroy a mounted filesystem if you get it wrong.


Simon




reply via email to

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