Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an instance-store EC2 instance with Ubuntu 11.04 i386. At present my disk partition looks like this:

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            9.9G  529M  8.9G   6% /
none                  828M  116K  828M   1% /dev
none                  833M     0  833M   0% /dev/shm
none                  833M   40K  833M   1% /var/run
none                  833M     0  833M   0% /var/lock
/dev/xvda2            147G  188M  140G   1% /mnt

Can I convert /mnt (/dev/xvda2) to ext4? If yes, can you please guide me or point me to the right resource.

Thanks

share|improve this question
    
What filesystem is it right now? Do a cat /etc/mtab to find out. –  mailq Sep 29 '11 at 21:34
    
At present its ext3 - /dev/xvda2 /mnt ext3 rw 0 0 –  Gautam Sep 29 '11 at 21:50
    
Then just edit /etc/fstab and change ext3 to ext4. That's all. –  mailq Sep 29 '11 at 21:58
add comment

2 Answers 2

up vote 10 down vote accepted

You can convert /mnt from ext3 to ext4 in place (after backing up data for safety):

dev=/dev/xvda2
sudo umount $dev
sudo tune2fs -O extents,uninit_bg,dir_index $dev
sudo fsck -fv $dev
sudo mount $dev

You don't have to edit /etc/fstab on Ubuntu 11.04 for EC2 since the AMI lists that file system as auto.

Reference: https://help.ubuntu.com/community/ConvertFilesystemToExt4

share|improve this answer
add comment
  1. Backup /mnt/
  2. umount /mnt/
  3. mkfs.ext4 /dev/xvda2
  4. mount /mnt/
  5. Restore your files
share|improve this answer
    
Thanks, I will try it now. –  Gautam Sep 29 '11 at 21:50
    
Thanks it works. Even mkfs -t ext4 /dev/xvda2 works fine. –  Gautam Sep 29 '11 at 22:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.