help-grub
[Top][All Lists]
Advanced

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

Re: How to safely switch grub booting in-place from one drive to a repla


From: Simon Hobson
Subject: Re: How to safely switch grub booting in-place from one drive to a replacement with RAID?
Date: Thu, 23 Feb 2017 17:20:49 +0000

What I'd suggest is that you mount your copied system onto a directory on the 
running system, then chroot into it. Something like this (not my own work, 
recommended by someone else in a different forum) :

mkdir /sysroot
mount /dev/your-root-dev /sysroot
mount /dev/your-boot-dev /sysroot/boot
mount --bind /dev /sysroot/dev
mount --bind /sys /sysroot/sys
mount --bind /proc /sysroot/proc
mount --bind /run /sysroot/run (recommended if you are using systemd)
chroot /sysroot

You can now update stuff working in the "live" setup on the new system. You 
will probably need to update :
the fstab
your init image so it contains your MD setup - update-initramfs, or whatever's 
appropriate for your system
the grub menu - update-grub, or ...

then grub-install /dev/sdb and grub-install /dev/sdc

Bear in mind that if you are using UUIDs (for grub or in fstab) then these will 
all have changed - hence you needing to update the configs. If you'e used 
filesystem labels, then don't forget to relabel the old filesystems so there 
isn't any confusion.


PS - I'll give a plug here for http://www.supergrubdisk.org, it's a lot of "oh 
dear, I made a mess of that" situations a lot easier to resolve :-)




reply via email to

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