<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>My AWS Musings &#187; EBS</title>
	<atom:link href="http://aws-musings.com/tag/ebs/feed/" rel="self" type="application/rss+xml" />
	<link>http://aws-musings.com</link>
	<description>Cloud computing, EC2, RDS, SQS, S3, Java...</description>
	<lastBuildDate>Mon, 30 May 2011 18:13:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to expand your ebs volume</title>
		<link>http://aws-musings.com/how-to-expand-your-ebs-volume/</link>
		<comments>http://aws-musings.com/how-to-expand-your-ebs-volume/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 18:56:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[ebs volume]]></category>
		<category><![CDATA[expand ebs volume]]></category>
		<category><![CDATA[grow ebs]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=104</guid>
		<description><![CDATA[Increasing size of your ebs volume is pretty easy. resize2fs does the trick. Here is the detailed procedure to increase size of your ebs volume. First detach the volume and take a snapshot of the volume. If you already have a snapshot and haven&#8217;t made any changes after that, no need to take a new [...]]]></description>
			<content:encoded><![CDATA[<p>Increasing size of your ebs volume is pretty easy. resize2fs does the trick. Here is the detailed procedure to increase size of your ebs volume.</p>
<p>First <a href="http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?detaching-ebs.html">detach the volume</a> and take a snapshot of the volume. If you already have a snapshot and haven&#8217;t made any changes after that, no need to take a new snapshot.</p>
<p><span id="more-104"></span><br />
No create a new volume from this snapshot. Let&#8217;s say your original volume was 10G and you wanted to increase its size to 20G.<br />
<code><br />
ec2-create-volume -z us-east-1a --size 20 --snapshot snap-xxxxxxxx<br />
</code><br />
The command will output id of the new volume. Use that id in the following command to attach the volume to any instance you have up.<br />
<code><br />
ec2-attach-volume vol-yyyyyyyy --instance i-xxxxxxxx --device /dev/sdh<br />
</code><br />
Make sure that ec2-describe-volumes show the state of the instance as attached. Once the volume is attached, mount it at a path say /mnt/data. I am assuming here that your volume had ext3 filesystem.<br />
<code><br />
mkdir /mnt/data<br />
echo '/dev/sdh /mnt/data ext3 defaults,noatime 0 0' >> /etc/fstab<br />
mount /mnt/data<br />
</code><br />
Mounting the volume is necessary as otherwise you wont&#8217; be able to execute the following (resize2fs) command.<br />
Now execute the following command to resize the volume<br />
<code><br />
resize2fs /dev/sdh<br />
</code><br />
You should see the following output (sizes you see might be different):<br />
<code><br />
Filesystem at /dev/sdh is mounted on /mnt/data; on-line resizing required<br />
old desc_blocks = 1, new_desc_blocks = 2<br />
Performing an on-line resize of /dev/sdh to 5505024 (4k) blocks.<br />
The filesystem on /dev/sdh is now 5505024 blocks long.<br />
</code><br />
The command should execute in a minute or two for 20G size. That&#8217;s it, you can verify your new size by executing:<br />
<code><br />
df -h<br />
</code><br />
This should show you that the volume&#8217;s new size. That&#8217;s it! </p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/how-to-expand-your-ebs-volume/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How to create an ebs image from an existing ec2 instance</title>
		<link>http://aws-musings.com/how-to-create-an-ebs-image-from-an-existing-ec2-instance/</link>
		<comments>http://aws-musings.com/how-to-create-an-ebs-image-from-an-existing-ec2-instance/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 02:11:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[EBS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[ebs backed instance]]></category>
		<category><![CDATA[ec2 image]]></category>
		<category><![CDATA[s3 image]]></category>
		<guid isPermaLink="false">http://aws-musings.com/?p=63</guid>
		<description><![CDATA[Amazon recently announced a new feature which allows you to boot from an ebs volume. But it doesn&#8217;t provide any tools to convert your existing AMIs to this new type of image. There is no easy way to create an ebs image from scratch. There are some posts that explain how to convert your existing [...]]]></description>
			<content:encoded><![CDATA[<p>Amazon recently announced a <a href="http://aws.amazon.com/about-aws/whats-new/2009/12/03/amazon-ec2-instances-now-can-boot-from-amazon-ebs/">new feature which allows you to boot from an ebs volume</a>.  But it doesn&#8217;t provide any tools to convert your existing AMIs to this new type of image. There is no easy way to create an ebs image from scratch. There are some posts that explain how to convert your existing AMI into this new type of image using ec2-unbundle and <a href="http://en.wikipedia.org/wiki/Dd_%28Unix%29">dd (a linux utility)</a>.  I am going to take a little different route and explain how we can create an ebs image from an existing instance. It&#8217;s fairly simple to create a new image using dd from an existing instance. </p>
<p><span id="more-63"></span><br />
Make sure that you have the <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351">latest ec2 api tools</a> before you start creating and ebs type of image. Support for some of the commands (such as to register a snapshot as an image) is only available in the version 46266 onwards.</p>
<p>1) <a href="http://docs.amazonwebservices.com/AmazonEC2/dg/2006-10-01/CLTRG-run-instances.html">Launch an ec2 instance</a> from the image you want to convert to an ebs image. Make the changes (if any) you want to make to this instance. Let&#8217;s say that your instance id is i-xxxxxxxx</p>
<p>2) Launch an 10G ebs volume and attach it to this instance. You can create a bigger volume too. But currently the default size of Amazon&#8217;s ephemeral storage is 10G and hence a 10G volume should be sufficient for most of the people.<br />
The following code will launch an ebs volume and attach it to your instance. The code assumes that us-east-1a is the availability zone of your instance.<br />
<code><br />
ec2-create-volume --size 10 --availability-zone us-east-1a<br />
</code><br />
The command should give you an volume id in the form of  vol-yyyyyyyy. Note it down and use it in the next command to attach this volume to your instance.<br />
<code><br />
ec2-attach-volume vol-yyyyyyyy --instance i-xxxxxxxx --device /dev/sdh<br />
</code><br />
Create ext3 filesystem on this volume and mount the volume<br />
<code><br />
yes | mkfs -t ext3 /dev/sdh<br />
mkdir /mnt/ebsimage<br />
echo '/dev/sdh /mnt/ebsimage ext3 defaults,noatime 0 0' >> /etc/fstab<br />
mount /mnt/ebsimage<br />
</code><br />
3) Now that the volume is ready and mounted at /mnt/ebsimage, we are going to copy your entire disk to this volume using <a href="http://wiki.linuxquestions.org/wiki/Dd">dd (a linux disc imaging utility)</a>.<br />
<code><br />
nohup dd if=/dev/sda1 of=/dev/sdh &#038;<br />
</code><br />
The command above will start copying the disc to the ebs volume in background. This could take really long time (e.g. 20 minutes) depending upon your data. To check status of copying you will first need to get pid of the dd process by executing<br />
<code><br />
ps -aef | grep dd<br />
</code><br />
And then use the pid obtained in the following command<br />
<code><br />
kill -SIGUSR1 pid<br />
</code><br />
The above command will clearly print a message similar to<br />
<code><br />
531694080 bytes (532 MB) copied, 11.6338 seconds, 45.7 MB/s<br />
</code><br />
Please note that the message is printed by the dd process and not by the kill process. This means if you have your output redirected to somewhere else, the message will be printed there instead of your screen.</p>
<p>3) Once dd finishes, do a spot check on the data copied in /mnt/ebsimage. If you find everything ok, unmount the volume and detach the volume from the ec2 instance. You can use the following commands to do so:<br />
<code><br />
umount /mnt/ebsimage<br />
ec2-detach-volume vol-yyyyyyyy --instance i-xxxxxxxx<br />
</code></p>
<p>4) Now take the snapshot of the ebs volume.<br />
<code><br />
ec2-create-snapshot vol-yyyyyyyy<br />
</code></p>
<p>5) Register this snapshot as an image. Use the snapshot id obtained from the output of the above command.<br />
<code><br />
ec2reg -s snap-zzzzzzzz -a <em>x86_64</em> -d <em>Description</em> -n <em>imagename</em><br />
</code><br />
Make sure that you replace the snapshot id, image name, description and the image type (x86_86 or x86_64) in the command above.</p>
<p>That&#8217;s it! Your ebs image is ready. Simply launch your instance from this image exactly the same way you launch any other ec2 instance!</p>
]]></content:encoded>
			<wfw:commentRss>http://aws-musings.com/how-to-create-an-ebs-image-from-an-existing-ec2-instance/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

