viernes, 6 de junio de 2014

AWS: Convert root volume to XFS

By default, root volume in Amazon Linux instances uses EXT4 filesystem. But maybe you want to use another one, for example XFS. With next procedure you'll be able to convert default root volume filesystem of an existing instance to XFS. For our example, we've an instance named MyInstance using default Amazon Linux distribution:

After login, as you can see default root filesystem device (/dev/sda1 | /dev/xvda1) is EXT4:

Here is suggested steps to successfully achieve the filesystem conversion:
  • Login to the instance and become root
  • Install XFS utils: yum install xfsprogs xfsprogs-devel xfsdump
  • Stop the instance
  • Create a snapshot of root volume

  • Create a new volume from the snapshot. Make sure you don´t modify size and select same availability zone where original root volume of instance is hosted

  • Start the instance and wait until become available. After that, login to the instance and become root
  • Attach new volume as a secondary volume. By default, /dev/sdf device will be selected. This device is mapped as /dev/xvdf in modern kernels. Run dmesg command to review your kernel successfully detect the new attached volume

  • Install Development Tools: yum groupinstall 'Development Tools'
  • Download Fstransform toolkit from here
  • Uncompress, configure, compile and install Fstransform toolkit

  • Now, run: fstransform /dev/xvdf xfs
  • Previous command will convert /dev/xvdf from original EXT4 filesystem to XFS. Process will take time, depends on volume size. Be patient and make sure everything is correctly done. fstransform will provide detailed information about the process. Make sure everything is correctly done. 

  • Label /dev/xvdf device as '/'. Just run: xfs_admin -L \/ /dev/xvdf
  • Create a mountpoint directory, for example /xfs, and mount /dev/xvdf in /xfs directory. Edit fstab file associated to the new XFS volume (/xfs/etc/fstab) and make sure / is associated to volume labeled / and xfs filesystem is configured for root mountpoint

  • Stop the instance
  • Detach original root volume
  • Detach XFS volume
  • Attach XFS volume as root volume. Make sure you specify same device associated to the original root volume (for Amazon Linux instances usually is /dev/sda1
  • Start the instance
Now, your instance should start. Login and verify root volume now is XFS

If there is any issue during instance startup, review System Log in AWS EC2 web console. Useful information for troubleshooting will be provided (if required).

11 comentarios:

Sathya G dijo...
Este comentario ha sido eliminado por el autor.
Sathya G dijo...

I am a regular reader of your blog. the blog is very interesting and will be much useful for us.
Salesforce training in chennai

Shaakshi dijo...

Thank you for sharing such a nice blog with us. I would like to suggest your blog in my dude circle. please keep on updates. Please keep on updating...
Car Wash Services in Mumbai

Sathya G dijo...

This post is much helpful for us. This is really very massive value to all the readers and it will be the only reason for the post to get popular with great authority.
Cloud Computing Training in Chennai

Shalini dijo...

Superb. I really enjoyed very much with this article here. Really it is an amazing article I had ever read. I hope it will help a lot for all. Thank you so much for this amazing posts and please keep update like this excellent article.thank you for sharing such a great blog with us. expecting for your.
Digital Marketing Company in India
seo Company in India

Abiya Carol dijo...

Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

digital marketing course in chennai
software testing training in chennai

Philips Huges dijo...

Wonderful blog.. Thanks for sharing informative Post. Its very useful to me.

Installment loans
Payday loans
Title loans

sandhosh dijo...

blog is nice and much interesting which engaged me more.Spend a worthful time.keep updating more.
SEO Company in India
SEO Services in India
SEO Companies in India
SEO Company India
SEO Services India
SEO Companies India

buddy vino dijo...

I have also gone through your other posts too and they are also very much appreciate able and I'm just waiting for your next update to come as I like all your posts...
SAP MM Training in Chennai

Gagana Vaijayati dijo...

Thanks for the informative article.This is one of the best resources I have found in quite some time.Nicely written and great info.I really cannot thank you enough for sharing.

Herbalife in Chennai
Wellnesscentres in Chennai
Weight Loss in Chennai
Weight Gain in Chennai

saimouni dijo...

The knowledge of technology you have been sharing through this post is very much helpful to develop a new idea. hereby I also want to share this.
Python training in bangalore
Python course in pune
Python training in bangalore