Wednesday, November 17, 2010

Linux LVM Notes

How to extend disk space of an existing file system in LVM, or How to configure LVM or create new volume group from command line, or Understand the maximum volume group size limitation.
How to create new Linux EXT3 file system in LVM with new hard disk by creating new logical volume?

Assuming a new IDE hard disk hooked up to Secondary-Slave IDE bus for the new logical volume / file system. Hence, the Linux device code will be /dev/hdd for this IDE hard disk, according to LANANA Linux Device List or the offline copy in /usr/src/linux-2.x/Documentation/devices.txt

1. Using the whole secondary-slave IDE hard disk for existing LVM volume group (called vg0 in my case) by creating the physical volume (PV):
pvcreate /dev/hdd

A similar message of this will be shown upon successful execution of pvcreate command:

pvcreate — physical volume “/dev/hdd” successfully created

2. Adding the new physical volume (PV) to volume group vg0, i.e. to extend the existing volume group size with new physical volume:
vgextend vg0 /dev/hdd

If no errors encounter while executing vgextend, a similar message of this will be seen:

vgextend — INFO: maximum logical volume size is 1023.97 Gigabyte
vgextend — doing automatic backup of volume group “vg0″
vgextend — volume group “vg0″ successfully extended

3. Create the new logical volume (LV) at 400MB (not fully utilize the whole IDE hard disk) to host the new EXT3 file system in question:
lvcreate -L 400M -n lvol1 vg0

Suppose lvcreate completed successfully, this similar message will be seen:

lvcreate — doing automatic backup of “vg0″
lvcreate — logical volume “/dev/vg0/lvol1″ successfully created

4. Now, create the new EXT3 file system on the new logical volume (LV) with 1% file system reserved block count:
mkfs -t ext3 -m 1 -v /dev/vg0/lvol1

Once the new EXT3 file system creation completed, you can examine the file system by executing

tune2fs -l /dev/vg0/lvol1

5. Create a mount point directory for the new EXT3 file system:
mkdir /mnt/newfs

6. It’s now ready to mount the new EXT3 file system:
mount -t ext3 /dev/vg0/lvol1 /mnt/newfs

To confirm that the new EXT3 file system has been mounted successful, type df -h

Reference and thanks to http://www.walkernews.net/2007/07/11/create-new-linux-ext3-file-system-in-lvm/

Tuesday, September 21, 2010

OpenSolaris SSH root

For openSolaris, we need to modify the role for the root user to enable root ssh .

### enable root ssh login ###
rolemod -K type=normal root

Saturday, September 18, 2010

HP UNIX TIPS

http://www.hpuxtips.es/?q=node/12

Friday, August 13, 2010

Sendmail

http://www.linuxjournal.com/article/5507

Monday, August 9, 2010

Adding timestamp for each line in nohup.out

http://blogs.sun.com/LetTheSunShineIn/entry/adding_timestamp_for_each_line

Saturday, August 7, 2010

To configure the newly added LUNS on RHEL:

To configure the newly added LUNS on RHEL:


# ls /sys/class/fc_host

host0 host1 host2 host3

fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l

echo "1" > /sys/class/fc_host/host0/issue_lip

echo "- - -" > /sys/class/scsi_host/host0/scan

echo "1" > /sys/class/fc_host/host1/issue_lip

echo "- - -" > /sys/class/scsi_host/host1/scan

echo "1" > /sys/class/fc_host/host2/issue_lip

echo "- - -" > /sys/class/scsi_host/host2/scan

echo "1" > /sys/class/fc_host/host3/issue_lip

echo "- - -" > /sys/class/scsi_host/host3/scan

cat /proc/scsi/scsi | egrep -i 'Host:' | wc -l

fdisk -l 2>/dev/null | egrep '^Disk' | egrep -v 'dm-' | wc -l


Alternatively, we can
run the re-scan-scsi script.

To scan new LUNs on Linux operating system which is using QLogic driver

You need to find out driver proc file /proc/scsi/qlaXXX.

For example on my system it is /proc/scsi/qla2300/0

Once file is identified you need to type following command (login as the root):



# echo "scsi-qlascan" > /proc/scsi/qla2300/0
# cat /proc/scsi/qla2300/0


Now use the script rescan-scsi-bus.sh new LUN as a device. Run script as follows:



# ./rescan-scsi-bus.sh -l -w


The output of ls -l /sys/block/*/device should give you an idea about how each device is connected to the system.


Thanks & Reference: http://lazysystemadmin.blogspot.com/2010/06/scan-and-configure-new-luns-on-redhat.html

Thursday, June 3, 2010

HP-UX : Processors and Core

Number of Processors:
#top
#ioscan -Cprocessor

To find out the core:
#echo "selclass qualifier cpu;info;wait;il" | cstm