Does this cover the scenario of a user launching CentOS 6.x, updating the kernel, snapshotting, and having the relaunched instance resized?
On Mon, Oct 6, 2014 at 12:38 PM, Regan McDonald <[email protected]> wrote: > Seconded. This is what I use with my CentOS images, and it works great. > > > On Mon, Oct 6, 2014 at 1:54 PM, Robert Plestenjak < > [email protected]> wrote: > >> Try this: >> >> https://github.com/flegmatik/linux-rootfs-resize >> >> - Robert >> >> ----- Original Message ----- >> From: "Antonio Messina" <[email protected]> >> To: "Robert van Leeuwen" <[email protected]> >> Cc: [email protected] >> Sent: Friday, October 3, 2014 2:50:44 PM >> Subject: Re: [Openstack-operators] Problem creating resizable CentOS 6.5 >> image >> >> I use this snippet in my %post section. I don't find it particularly >> elegant, but it works just fine: >> >> # Set up to grow root in initramfs >> cat << EOF > 05-grow-root.sh >> #!/bin/sh >> >> /bin/echo >> /bin/echo Resizing root filesystem >> >> /bin/echo "d >> n >> p >> 1 >> >> >> w >> " | /sbin/fdisk -c -u /dev/vda >> /sbin/e2fsck -f /dev/vda1 >> /sbin/resize2fs /dev/vda1 >> EOF >> >> chmod +x 05-grow-root.sh >> >> dracut --force --include 05-grow-root.sh /mount --install 'echo >> fdisk e2fsck resize2fs' /boot/"initramfs-grow_root-$(ls /boot/|grep >> initramfs|sed s/initramfs-//g)" $(ls /boot/|grep vmlinuz|sed >> s/vmlinuz-//g) >> rm -f 05-grow-root.sh >> >> tail -4 /boot/grub/grub.conf | sed >> s/initramfs/initramfs-grow_root/g| sed s/CentOS/ResizePartition/g | >> sed s/crashkernel=auto/crashkernel=0@0/g >> /boot/grub/grub.conf >> >> It only works if the root filesystem is `/dev/vd1` (which is a very >> common setup anyway) but can be adapted. >> >> I only tested it with CentOS 5 and 6. The full script is available at >> https://github.com/gc3-uzh-ch/openstack-tools/ >> >> .a. >> >> >> -- >> [email protected] >> [email protected] +41 (0)44 635 42 22 >> S3IT: Service and Support for Science IT http://www.s3it.uzh.ch/ >> University of Zurich >> Winterthurerstrasse 190 >> CH-8057 Zurich Switzerland >> >> _______________________________________________ >> OpenStack-operators mailing list >> [email protected] >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators >> >> _______________________________________________ >> OpenStack-operators mailing list >> [email protected] >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators >> > > > _______________________________________________ > OpenStack-operators mailing list > [email protected] > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators > >
_______________________________________________ OpenStack-operators mailing list [email protected] http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators
