Monday, December 30, 2013

Linux login issue - Can not login: Resource temporarily not available

Sometime we get following error while user login:

$su - username
Coud not login: Resource temporarily not available

Most of the times this is because of processes or number of files available to user is already used. So, could not arrange more files/processes to login, in this case we required to increase the limits for user in /etc/security/limits.conf (PAM module)

username        soft    nproc           3000
username        hard    nproc          4096
username        soft     nofile           6000
username        hard    nofile          8192


Set these values as per requirement else setting up these values higher may result in server inaccessible in case that particular uses all file descriptors, process and higher memory of server.

Monday, December 2, 2013

Linux Resize LUN Without Reboot

Try running following commands

Check OS using what devices for attached LUNs:

multipath -l

mpath5 (360060.......................) dm-15
[size=100G][features=1 queue_if_no_path][hwhandler=1 emc][rw]
\_ round-robin 0 [prio=0][active]
 \_ 1:0:0:14 sdb 66:192 [active][undef]
 \_ 0:0:0:14 sdc  8:224  [active][undef]
\_ round-robin 0 [prio=0][enabled]
 \_ 0:0:1:14 sdd 66:112 [active][undef]
 \_ 1:0:1:14 sde 67:176 [active][undef]

Rescan all paths:
echo 1 > /sys/block/sdb/device/rescan
echo 1 > /sys/block/sdc/device/rescan
echo 1 > /sys/block/sdd/device/rescan
echo 1 > /sys/block/sde/device/rescan

Then run:
       
partprobe
multipathd -k

resize map mpath5
If LVM is used, also required following:
#pvscan
Check Disk Changes detected under LVM:
#pvs
#vgscan
  Check VG Size is Increased:
#vgs
Now Extend the LV: 
#lvextend -L +G
Finally Extend the File System
#resize2fs
Thats it!!! 

Friday, February 8, 2013

Redhat Linux : Rollback RPMs

RPM Rollback for Redhat 5.x versions

1) Create a file /etc/rpm/macros and put following

cat >> /etc/rpm/macros
%_repackage_all_erasures 1

2) Add following at the end of /etc/yum.conf

echo "tsflags=repackage" >> /etc/yum.conf

After above entries, we can rollback rpms installed using yum

3) Now update system with single rpm or complete using

yum update

4) Lets say we had update rpms 1 hour, 2 month and 1 day ago and wants to remove all those then use following commands:

rpm --rollback "1 day ago"
rpm --rollback "1hour ago"
rpm --rollback "2 month ago"


Will be posting for Redhat 6.x version soon.......

Redhat Device Mapper Multipathing

                                           REDHAT DEVICE MAPPER MULTIPATH



                                  



1) DM Software Installation


yum install device-mapper-multipath


2) Initialize /etc/multipath.conf file


mpathconf --enable


3) Start multipath service

service multipathd start


4) If you do not want to use user friendly name


mpathconf --enable --user_friendly_names n


5) Ignoring Local Disks when generating Multipath devices


multipath -v2 (shows local disk, /dev/sda, in the multipath map)


create: SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1 undef WINSYS,SF2372 size=33 GB features="0" hwhandler="0" wp=undef `-+- policy='round-robin 0' prio=1 status=undef
- 0:0:0:0 sda 8:0 [---------



device-mapper ioctl cmd 9 failed: Invalid argument device-mapper ioctl cmd 14 failed: No such device or address

create: 3600a0b80001327d80000006d43621677 undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef
- 2:0:0:0 sdb 8:16 undef ready running `- 3:0:0:0 sdf 8:80 undef ready running



create: 3600a0b80001327510000009a436215ec undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef
- 2:0:0:1 sdc 8:32 undef ready running `- 3:0:0:1 sdg 8:96 undef ready running



In order to prevent the device mapper from mapping /dev/sda in its multipath maps, edit blacklist section in /etc/multipath.conf

blacklist {

wwid SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1

}


6) After updating file reload the changes


service multipathd reload


7) Run following command to remove multipath device

multipath -f SIBM-ESXSST336732LC____F3ET0EP0Q000072428BX1


8) Now check if device removed from multipath


multipath

create: 3600a0b80001327d80000006d43621677 undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef
- 2:0:0:0 sdb 8:16 undef ready running `- 3:0:0:0 sdf 8:80 undef ready running


create: 3600a0b80001327510000009a436215ec undef WINSYS,SF2372 size=12G features='0' hwhandler='0' wp=undef `-+- policy='round-robin 0' prio=1 status=undef
- 2:0:0:1 sdc 8:32 undef ready running `- 3:0:0:1 sdg 8:96 undef ready running


...

....

...


9) Add storage that is not supported by default as a know multipath device lets say "Vendor is HP, Product Open-V"

To add information about the HP Open-V series the entry looks like this, where %n is the device name. Add following in /etc/multipath.conf file

devices {

device {

vendor "HP"

product "OPEN-V."

getuid_callout "/lib/udev/scsi_id --whitelisted --device=/dev/%n"

}

}


To be continued..............