Archive

Archive for the ‘Redhat’ Category

RHEL Security Patches

April 25, 2018 Leave a comment

yum updateinfo list –security |grep ‘^RHSA*’

Advertisements
Categories: Linux, Redhat, Uncategorized

Extending AWS Linux LVM partition

December 17, 2017 Leave a comment

This process was tested successfully on RHEL 6.4.

Suppose we have extended the volume size of a disk to 300G from 200G; note the current partition and VG size is 200G:

# lsblk /dev/xvdd
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvdd 202:48 0 300G 0 disk
└─xvdd1 202:49 0 200G 0 part
└─vg02-lvol1 (dm-2) 252:2 0 200G 0 lvm /test

First, we have to install package for your particular RHEL version:
cloud-utils-growpart

Pbone RPM Repo

Next, install the RPM:
rpm -ivh cloud-utils-growpart-0.27-10.el6.x86_64.rpm

  • # growpart /dev/xvdd 1
  • # reboot
  • # pvresize /dev/xvdd1
  • # lvextend -l +<free_extents> /dev/vg02/lvol1
  • # resize2fs /dev/vg02/lvol1

# lsblk /dev/xvdd
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvdd 202:48 0 300G 0 disk
└─xvdd1 202:49 0 300G 0 part
└─vg02-lvol1 (dm-2) 252:2 0 300G 0 lvm /test

If anyone knows how we can grow the partition and have it be recognized by the physical volume without a reboot, I’d love to hear it!

Hope this helps!

Categories: Linux, Redhat, Uncategorized

portmap dead but subsys locked

October 19, 2017 Leave a comment

I have seen this issue and my feeling is it is a result of vulnerability scanners knocking the portmap service that handles the registration of systems for remote NFS, autofs.

Symptoms you may see:
Could not mount a user’s home directory:

su: warning: cannot change directory to /home/<user>: No such file or directory
# rpcinfo -p <nfs_server>
rpcinfo: can’t contact portmapper: RPC: Remote system error – Connection refused
# showmount -e
mount clntudp_create: RPC: Port mapper failure – RPC: Unable to receive

Resolution:
On NFS server if you see this error:

# service portmap status
portmap dead but subsys locked
# ll /var/lock/subsys/portmap    # If file exists, it has to be removed
# rm /var/lock/subsys/portmap
# service portmap restart
# rpcinfo -p
# service nfs restart    # Needs to be restarted to register with portmapper

Now, you should be able to run “rpcinfo -p <nfs_server>” from the NFS clients and mount the shares.

 

Categories: Linux, Redhat, Uncategorized

Samba CIFS mounts and securing user password

October 15, 2017 Leave a comment

Adding the code blocks below to /etc/rc.local:

mount.cifs //<host1>/share /<mount_point> -o ro,credentials=/root/.cifs.<host1>,remount

Option “remount” prevents double mounting of the same share.

File .cifs.<hostname> contains:

user=<user>
password=<password>
domain=<domain>

Categories: Linux, Redhat, Uncategorized

RHEL 6 IGMPv3 setting

August 11, 2017 Leave a comment

Set following parameter in /etc/sysctl.conf file for the interface that is desired (e.g. bond0, eth0, etc.).

net.ipv4.conf.eth0.force_igmp_version=3
  • Reboot system
Categories: Linux, Redhat, Uncategorized

Linux testing disk speed with dd

April 21, 2017 Leave a comment

Best way is to use dd and try the following:

dd bs=1M count=256 if=/dev/zero of=test conv=fdatasync

“fdatasync” tells dd to write physically to disk before providing the output. Increase to 1024, 2048 if you want 1G or 2G file size. Bigger sizing will produce a more normalized speed.

Categories: Linux, Redhat

RHEL increasing size of LVOL after LUN expansion

March 6, 2017 Leave a comment

Quick steps (validated on RHEL 5.x) on expanding your lvol when the underlining LUN has been expanded.

Ensure first you have rescanned the scsi devices to pick up on the physical changes to the LUNs. Next, from multipath you should be able to see that the LUN indeed have been expanded. In this case, the new size is 3.5T, original size was 3.0T.

# multipath -ll

vgnetapp1 (3600a09803830344a503f464a4d302f41) dm-3 NETAPP,LUN C-Mode
size=3.5T features=’1 queue_if_no_path’ hwhandler=’0′ wp=rw

Next, the pv has to be resized:
# pvresize /dev/mapper/vgnetapp1

Now, resize the lvol:
# lvresize /dev/mapper/vgnetapp1-lvol1 -l +100%FREE

Finally, resize the underlying filesystem on the lvol:
# resize2fs /dev/mapper/vgnetapp1-lvol1

Expect this to take several minutes depending on the size of your LUN. Run “df -h” to see this operation has indeed increased the lvol and filesystem size. Note, you can run these commands while the LUN is mounted. No need to “umount” at all.

Categories: Linux, Redhat