dozzie / yumbootstrap

Linux chroot installer for Yum-based distributions
http://dozzie.jarowit.net/trac/wiki/yumbootstrap
GNU General Public License v3.0
119 stars 45 forks source link

Issue Building Centos7 on ubuntu #25

Closed zohaibtechknox closed 7 years ago

zohaibtechknox commented 7 years ago

I am creating a centos7 image with yumbootstrap method on a ubuntu 14.04 and when i try to run this image as kvm i am getting this issue Failed to mount sysroot Dependency failed for Intird Root File System So debug this issue step by step and found that during bootstrap procedure yumbootstrap copy contents of /proc/self/mounts and /etcmtab of ubuntu and copy those file in centos7 rootfile system and FYI centos7 using xfx file sysytem and ubuntu is using ext3. I have try to replace these files but i am unable to do that becuase these files are readonly even for root user.

dozzie commented 7 years ago

Freshly prepared chroot in its raw state is rarely suitable for running as a standalone OS, no matter how it was prepared (yumbootstrap, debootstrap, or something else) and usually needs some postprocessing, so it's not a big surprise.

yumbootstrap shouldn't copy /proc/self/mounts anywhere and only creates empty $TARGET/etc/mtab (and empty $TARGET/etc/fstab), and then, /etc/mtab shouldn't cause any problems for booting, even with invalid content.

Care to provide more details about your environment? Are you running custom postprocessing or postinstall scripts?

zohaibtechknox commented 7 years ago

Ok let me explain my scenario in detail below are commands and script I have used to create a centos-7 image 3rd step is the problem i want to change /etc/mtab here but unable to do it ..

here i am attaching error message file which I am getting while running this as kvm virtual machine

sysroot

dozzie commented 7 years ago

Either the procedure you provided is incomplete (lacks the most important part) or you're trying to run a tarball as a disk image. If it is the latter, it won't work; you need a disk image.

zohaibtechknox commented 7 years ago

I have mention in ist post that I am creating qcow2 image from tarball . for this here is my process cp ~/centos.dcso.tar.gz /tmp ./define-domain.sh centos 1024 1 # it is a script which will create centos.xml file for domain defination sudo qemu-img create -f raw /tmp/centos 30G sudo mkfs.ext3 -F /tmp/centos sudo mount -o loop /tmp/centos /mnt sudo tar -C /mnt -zxf /tmp/centos.dcso.tar.gz sudo umount /mnt sudo qemu-img convert -O qcow2 /tmp/centos /var/lib/libvirt/images/centos.qcow2 virsh start centos