<div dir="ltr">Seconded. This is what I use with my CentOS images, and it works great.<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 6, 2014 at 1:54 PM, Robert Plestenjak <span dir="ltr"><<a href="mailto:robert.plestenjak@xlab.si" target="_blank">robert.plestenjak@xlab.si</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Try this:<br>
<br>
<a href="https://github.com/flegmatik/linux-rootfs-resize" target="_blank">https://github.com/flegmatik/linux-rootfs-resize</a><br>
<span class="HOEnZb"><font color="#888888"><br>
- Robert<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
From: "Antonio Messina" <<a href="mailto:antonio.s.messina@gmail.com">antonio.s.messina@gmail.com</a>><br>
To: "Robert van Leeuwen" <<a href="mailto:Robert.vanLeeuwen@spilgames.com">Robert.vanLeeuwen@spilgames.com</a>><br>
Cc: <a href="mailto:openstack-operators@lists.openstack.org">openstack-operators@lists.openstack.org</a><br>
Sent: Friday, October 3, 2014 2:50:44 PM<br>
Subject: Re: [Openstack-operators] Problem creating resizable CentOS 6.5        image<br>
<br>
I use this snippet in my %post section. I don't find it particularly<br>
elegant, but it works just fine:<br>
<br>
    # Set up to grow root in initramfs<br>
    cat << EOF > 05-grow-root.sh<br>
    #!/bin/sh<br>
<br>
    /bin/echo<br>
    /bin/echo Resizing root filesystem<br>
<br>
    /bin/echo "d<br>
    n<br>
    p<br>
    1<br>
<br>
<br>
    w<br>
    " | /sbin/fdisk -c -u /dev/vda<br>
    /sbin/e2fsck -f /dev/vda1<br>
    /sbin/resize2fs /dev/vda1<br>
    EOF<br>
<br>
    chmod +x 05-grow-root.sh<br>
<br>
    dracut --force --include 05-grow-root.sh /mount --install 'echo<br>
fdisk e2fsck resize2fs' /boot/"initramfs-grow_root-$(ls /boot/|grep<br>
initramfs|sed s/initramfs-//g)" $(ls /boot/|grep vmlinuz|sed<br>
s/vmlinuz-//g)<br>
    rm -f 05-grow-root.sh<br>
<br>
    tail -4 /boot/grub/grub.conf | sed<br>
s/initramfs/initramfs-grow_root/g| sed s/CentOS/ResizePartition/g |<br>
sed s/crashkernel=auto/crashkernel=0@0/g >> /boot/grub/grub.conf<br>
<br>
It only works if the root filesystem is `/dev/vd1` (which is a very<br>
common setup anyway) but can be adapted.<br>
<br>
I only tested it with CentOS 5 and 6. The full script is available at<br>
<a href="https://github.com/gc3-uzh-ch/openstack-tools/" target="_blank">https://github.com/gc3-uzh-ch/openstack-tools/</a><br>
<br>
.a.<br>
<br>
<br>
--<br>
<a href="mailto:antonio.s.messina@gmail.com">antonio.s.messina@gmail.com</a><br>
<a href="mailto:antonio.messina@uzh.ch">antonio.messina@uzh.ch</a>                     <a href="tel:%2B41%20%280%2944%20635%2042%2022" value="+41446354222">+41 (0)44 635 42 22</a><br>
S3IT: Service and Support for Science IT   <a href="http://www.s3it.uzh.ch/" target="_blank">http://www.s3it.uzh.ch/</a><br>
University of Zurich<br>
Winterthurerstrasse 190<br>
CH-8057 Zurich Switzerland<br>
<br>
_______________________________________________<br>
OpenStack-operators mailing list<br>
<a href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br>
<br>
_______________________________________________<br>
OpenStack-operators mailing list<br>
<a href="mailto:OpenStack-operators@lists.openstack.org">OpenStack-operators@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-operators</a><br>
</div></div></blockquote></div><br></div></div>