Popular Posts

Monday, 2 September 2013

Redhat Linux - How to for GFS Filesystems

You can use either of the following formats to create a clustered GFS file system:
#gfs_mkfs -p lock_dlm -t ClusterName:FSName -j Number BlockDevice
#mkfs -t gfs -p lock_dlm -t LockTableName -j NumberJournals BlockDevice

You can use either of the following formats to create a local GFS file system:
#gfs_mkfs -p lock_nolock -j NumberJournals BlockDevice
#mkfs -t gfs -p lock_nolock -j NumberJournals BlockDevice

At each node, mount the GFS file systems. For more information about mounting a GFS file
Command usage:
mount BlockDevice MountPoint
mount -o acl BlockDevice MountPoint
The -o aclmount option allows manipulating file ACLs. If a file system is mounted without the -o acl mount option, users are allowed to view ACLs (with getfacl), but are not allowed to set them (with setfacl).

Formatting the logical Volume
#gfs_mkfs -p lock_dlm -t alpha:mydata1 -j 8 /dev/vg01/lvol0

The gfs_jadd command must be run on mounted file system, but it only needs to be run on one node in the cluster. All the other nodes sense that the expansion has occurred.

#lvextend -L +80G /dev/vgcl_gfs_san_eos/vol01_lv
#gfs_grow -v /dev/vgcl_gfs_san_eos/vol01_lv /db/eospr1/vol01

How To Increase GFS and LVM Size

It is assumed that you have configured the storage so that all systems in the cluster can see it prior to continuing through these steps. If you have not, then please see either the iSCSI or SAN How To.

################################################################
LVM Configuration

1. Initialize LUNs with pvcreate..

iSCSI/non-multipath:

pvcreate /dev/sd SAN/multipath:

pvcreate /dev/dm-<0-9> 2. Add a device into the Volume group

vgextend vgcl_gfs__

3. Sync the LVM Metadata
clvmd -R

4. Extend the size of the Logical Volume

lvextend -L +100G /dev/vgcl_gfs__/gfslv

[root ~]# lvextend -L +73G /dev/vgcl_gfs_san_cus/cuslv

Extending logical volume cuslv to 85.00 GB
Logical volume cuslv successfully resized5. Sync the LVM Metadata

clvmd -R

#######################################################################
GFS Configuration

6. Grow the existing GFS file system into the additional space

gfs_grow -v (device|mount)

[root ~]# gfs_grow -v /dev/mapper/vgcl_gfs_san_cus/cuslv /gfs/cus
Preparing to write new FS information...
Done.
Device has grown by less than 100 blocks.... skipping

This TEST will not do anything, but tell you what device and mount point to use.

[root ~]# gfs_grow -Tv /dev/mapper/vgcl_gfs_san_cus/cuslv /gfs/cus

Scanning SCSI DISKS in Redhat Linux

Scanning SCSI DISKS in Redhat Linux


SCAN AND CONFIGURE NEW LUNS on RHEL 5 and RHEL 6

If you have 4 fc ports on which you have assigned the storage luns.
Then you need to run the below for loop to scan the LUNS on all the 4 ports.

for i in host1 host2 host3 host0
> do
> echo "1" > /sys/class/fc_host/$i/issue_lip
> echo "- - -" > /sys/class/scsi_host/$i/scan
> done
After this you can run fdisk -l or multipath -ll to see the new luns. Once the new luns are visible , you can use the luns using LVM or raw paritioning.

IF you want to rescan the disk lun then you can run the below command.


echo 1 > /sys/block/sda/device/rescan
echo 1 > /sys/block/sdb/device/rescan
echo 1 > /sys/block/sdc/device/rescan
echo 1 > /sys/block/sdd/device/rescan