1

I just created a brand new EC2 instance based off the new Fedora 15 EBS backed image. I was able to successfully launch and SSH into my EBS based instance. However the default size is 10 GB and I would like to resize to 25 GB. I then took the following steps:

  1. Took a snapshot of the EBS volume attached to my new Fedora 15 instance
  2. Created a new EBS volume that is 25 GB based off my snapshot
  3. Powered down my Fedora 15 instance and detached the existing 10 GB EBS volume
  4. Attached my new 25 GB EBS volume to my instance and started the instance

I am able to log back into my Fedora 15 instance based off the new 25 GB EBS volume. Now is where I run into a problem.

Running df -h / only shows 10 GB, so I attempted to run "resize2fs /dev/sda1" to resize the filesystem. However I get a "No such file or directory while opening /dev/sda1" warning.

When I cat /etc/fstab I don't see /dev/sda1. I see the following:

LABEL=79d3d2d4    /         ext4    defaults         1 1
none       /dev/pts  devpts  gid=5,mode=620   0 0
none       /dev/shm  tmpfs   defaults         0 0
none       /proc     proc    defaults         0 0
none       /sys      sysfs   defaults         0 0

Why is there no /dev/sda1? On my Fedora 14 image which is based off an instance store, I see in fstab that the root file system is mapped to /dev/sda1. Have there been changes in Fedora 15?

How can I got about resizing the root file system to fill the new EBS volume?

Any help would be greatly appreciated! Thanks for your time!

1 Answer 1

1

It would probably help to know the file system, but I'll make a suggestion anyway.

I presume that you got the device path from df.

resize2fs may (depending on filesystem and resize2fs version) have trouble reading some mount points when they are mounted (and it is better to resize without being mounted). I would suggest the following:

  1. Create a new 25GB EBS volume from your root snapshot
  2. Attach it to your running instance (not as the root volume)
  3. Do NOT mount the volume (just keep it as a device)
  4. Resize the filesystem on the unmounted volume
  5. Stop your instance
  6. Detach both EBS volumes (root and the new one)
  7. Attach the new EBS volume as your root

Additionally, it may be worth mentioning that /dev/sda1 is probably a symlink to /dev/xvda1.

2
  • Thanks for the tip, but I am unable to execute step 4. When I try and run 'resize2fs /dev/sda2' (which what I attached the new volume as) I get No such file or directory while opening /dev/sda2.
    – AAC
    Jul 22, 2011 at 18:33
  • WOW! I ran resize2fs /dev/xvda1 and that did the trick! THANK YOU VERY MUCH!
    – AAC
    Jul 22, 2011 at 22:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .