Jerry Geis
2007-Oct-27 17:50 UTC
[CentOS] migrating files for centos virtualization, virtual disk no longer boots.
All, I am playing with virtualization on centos 5. I took my old redhat 7 disks and created a 10GIG virtual disk, I installed redhat 7. Now I am trying to get the EXACT image copied off of my actual redhat 7 disk so that I know it is the same (including all patches, updates and OTHER things I did to it that I have forgotten about). I booted the redhat 7 image just fine at this point. I also copied it for backup so I dont have to install again. So on my centos 5 box I mounted the image with a loop command. mount -t ext3 -o loop,offset=32256 redhat7.img /mnt/image This works fine. Then I logged into the redhat 7 system and executed the command tar --exclude ./proc --exclude ./mnt --exclude ./sys --exclude ./dev -cvf - . | ssh root at 192.168.1.8 "( cd /mnt/image ; tar xvpf -)" Where 192.168.1.8 is my centos 5 box and /mnt/image the mounted image. The copy seems to go fine. But after I do this when I try to virtualize the redhat7 image it stops at: GRUB When I copy the second image back on top of the first image it then boots again. So glad I made that copy of the image file. What is happening with the tar command that is messing up grub and keeping it from booting? Thanks, Jerry
Rich Huff
2007-Oct-28 13:45 UTC
[CentOS] migrating files for centos virtualization, virtual disk no longer boots.
On Sat, 2007-10-27 at 13:50 -0400, Jerry Geis wrote:> All, > > I am playing with virtualization on centos 5.<snip>> What is happening with the tar command that is messing up grub and > keeping it from booting?The master boot record (MBR) usually isn't contained in the file system, so tar has no way of copying it. I recently backed up a small laptop (not enough memory to install Linux, but enough to run it) using g4l, then restored the g4l backup into a qemu virtual disk image. It wouldn't boot. I had to connect a distribution CD iso image, boot into rescue mode, then use the command grub-install /dev/hda to make it bootable. Hope this helps, Rich> > Thanks, > > Jerry > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos-- Rich Huff <rich at richhuff.com>
Alain Spineux
2007-Oct-28 16:16 UTC
[CentOS] migrating files for centos virtualization, virtual disk no longer boots.
On 10/27/07, Jerry Geis <geisj at pagestation.com> wrote:> All, > > I am playing with virtualization on centos 5. > I took my old redhat 7 disks and created a 10GIG virtual disk, I > installed redhat 7. > Now I am trying to get the EXACT image copied off of my actual redhat 7 disk > so that I know it is the same (including all patches, updates and OTHER > things I did to it that I > have forgotten about). > > I booted the redhat 7 image just fine at this point. I also copied it > for backup so I dont have to install again. > > So on my centos 5 box I mounted the image with a loop command. > mount -t ext3 -o loop,offset=32256 redhat7.img /mnt/image > This works fine. > > Then I logged into the redhat 7 system and executed the command > tar --exclude ./proc --exclude ./mnt --exclude ./sys --exclude ./dev > -cvf - . | ssh root at 192.168.1.8 "( cd /mnt/image ; tar xvpf -)"You should use -v only in the second tar, if not every file is logged twice, just a trick.> > Where 192.168.1.8 is my centos 5 box and /mnt/image the mounted image. > > The copy seems to go fine. But after I do this when I try to virtualize > the redhat7 image it stops at: > GRUBIf I had to do the same thing myself, trying to make it simple and maximize my chances of success. I would have first installed a minimal RH7 on the disk image, then made a backup of /boot and /boot/grub/grub.conf. Also on my original rh7 I would have installed a xen kernel using : rpm -ivh kernel-xen?????.rpm. (the same as the one running on my xen system) Then copied all the files, like you did (using tar and ssh). Then restoring /boot/grub/grub.conf and kernel related /boot/initrd????? Et voila :-) Anyway the hardest part is to have grub correctly installed and a well configured initrd pre-boot image. Regards.> > When I copy the second image back on top of the first image it then > boots again. So glad I made that copy > of the image file. > > What is happening with the tar command that is messing up grub and > keeping it from booting? > > Thanks, > > Jerry > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- Alain Spineux aspineux gmail com May the sources be with you