Note: Please go to to access the current RightScale documentation set. Also, feel free to Chat with us!
Home > Clouds > AWS > Tutorials > Initialize or Format an EBS Volume

Initialize or Format an EBS Volume


To initialize an EBS volume that was manually attached.

Note: Some ServerTemplates, such as RightScale's "MySQL" ServerTemplates contain scripts that will attach and initialize EBS Volumes to a Server at boot and runtime.

Table of Contents


  • 'actor' user role privileges
  • an EBS Volume that was attached to a Linux Server, but not initialized/formatted.


Perhaps you used the Attach Blank Volume action button to Attach an EBS Volume to an Instance.  But, before you can use an attached EBS Volume as a normal disk drive, you must first initialize or format it.


Note:  The following steps were tested on an instance running CentOS 5.2

  1. Go to the Volumes tab of the Server that has the unitialized/unformatted EBS Volume.  If you just attached the EBS Volume to the instance, you must wait for its status to be "attached" to the instance before attempting to initilize the volume.  If the volume still says "pending" you must wait a couple more minutes.
  2. SSH into the Server and run the following shell commands to initialize the EBS Volume:
    • fdisk /dev/sdj  (You must specify which mounted volume you want to format.
    • Enter m for a menu
    • Enter n to add a new partion
    • Enter p for a primary partition
    • Enter 1 for the first partion on the disk
    • Click 'Enter' to accept the default First Cylinder
    • Select 'Enter' to accept the default Last Cylinder
    • Enter w to write the partition table (You will be returned to the Unix shell)
    • mkfs.xfs -f /dev/sdj
      • If you do not have mkfs.xfs installed, you will need to install it using a command similar to the following:
        # yum install kmod-xfs xfsdump xfsprogs dmapi
    • mkdir /mnt/ebs
    • To test, you can type df -k to see the mounted devices. At this point, you will not see the file system that's on your EBS volume.
    • mount /dev/sdj /mnt/ebs
    • Run the test again using df -k but this time you should see the filesystem on your EBS volume with the correct mount point (e.g. /mnt/ebs).
  3. Close your SSH session.  You can now save data to the EBS Volume and take a backup, which will create an EBS Snapshot of the volume which can later be used to restore your volume's data on another instance.
You must to post a comment.
Last modified
16:45, 21 May 2013


This page has no custom tags.


This page has no classifications.



© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.