Mar 292008
 

One of the things I like of Linux is that despite I’m working with it since 1994 I never end learning part of it.

Today my need was the following: I dd a 20 Gb backup onto a 40 Gb HDD and it worked smoothly, but problem is that filesystem on first partition was 20 Gb while partition was 40 Gb (more or less).

Therefore my need was to extend my filesystem to match partition size to benefit of the additional disk space offered by new HDD size. Googling a bit, I discovered a command that did the magic very smoothly: resize2fs.
All I needed to do is launching command followed by device where filesystem needs to be resized, no matter is filesystem is mounted or not, as follows: resize2fs /dev/hda1

Output has pleasantly been the following:

resize2fs 1.40-WIP (14-Nov-2006)
Filesystem at /dev/hda1 is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 3
Performing an on-line resize of /dev/hda1 to 8835742 (4k) blocks.
The filesystem on /dev/hda1 is now 8835742 blocks long.

Useless to say that AFAIK on Windows this is a dream without costly softwares, and even then…

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)