This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:linux_move_bootdisk [2023/03/14 00:17] manu [Move OS disk to a new (rootvg)] |
linux:linux_move_bootdisk [2025/09/19 20:08] (current) manu |
||
---|---|---|---|
Line 3: | Line 3: | ||
https://access.redhat.com/discussions/2158911 | https://access.redhat.com/discussions/2158911 | ||
- | ====== Move OS disk to a new (rootvg) ====== | + | https://access.redhat.com/solutions/68503 |
+ | |||
+ | http://hpux-howto.blogspot.com/2018/07/how-to-migrate-boot-partition-to-other.html | ||
+ | |||
+ | https://access.redhat.com/discussions/2158911?tour=8 | ||
+ | |||
+ | https://access.redhat.com/solutions/68503 | ||
+ | |||
+ | ===== Move OS disk to a new (rootvg) ===== | ||
== Clean yum cache == | == Clean yum cache == | ||
Line 323: | Line 331: | ||
<cli prompt='#'> | <cli prompt='#'> | ||
[root@rhlabh1 grub2]# bootlist -m normal sdc sdd sdg sdh | [root@rhlabh1 grub2]# bootlist -m normal sdc sdd sdg sdh | ||
- | </cli | + | </cli> |
Reboot | Reboot | ||
Line 330: | Line 338: | ||
</cli> | </cli> | ||
- | === On x86, if using EFI === | + | ==== On x86, if using EFI ==== |
Copy the efi boot manager, the label must be different to previous one | Copy the efi boot manager, the label must be different to previous one | ||
Line 336: | Line 344: | ||
# efibootmgr -c --disk /dev/sdc --part 1 -L "Red Hat Enterprise Linux 7.3" | # efibootmgr -c --disk /dev/sdc --part 1 -L "Red Hat Enterprise Linux 7.3" | ||
</cli> | </cli> | ||
+ | |||
+ | ===== Method 2: Suse with BTRFS and LVM ===== | ||
+ | |||
+ | <code> | ||
+ | sfdisk -l /dev/sda > svc_bootdisk.out | ||
+ | HD=sdxxx # new disk | ||
+ | sfdisk $HD < svc_bootdisk.out | ||
+ | blockdev --rereadpt $HD | ||
+ | |||
+ | PV=/dev/dm-xxxx | ||
+ | pvscan | ||
+ | pvcreate $PV | ||
+ | pvscan | ||
+ | |||
+ | vgs | ||
+ | vgextend system $PV | ||
+ | pvs | ||
+ | pvmove --atomic /dev/dm-old /dev/dm-new | ||
+ | |||
+ | # lvs -a -o +devices view | ||
+ | vgreduce system /dev/dm-old | ||
+ | pvremove /dev/dm-old | ||
+ | |||
+ | grub2-install /dev/disk/by-id/dm-new-part1 | ||
+ | grub2-mkconfig -o /boot/grub2/grub.cfg | ||
+ | systemctl daemon-reload | ||
+ | mkinitrd | ||
+ | bootlist -m normal sdan sdal sdaq sdai | ||
+ | bootlist -m normal -r | ||
+ | </code> |