Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Forum locked  This topic is locked, you cannot edit posts or make further replies.
Author Message
PostPosted: Sat Nov 08, 2003 3:33 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
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.


Top
   
Display posts from previous:  Sort by  
Forum locked  This topic is locked, you cannot edit posts or make further replies.


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group