################################################################################ Console access cannot get control ctrl-k-q ctrl-q-k see console history ctrl-Page[Up|Down] release console (get out of it - get mouse control back) ctrl-alt ################################################################################ Scan bus scsi-rescan multipath -ll pvs vgs lvs ls -l /dev/mapper ls -l /sys/block #vi /etc/multipath.conf ##vi lvm.conf #pvcreate /dev/mpath/mpath1 #pvs #ll /dev/mpath/mpath1 ################################################################################ USER: no expire passwords chage -I -1 -m 0 -M 99999 -E -1 oracle chage -I -1 -m 0 -M 99999 -E -1 userx ################################################################################ USER: no login: no interactive login except if on a console put this line in the .bashrc [[ $SSH_TTY != "" ]] \ && echo "Warning: Login to this account is disabled" \ && exit ################################################################################ Create an LV and FS with our newest standards vgcreate vg02 /dev/sdX lvcreate -L 512M -n lv_ora vg02 mkfs -t ext3 /dev/vg02/lv_ora tune2fs -c 0 -i 0 /dev/vg02/lv_ora mkdir /ora cat << EOF >> /etc/fstab /dev/vg02/lv_ora /ora ext3 defaults 1 2 EOF mount /ora ################################################################################ Physical (due to multipathing): pvcreate /dev/mapper/mpath# vgcreate vg0# /dev/mapper/mpath# VM: pvcreate /dev/sd[a-z] vgcreate vg0# /dev/sd[a-z] vgdisplay -v vg0# ################################################################################ Register client into satellite Rename the short hostname in Sat then rhncfg-client [verify | get] IF system is not registered: rhnreg_ks --force --profilename myhost --activationkey \ 1-development-vm,unixtech_all_internal or rhn_register #walks you through a number of screens ################################################################################ Reload a loaded system via PXE/kickstart/satellite cobbler system edit --name=myhost:2 --netboot-enabled=1 # If the server is not in cobbler, then add it vi cobblersystemadd In VSphere Boot into BIOS (check BIOS in VM guest config, options tab) then when in BIOS mode, select network as first item Once you are done with the reload, change the BIOS to boot network last so we don't accidentally reload a system (if someone accidentally does another reset on the client in satellite). ################################################################################ Update a config file (via a channel) Exampe: sendmail.cf rhncfg-client list | grep mail rhncfg-client get /etc/mail/sendmail* service sendmail restart #will create new sendmail.cf via m4 sendmail.mc ################################################################################ REMOVE/DELETE a sd disk device echo 1 > /sys/block/sd${LETTER}/device/delete ################################################################################ Clear out ASM info on a disk to make it look like ASM never owned/used it (Removing the "private region") DISK_PARTITION=/dev/sdd dd if=/dev/zero of=$DISK_PARTITION bs=1024 count=100 ################################################################################ #============================================================= #IF YOU NEED to add virtual IPs: # # NOTE: If in the DMZ or CAN, you'll need to add the VIP(s) # to the firewall rules. # cd /etc/sysconfig/network-scripts #where INST is the number you want (as in "1" or "2") INST=1 cp ifcfg-eth0 ifcfg-eth0:$INST #change the DEVICE to $INST #change the IP to the new VIP vi ifcfg-eth0:$INST service network restart **OR** VIP=10.x.x.x ifconfig en0:$INST $VIP netmask $NETMASK ################################################################################ # Create a new filesystem and resize to max # # bkup DISK=/dev/sdX # VG=orabkupvg LV=lv_ora_bkup FS=/ora/bkup vgcreate $VG $DISK lvcreate -L 100G -n $LV $VG mkfs -t ext4 /dev/$VG/$LV tune4fs -c 0 -i 0d /dev/$VG/$LV mkdir -p $FS cat << EOF >> /etc/fstab /dev/$VG/$LV $FS ext4 defaults 1 2 EOF mount $FS chown oracle:dba $FS # set to size requested, there may be multiple filesystems, per instance ADDSIZE=$(vgs --units m $VG | grep -w VG | awk '{print $NF}') lvresize -L +${ADDSIZE} $VG/$LV resize4fs -p /dev/$VG/$LV df -h $FS ################################################################################