1) Once Newly created LUN is presented to the RHEL5 server, run the c ommand to scan the SCSI bus:
# echo "- - -" >/sys/class/scsi_host/host#/scan
The “- – -” is used for Bus Channel , for Target id and Lun .
2.Check the /var/log/messages file to find the device name , in example the secondary disk device name is sdb
PartitioningAssuming that you are using
fdiskto partition your disk, and that the disk is identified by your system as sdb (the second scsi device), then the following steps should allow you to create the necessary partition:
1. fdisk /dev/sdb
this will launch the fdisk application. As with all usage of the fdisk command, I must remind you that any changes you make here will remove access to data you have on the
disk you pass as the parameter to this command.
pfor primary partition
1for the first partition
- accept the defaults for the start and end blocks (ie maximum size)
tto change the type
- enter the code
8efor Linux LVM
wto write the changes to disk and exit the application
LVM Physical Volume Creation
Whether or not you chose to partition the new disk, you will need to add it to the LVM configuration as a PV. To do this issue the command
(orIf you want to see the before and after effects issue the command
pvcreate /dev/sdbif not partitioned)
pvdisplaybefore and after the pvcreate command shown above
Volume Groupsuse of this command depends on whether or not you wish to add the new PV to an existing LVM Volume Group (VG) or a new VG.
To create a new VG: <<<TBD>>>(notes about different VG's in the same LV)<<<TBD>>>
vgcreate VolGroupXX /dev/sdb1
(or /dev/sdb if not partitioned), where the parameter VolGroupXX is the usual format for Volume Group named in RedHat, but any name meaningful to you as the system administrator can be used, with the XX being a 2 digit number.To extend an existing VG:
vgextend VolGroupXX /dev/sdb1
vgextend vgname /dev/sdb1
(or /dev/sdb if not partitioned), where the paremeter VolGroupXX is the name of the existing Volume Group.as above, before and after changes can be observed by running the vgscan and vgdisplay commands before and after the create or extend commands
Logical VolumesTo increase the size of the (or create a new) LVM Logical Volume (LV)
To create a new LV:
lvcreate -l 100%FREE -n /dev/VolGroupXX/LogVolYY /dev/VolGroup00
lvcreate -l 6335 -n /dev/vgname/lvname ( Specify the full space)
where the following parameters are used:-l 100%FREE - uses all the available space in the Volume Group. Can be changed for -L nn[KMGTPE] for nn Kilo, Mega, Giga, Tera, Peta, Exa bytes -n /dev/VolGroupXX/LogVolYY - this is the name of the Logical Volume expressed as a path. With XX & YY as 2 digit numbers. This naming convention can be changed to suit your own needs but follows the default RedHat configuration. /dev/VolGroupXX - is the VG to take extents from for this LV.
To extend an existing LV:
lvextend -l +100%FREE /dev/VolGroupXX/LogVolYY /dev/sdb1
where the following parameters are used:-l +100%FREE - extends the LV by all the available space in the VG. Can be changed as before for absolute values using -L. The preceding + means extend the current value by this much. Omitting the + means set the value to this much - if you pick the wrong value, you can actually shrink the LV!, which would be fatal if the file system has not yet been resized. /dev/VolGroupXX/LogVolYY - this is the LV you wish to extend /dev/sdb1 - this is teh PV you wish to use to extend the LV.
Mount the partition wherever you want to map it.
mount /dev/vgname/lvname /path/tomap
Add it in fstab entries for permanent Access.