Bootable copy of an FC9 system.

Daniel J Walsh dwalsh at redhat.com
Wed Sep 3 16:53:44 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nickolas Gray wrote:
> I am attempting to create a bootable copy of a running SELinux box on
> FC9. I think I am close but I am coming up with a kernel panic (text at
> end) Here are the steps and a brief reason. If anyone has any
> suggestions where I might have made a mistake or left something out a
> comment would be appreciated. The only requirement so far is that it has
> to be a disk to disk copy with no CD/DVD rescue involved.
> 
> The original looks like
> 
> mbr on boot sector
> /dev/sda1  ext3 /boot
> /dev/sda2  LVM
> 
> VolGroup00/LogVol00 is root
> VolGroup00/LogVol01 is swap
> 
> This is what I am doing.
> 
> • This seemed like an efficient way to dup the filesystems of the source
> to the target.
> sfdisk -d /dev/sda | sfdisk /dev/sdb
> 
> •Duplicate the MBR
> dd if=/dev/sda1 of=/dev/sdb1 bs=512k
> 
> •Copy the entire /boot from a to b
> dd if=/dev/sda of=/dev/sdb bs=664 count=1
> 
> •Add the /dev/sdb2 to LVM
> pvcreate /dev/sdb2
> 
> create the VolGroup for /
> vgcreate -s 32m VolGroup01 /dev/sdb2
> 
> Create the logical volume for / and swap
> lvcreate -l 1562 -n LogVol00 VolGroup01
> lvcreate -l 62 -n LogVol01 VolGroup01
> 
> Create the swap area
> mkswap /dev/VolGroup01/LogVol01
> 
> Format the / filesystem
> mkfs -t ext3 /dev/VolGroup01/LogVol00
> 
> Create the snapshot
> lvcreate -L 20g -s -n snap /dev/VolGroup00/LogVol00
> 
> Mount the snapshot
> mount /dev/VolGroup00/snap /snapshot
> 
> Mount the target
> mount /dev/VolGroup01/LogVol00 /target
> 
> Rsync over the snapshot
> rsync -vXxpr  /snapshot/* /target
> 
> Unmount the snapshot
> umount /snapshot
> 
> lvremove -f VolGroup00/snap
> 
> At this point I fixed the initrd, the fstab and grub.conf on the target
> to point to VolGroup01 instead of VolGroup00.
> 
> I would think this should be it.
> 
> What I get is.
> 
> root (hd0,0)
> Filesystem type is .....
> kerne /vmlinuz ......
> Linux bzimage.....
> initrd / initrd ....
> Linux initrd
> 
> 
> Decompresing Linux ... Done
> Booting the kernel
> Red Hat nash version 6,0,52 starting
> Reading all physical volumes this make take awhile ....
> Found volume group VolGroup01 now active
> ERROR: exec of init (/sbin/init) failed failed!!!! No such file or
> directory
> ERROR:  failed in exec of /bin/echo: No such file or directory
> a couple messages about not finding /bin/sleep
> Kernel Panic
> 
> I am not really sure where this is getting to. I thought it was getting
> to the initrd but now I am not sure.
> 
> Thanks Nick
> 
> 
> -- 
> fedora-selinux-list mailing list
> fedora-selinux-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-selinux-list
Why do you think this is an SELinux issue?  If you boot enforcing=0 does
it still blow up?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAki+wRgACgkQrlYvE4MpobM6JwCeNSPTbPYwT7RAgG03A8d+sDyv
VOgAn1mQ6tSxVdKAN5XIEP295+oOpiXV
=URlk
-----END PGP SIGNATURE-----




More information about the fedora-selinux-list mailing list