I have a remote server (no physical access to it) that I need to clone locally. So, I attached a secondary HD to a local linux server, created the partitions boot, swap and root and rsync'd all the data from the remote server. The copy went smoothly but when I try to activate grub so the new drive is bootable this is what happens (the remote server has LVM partitions while on the local drive I just created boot, swap and root normally):
I mount the copied image this way:
mount /dev/sdb3 /mount && mount /dev/sdb1 /mount/boot/
mount --bind /dev /mount/dev && mount --bind /dev/pts /mount/dev/pts && mount --bind /proc /mount/proc && mount --bind /sys /mount/sys
chroot /mount
Then I attempt to install grub:
grub-install /dev/sdb
Could not find device for /dev/mapper/VolGroup-lv_root
The file /boot/grub/stage1
not read correctly.
(and I tried to boot into this drive but I get a "grub rescue" prompt)
/dev/mapper/VolGroup-lv_root
is the root partition of the remote server. I don't know what I need to do here. I tried removing the /boot/grub/
folder attempting a fresh grub install but the same happens. How can I tell grub that now the root partition is /dev/sda3
or how would you go about fixing this?
grub.conf file:
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-573.7.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-573.7.1.el6.x86_64 root=/dev/sda1
initrd /initramfs-2.6.32-573.7.1.el6.x86_64.img
fdisk -l output on the cloned drive:
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 66 524288 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2 66 2155 16777216 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sdb3 2155 41774 318241792 83 Linux
Partition 3 does not end on cylinder boundary.
grub-install
gets its device ideas.