«

»

Apr 24

Creating and resizing file systems on RedHat Release 5.2

First,  always use logical volume manager.  You must create a filesystem before resizing it.  Since most advanced servers have hardware RAID, there is really no reason to have extra fault tolerance at the file system level.  Thus, do not create the journaling file system unless you are on a device with no hardware and firmware controlled RAID and/or have only 1 physical disk installed.  I use HP servers that come with Compaq’s advance disk controllers and at minimum, two physical disks.  Always use built-in RAID 1 unless you absolutely need the extra disk space (and have more than 3 disks), in which case use RAID 5.  Create and ext3 file system.

Create the files system using commands in this order: pvcreate, vgcreate, lvcreate, mkfs.ext3 and finally fsck.ext3.   You can use the man page for each command to get the syntax and arguments you’ll need.  However, for those who just need it real simple, on a HP Compaq server with built-in RAID controller, to create a new volume group called “vg00”, and a 4 Gb logical volume called “usr”, log in as root and type:

# pvcreate -f /dev/cciss/c0d1

# vgcreate -f vg00 /dev/cciss/c0d1

# lvcreate -L 4000 vg00 -n lusr

# mkfs.ext3 /dev/vg00/lusr

# fsck.ext3 /dev/vg00/lusr

Now, if you didn’t size /usr properly and want to make it 8Gb, type:

# lvcreate -L 8000 vg00 -n lusr

# resize2fs /dev/vg00/lusr

Leave a Reply