Linode.com Forum Forum Index Linode.com Forum
Linode Community Forums
 


New Feature - Disk Resizing Up and Down

Click here to go to the original topic

 
       Linode.com Forum Forum Index -> Linode.com Announcements
Author Message
caker



Joined: 15 Apr 2003
Posts: 2386
Location: Galloway, NJ

Posted: Sat Nov 08, 2003 2:33 pm    Post subject: New Feature - Disk Resizing Up and Down  

I just released a new feature for resizing disk images both larger and smaller.

For resizing larger, the only change was that if you resize a disk image labeled as swap, it will delete and recreate the swap image. Previously it would resize the Image itself, but not re-make the swap within.

For resizing smaller, it will only work on ext2/ext3 and swap disk images. Other image types it will abort. Resizing ext2/ext3 is non-destructive -- it will attempt to resize the filesystem within and abort out if there isn't enough free space. Aborting leaves your disk image untouched, so it is safe to "try" different sizes if you're really trying to get the disk image as small as possible. We're using the "resize2fs", part of the e2fsprogs package.



Here are some of the results of my testcases

Test Results

Initial Image: RedHat 9.0 Small, 1500 MB

Code: Filesystem            Size  Used Avail Use% Mounted on
/dev/ubda             1.5G  875M  576M  61% /

Resize from 1500 to 1000

After Resize:
Code: Filesystem            Size  Used Avail Use% Mounted on
/dev/ubda             987M  842M  135M  87% /


Resize from 1000 to 900

After Resize
Code: Filesystem            Size  Used Avail Use% Mounted on
/dev/ubda             887M  842M   36M  96% /


Resize from 900 to 800

Errored out with "No space left on device". Remained 900 MB. File unmodified on host. Booted correctly, df reported:
Code: Filesystem            Size  Used Avail Use% Mounted on
/dev/ubda             887M  842M   36M  96% /


Resize from 900 to 1500

After resize
Code: Filesystem            Size  Used Avail Use% Mounted on
/dev/ubda             1.5G  842M  624M  58% /

Notice the "Used" space is less after the first resize. I'm guessing we reclaim some space after running fsck.ext3, and perhaps starting a new journal.


Thanks, and Enjoy!
-Chris

PS - I'd appreciate it if some of you want to test this on scratch disk images and report the outcome here.
Back to top  
 
       Linode.com Forum Forum Index -> Linode.com Announcements
Page 1 of 1