Nov 032009
 

Here’s another successful operation done on fantastic Linux OS that is a pure dream for other operating systems.

Situation: I have a virtual machine with 20 GB HDD, partitioned as follows:

95% ext3 on primary partition

5% swap on first partition of extended partition

I certainly can expand my hard disk, by setting the new size in VMware configuration… so I brought it to 60 GB… but then I have a problem, since I cannot use tools like gparted to extend the main partition since the swap is in the middle between the two.

What to do? Well, again Google has been a best friend.

Well done, well written, clear and… working!

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…