Closed zohaibtechknox closed 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?
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
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.
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
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.