Thursday, March 22, 2012

Extending ext3 filesystems

Ok, so in the above post we created a couple of filesystems on a couple of luns. But we created them at 10Meg each, hardly useful in today's world. We need to extend that to say 5gig, much more useful. Another scour of the Internet turns up little useful. Let's do it here, again Redhat ES4.8. Not you must umount the filesystem first. Also note, if you try the resize2fs first it will tell you to run the e2fsck first, so do that part first as shown below.


[root@somesystem /]# e2fsck -f /dev/testvg1/lvol0
e2fsck 1.35 (28-Feb-2004)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/testvg1/lvol0: 159/3072 files (1.9% non-contiguous), 10395/12288 blocks
[root@somesystem /]# resize2fs -p /dev/testvg1/lvol0
resize2fs 1.35 (28-Feb-2004)
Resizing the filesystem on /dev/testvg1/lvol0 to 5255168 (1k) blocks.
Begin pass 1 (max = 640)
Extending the inode table     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/testvg1/lvol0 is now 5255168 blocks long.

[root@somesystem /]# mount /dev/testvg1/lvol0 /vg1
[root@somesystem /]#

No comments:

Post a Comment