I have built a server running Opensuse 12.2. I am now trying to create a clone server to be used in case of emergency.
Heres what I have done so far and the problems I have encountered for which I need expert assistance.
I aquired a server with as near to the original spec as I could but there are differences… hopefully not too big a problem. Here are the basic specs:-
The source server: Fujistu Primergy TX150 S3
The Target Server Fujitsu Primergy TX150 S7
Processor: Intel P4
Processor:Intel Xeon
Chipset: Intel E7221
Chipset: Intel E3420
Intel Graphics (integrated)
Intel Graphics
Raid: Fake raid card (silicon image driver)
Raid: Hardware type
Cloning the server.
First I configured the raid on the target machine and used gparted via a live cd to match the partitioning on the source machine.
I then setup Rsync and copied the source server to target, omitting /dev, /dev/shm, /proc, /sys, /tmp, /mnt /var/run, /var/lock & /etc/udev
I installed grub2 onto the harddisk (raid) although I have not run grub2-mkconfig as I can’t boot the machine yet.
Manually edited /etc/fstab to reflect change of hard disk id e.g. /dev/disk/by-id
edited devicemap & grub.cfg to change hard disk id.
Now since grub is not fully configured I used super grub2 disk utility to boot the machine. The problem is that the boot process stalls with the following messages:- (transcribed from screen)
FATAL: Error Inserting i915 (/lib/modules/3.4.6-2.10-desktop/kernel/drivers/gpu/drm/i915/i915.ko): No Such device. *(I assume this can be fixed? Do i need to rebuild initrd?)
*
mount: devpts is already mounted or /dev/pts busy
devpts is already mounted on /dev/pts
Boot loggin started on /dev/tty1(/def/console) at Thu Apr 18 11:22:32 2013
no raid disks *(i assume the initrd is looking at the fake raid config and can’t find the new hardware raid?)
*
Trying manual resume from /dev/disk/by-id/ata-WDC_WD2500ks-00MJB_WD-WCANKH590261-part1
resume device /dev/disk/by-id/ata-WDC_WD2500ks-00MJB_WD-WCANKH590261-part1 not found (ignoring)
Waiting for device /dev/root to appear: …Could not find /dev/root.
Want me to fall back to /dev/disk/by-id/raid-sil_bjaccfbidgcf-part2? (y/n) *(note this is the old fake raid id which does not exist)
*
I think the above disk id’s are comming from initrd as I have edited fstab. grib.cfg and devicemap manually to match the new machine.
So do I need to rebuild initrd and how can I do this when the machine will not boot?. Am I percivering with a hopeless task or is there a better way to clone the server. I would like to hear some ideas or get some help with this.
You could boot from a Live USB, then chroot into the installed system to try and get things fixed.
Must say though, I’d have chosen another route: Use dd to clone the disk, then mount the root partition of the clone, edit fstab. After booting the clone in some other machine, one has to reconfigure the network.
Thanks. I have tried a chroot environment via a live cd but had problems. I will look at this forum for the correct chroot setup proceedure and try again. How difficult is it to rebuild initrd from the chroot?
On 2013-04-18 16:46, Bignige wrote:
>
> Thanks. I have tried a chroot environment via a live cd but had
> problems. I will look at this forum for the correct chroot setup
> proceedure and try again. How difficult is it to rebuild initrd from the
> chroot?
I think it should be straightforward.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
# read the sysconfig configs
if -e "/etc/sysconfig/initrd" ]; then
. /etc/sysconfig/initrd
fi
find_tmpdir()
{
local dir st size last_size=0
for dir in "$TMPDIR" /dev/shm /tmp /var/tmp; do
if test ! -w "$dir"; then
continue
fi
# try to find a directory with at least 50MB free space
**line 274 ** **st=`stat -f -c '%f * %S' "$dir/"`**
if test -z "$st"; then
continue
fi
size=$(($st))
if test "$size" -ge $((50 << 20)); then
tmp_dir="$dir"
return
elif test "$size" -gt "$last_size"; then
tmp_dir="$dir"
last_size="$size"
fi
done
if ! -d "$tmp_dir" ]; then
echo "$tmp_dir is not a directory" >&2
exit 1
fi
echo "warning: using $tmp_dir with $(($last_size >> 20))MB free space" >&2
echo "this might not be enough" >&2
}
find_tmpdir
work_dir=$(mktemp -qd $tmp_dir/${mkinit_name}.XXXXXX)
if $? -ne 0 ]; then
echo "$0: Can't create temp dir, exiting." >&2
exit 1
fi
I haven’t tried cloning before but if setting up the hardware is the issue, how about this approach?
Install new on target machine (can be bare “minimal server” system)
Copy the old machine’s directories (except /proc and /sys) to the new machine
Either setup a chroot to the migrated directories or
3a. Modify the mounts to point everything except /proc and /sys to the migrated directories.
This approach would use the ordinary Install to setup on your new hardware, then deploy your source machine’s everything else.
Just getting original,
TSU
BTW - If recovery and standby machines are your objective, have you considered a full virtualization solution using Enterprise grade technology like Xen, KVM, or VMware (sorry, VirtualBox).
I had wondered if this might work…since I am stumped with rebuilding initrd it may be worth a try!
BTW - If recovery and standby machines are your objective, have you considered a full virtualization solution using Enterprise grade technology like Xen, KVM, or VMware (sorry, VirtualBox).
I have no idea what virtualisation is, I just want the easiest way to have a standby server available. My intention was to get two servers running and then keep them mirrored with Rsync. Thanks for the tip any how.
/sbin/mkinitrd: stat: line 275: command not found
DEBUG:/tmp
/sbin/mkinitrd: stat: line 275: command not found
DEBUG:/dev/shm
/sbin/mkinitrd: stat: line 275: command not found
DEBUG:/tmp
/sbin/mkinitrd: stat: line 275: command not found
DEBUG:/var/tmp
/sbin/mkinitrd: stat: line 275: command not found
is not a directory
" " is not a directory? The temp directories are plainly there but for some reason $dir is not passed to $tmp_dir ?
On 2013-04-20 20:46, Bignige wrote:
>
> robin_listas;2549455 Wrote:
>> On 2013-04-20 17:46, Bignige wrote:
>>
>> But the “command not found” worries me. What command, stat?
>>
>> Do you use a separate /usr partition, perchance?
>>
> I will try to find out what command is not found. I do have a separate
> /usr partition… I will try running mkinitrd with /usr mounted in the
> chroot.
Ah, yes indeed, that would be it. Without /usr it will not run.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
Thanks to your help I managed to run mkinitrd. First I had to set rootdev & usrdev to point to the correct partitions and then I had to run yast bootloader to change the boot device… then mkinitrd completed without error.
However now when I reboot the machne i just get the grub> prompt. When i try to boot using a grub boot disk and tell grub to boot the vmlinuz image in /boot the boot process fails with kernel panic. see image
That’s not what you had to do. You should mount you /usr so it is available in chroot (in addition to all other mount points) and then run mkinitrd in chroot and let it figure out where your / and /usr are.
On 2013-04-22 14:36, arvidjaar wrote:
>
> Bignige;2549925 Wrote:
>> First I had to set rootdev & usrdev to point to the correct partitions
>
> That’s not what you had to do. You should mount you /usr so it is
> available in chroot (in addition to all other mount points) and then run
> mkinitrd in chroot and let it figure out where your / and /usr are.
I think you also need to edit /etc/mtab inside the chroot to reflect the
situation of what is mounted. I just remembered that I needed to do it
sometimes, some scripts look at it.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
On 2013-04-22 15:16, arvidjaar wrote:
>
> robin_listas;2549934 Wrote:
>>
>> I think you also need to edit /etc/mtab inside the chroot to reflect
>> the
>> situation of what is mounted.
>
> /etc/mtab should be link to /proc/self/mounts in 12.2
Didn’t know that. True, in 12.1 is that way, I’m seeing it at the moment.
However, the names in the chrooted environment may be different of those
of the host, which is why I had to edit the file. This means that you
would have to break the link, edit the file, and later remove it and
create back the link - unless there is some automated process that
creates it on boot.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
ok. I have retraced my steps and done exactly that. i noted that there was a typo in the fsab enties for / & /usr so i corrected these. running mkinitrd from chroot now finds / & /usr correctly and completes without error.
However on booting with grib disk I am seeing the same kernel panic error as posted above.