Migrate boot from /(/dev/sda1) to /boot(/dev/sdb1)

General support questions
Post Reply
dralmostright
Posts: 2
Joined: 2018/02/16 04:51:48

Migrate boot from /(/dev/sda1) to /boot(/dev/sdb1)

Post by dralmostright » 2018/02/16 05:11:42

Hi experts,

I am struggling with separating /boot partition from /. The steps I followed are:
  • prepared /dev/sdb1 with ext4
  • shutdown and start in recovery mode
  • mount /dev/sdb1 /tmp/tmpboot
  • copied the boot contents to /tmp/tmpboot
  • edited /etc/fstab for boot
/dev/sdb1 /boot ext4 defaults 1 1
  • installed grub with grub2-install /dev/sdb (no erros)
  • rebooted
When rebooted it went on grub rescue mode stating error file '/boot/grub2/i386-pc/normal.md' not found

with searching in google it set the prefix to (hd1,modos1)/grub2 , then insmod normal, then normal

the O/S booted normally. Then again I remounted /boot, rebuild initrg image and installed grube using
grub2-install /dev/sdb

But still no success so any help will be highly appreciated.

I will provide further details if needed.

Regards,

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: Migrate boot from /(/dev/sda1) to /boot(/dev/sdb1)

Post by tunk » 2018/02/16 12:06:39

Why do you want to do this?
What's your partition layout on sda and sdb? Is / still on sda?
Any error messages?

dralmostright
Posts: 2
Joined: 2018/02/16 04:51:48

Re: Migrate boot from /(/dev/sda1) to /boot(/dev/sdb1)

Post by dralmostright » 2018/02/16 16:05:18

Hi tunk,

As now my /boot is in / i.e (/dev/sda1) so i want to migrate the /boot to /boot pointing to (/dev/sdb1).

The error am getting is
error: file "/boot/grub2/i386-pc/normal.mod" not found.
Entering rescue mode.

I have already specified the error in the first post.

regards,

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Migrate boot from /(/dev/sda1) to /boot(/dev/sdb1)

Post by TrevorH » 2018/02/16 16:35:03

How did you copy the contents of the old /boot to /tmp/tmpboot?

After you've copied it, you probably need to mount it on /boot and run restorecon -RFv /boot to reset all the selinux contexts which will have been set to the wrong thing by copying to the wrong location (/tmp/tmpboot vs /boot).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply