Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
I am virtualizing some machines from Dell 2950s running RHEL5 to ESX 3 using my own script running on Kanotix (a Knoppix 64-bit variant).
I have a script that builds and copies the data, but I need to rebuild the kernel due to device changes.
chroot /mnt/sysimage/root/mkinitrd fails. It is an edited copy of mkinitrd. In attempting to debug this problem, I find that chroot /mnt/sysimage fails also.
I do the following:
vgscan --mknodes
vgchange -ay
lvscan
mkdir /mnt/sysimage
mount /dev/VG00/LVroot /mnt/sysimage
mkdir /mnt/sysimage
mount /dev/VG00/LVroot /mnt/sysimage
mount -o remount,dev,exec,data=ordered /dev/VG00/LVroot /mnt/sysimage
mount -o exec,data=ordered /dev/sda1 /mnt/sysimage/boot
mount -o exec,data=ordered /dev/VG00/LVtmp /mnt/sysimage/tmp
mount -o exec,data=ordered /dev/VG00/LVusr /mnt/sysimage/usr
mount -o exec,data=ordered /dev/VG00/LVvar /mnt/sysimage/var
mount -o exec,data=ordered /dev/VG00/LVopt /mnt/sysimage/opt
mount -o exec,data=ordered /dev/VG00/LVoradata /mnt/sysimage/oradata
mount --bind /proc /mnt/sysimage/proc
mount --bind /sys /mnt/sysimage/sys
mount --bind /dev /mnt/sysimage/dev
mount --bind /dev/pts /mnt/sysimage/dev/pts
and then
chroot /mnt/sysimage
this gives
chroot: cannot run command `/bin/bash': Exec format error
also
/mnt/sysimage/bin/bash gives the message
chroot: cannot run command `/bin/bash': Exec format error
uname -a on the real machine gives
Linux hart-a725.ccci.org 2.6.9-67.0.7.ELsmp #1 SMP Wed Feb 27 04:47:23 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
uname -a on the Kanotix guest gives
Linux Kanotix 2.6.24-3-kanotix #1 SMP Mon Dec 31 17:27:37 UTC 2007 i686 GNU/Linux
file /mnt/sysimage/bin/bash gives
/mnt/sysimage/bin/bash: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), for GNU/Linux 2.4.0, stripped
and for reference,
file /bin/bash gives
/bin/bash: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped
the pertinent section of mount shows
/dev/mapper/VG00-LVroot on /mnt/sysimage type ext3 (rw,data=ordered)
/dev/sda1 on /mnt/sysimage/boot type ext3 (rw,data=ordered)
/dev/mapper/VG00-LVtmp on /mnt/sysimage/tmp type ext3 (rw,data=ordered)
/dev/mapper/VG00-LVusr on /mnt/sysimage/usr type ext3 (rw,data=ordered)
/dev/mapper/VG00-LVvar on /mnt/sysimage/var type ext3 (rw,data=ordered)
/dev/mapper/VG00-LVopt on /mnt/sysimage/opt type ext3 (rw,data=ordered)
/dev/mapper/VG00-LVoradata on /mnt/sysimage/oradata type ext3 (rw,data=ordered)
/proc on /mnt/sysimage/proc type none (rw,bind)
/sys on /mnt/sysimage/sys type none (rw,bind)
/dev on /mnt/sysimage/dev type none (rw,bind)
/dev/pts on /mnt/sysimage/dev/pts type none (rw,bind)
I have tried all kinds of things to get this to work. I've used a couple of other Knoppix64- and Knoppix-type distros. I've done all kinds of Google searches. Somehow I'm guessing these just won't run the bash off of the target sysem due to architecture differences.
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe