Extending Partition Without Rebooting (EBS Amazon Linux)

This guide assumes that you are using a Linux OS in AWS EC2 and are not using LVM. In the example below we will walk through the steps of growing an EBS volume.

First we need to go to the “Volumes” page of EC2 and right click the volume we wish to expand and click modify. Increase the size to the desired amount and press modify. Once the storage amount changes in the EBS volume screen we are ready to proceed.

SSH into the machine we extended the drive for and run the following command to identify the drive. This may vary on systems with multiple disks, however for most single volume EC2 machines this will be /dev/xvda1

sudo lsblk

NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT

xvda    202:0    0  40G  0 disk

└─xvda1 202:1    0  40G  0 part /

Next once you’ve identified the disk (in my case above it’s /dev/xvda1, you’ll want to run the following commands:

To grow the partition run(make note of the space between the device and partition number): sudo growpart /dev/xvda 1

Finally to grow our partition to be used by the OS:
sudo resize2fs /dev/xvda1

Note: if you are running an XFS file system you may need to run xfs_growfs instead of resize2fs

Happy Thanksgiving!

Well dear friends in operations/systems/devops/sysops/SREs etc, it’s that time of the year again. The time when traffic swells, auto-scaling, monitoring, and all the hard work we do day in and day out matters the most. Oh, well and there’s turkey and family too. But for those of us in the trenches keeping holiday shopping online I raise my cup of strong coffee and wish you quiet pagers, solid uptimes, happy customers, and wish you a happy holiday weekend. See you on the other side of the black week!

 

And of course if you need some comedic relief….

Use Java 6u65-apple with SKDMan on Mojave/High Sierra/Sierra/El Capitan

If you work in and around the world of Java, Groovy, Spring MVC, Grails, or Gradle you are bound to use a tool like sdkman when juggling multiple versions of these applications. If you haven’t used it before it’s worth taking for a spin. You can run simple commands like sdk install grails or sdk use java 8.0.181-zulu. This is great except that Java 6 isn’t really supported in sdkman for Mac. Queue the simple workaround!

Install SDK Man if you are not already using it, link is here

Go to the Apple Download page for Java 6 here

Next you will want to open terminal and do the following:

 cd ~/.sdkman/candidates/java/ 

Next you will create the following symlink:

 ln -s /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/ 6u65-apple 

If this is successful you should be able to see it in the list when running sdk list java. Next we can verify that this worked successfully:

sdk use java 6u65-apple

You should now see a green print statement that reads “Using java version 6u65-apple in this shell. You can further validate that its working by running java -version. Your output should resemble the below:

java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-468)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-468, mixed mode)