After Deprec

openstack_cloud_computing_cookbook

Issue link: https://read.uberflip.com/i/1334488

Contents of this Issue

Navigation

Page 62 of 317

Administering OpenStack Compute 52 11. We can now extract the EXT4 partition that is the basis of our machine image. We do this by interrogating the image we created and extracting the data partition. sudo losetup -f CentOS-6.2-i386-filesystem.img sudo losetup -a sudo fdisk -l /dev/loop0 12. This will produce output as shown in the following screenshot: 13. The key value to note here is the Start sector, which is specified as 2048. We take this value and multiply it by 512 bytes to give us 1048576. We use this byte value to extract the data for our image. 14. Unmount the loop device and then remount it, using this byte value calculated as the offset. sudo losetup -d /dev/loop0 sudo losetup -f -o 1048576 CentOS-6.2-i386-filesystem.img sudo losetup -a 15. We can then extract the mounted file system, which becomes our machine image. sudo dd if=/dev/loop0 of=CentOS-6.2-i386.img 16. We then unmount our offset image, now that we have extracted the data to our image file. sudo losetup -d /dev/loop0 17. We're now ready to configure our image for our cloud environment, so we mount this extracted image, so that we can edit the files within it. sudo mount -o loop CentOS-6.2-i386.img /mnt www.it-ebooks.info

Articles in this issue

Links on this page

Archives of this issue

view archives of After Deprec - openstack_cloud_computing_cookbook