Skip to main content

Posts

Showing posts with the label Red Hat

How to add or Increase a File System in Red Hat

1) Verify Multipath Devices in order to know the last one  [root@unixaddiction ~]# multipath -ll mpathd (360060e80139cfc0050209cfc00000994) dm-3 HITACHI,OPEN-V size=650G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   |- 11:0:0:2 sdd 8:48  active ready running   `- 12:0:0:2 sdi 8:128 active ready running mpathc (360060e80139cfc0050209cfc00000993) dm-4 HITACHI,OPEN-V size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   |- 11:0:0:1 sdc 8:32  active ready running   `- 12:0:0:1 sdh 8:112 active ready running mpathb (360060e80139cfc0050209cfc00000992) dm-6 HITACHI,OPEN-V size=400G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   |- 11:0:0:0 sdb 8:16  active ready running   `- 12:0:0:0 sdg 8:96  active ready running mpathi (360060e80139cfc005

HOW TO INCREASE SPACE IN A VOLUME GROUP AND LOGICAL VOLUME

HOW TO INCREASE SPACE IN A VOLUME GROUP AND LOGICAL VOLUME 1.-)If you are using multipath, you can run the command below in order to know what are the devices mapped #multipath -ll mpathd (360060e80139cfc0050209cfc00000802) dm-2 STORAGE size=650G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   |- 11:0:0:2 sdd 8:48  active ready running   `- 12:0:0:2 sdg 8:96  active ready running mpathc (360060e80139cfc0050209cfc00000801) dm-4 STORAGE size=500G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   |- 11:0:0:1 sdc 8:32  active ready running   `- 12:0:0:1 sdf 8:80  active ready running mpathb (360060e80139cfc0050209cfc00000800) dm-3 STORAGE size=400G features='1 queue_if_no_path' hwhandler='0' wp=rw `-+- policy='round-robin 0' prio=1 status=active   |- 11:0:0:0 sdb 8:16  active r

HOW TO RECOVER A FILE DELETED WITHOUT A BACKUP

Recover deleted files with lsof Every process on the system has a directory here with its name on it, inside of which lies many things -- including an fd ("file descriptor") subdirectory containing links to all files that the process has open. Even if a file has been removed from the filesystem, a copy of the data will be right here: /proc/ process id /fd/ file descriptor $ ls -l myfile -rw-r--r-- 1 jimbo jimbo 114383 Oct 31 16:14 myfile $ stat myfile File: `myfile' Size: 114383 Blocks: 232 IO Block: 4096 regular file Device: 341h/833d Inode: 1276722 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1010/ jimbo) Gid: ( 1010/ jimbo) Access: 2006-10-31 16:15:08.423715488 -0400 Modify: 2006-10-31 16:14:52.684417746 -0400 Change: 2006-10-31 16:14:52.684417746 -0400  REMOVE NOW $ rm myfile $ ls -l myfile ls: myfile: No such file or directory $ stat myfile stat: cannot stat `myfile': No such file or directory $ AN

BTRFS File System on Red Hat

BTRF FILE SYSTEM ON RED HAT 1.-CREATING A BTRF FILE SYSTEM M mkfs.btrfs / dev / device   # mkfs.btrfs / dev / sdc1     2.-MOUNTING A BTRF FILE SYSTEM   mount / dev / device / mount-point   # mount / dev / sdc1 / btrfstest   3.-RESIZING A BTRF FILE SYSTEM    You can increase the btrs file system in this case +200M   btrfs filesystem resize amount / mount-point   #btrfs filesystem resize +500M /btrfstst   Resize '/btrfstest' of '+500M'    4.-SHRINKING A BTRFS FILE SYSTEM btrfs filesystem show / mount-point + devid 1 size 1.00GiB used 224.75MiB path /dev/vda devid 2 size 400.00MiB used 204.75MiB path /dev/vdb devid 3 size 2.00GiB used 8.00MiB path /dev/vdc devid 4 size 3.00GiB used 8.00MiB path /dev/vdd btrfs filesystem resize devid : amount /mount-point   # btrfs filesystem resize 2:300M /btrfstest  Resize '/btrfstest' of '2:300M'  You has reduced the file system to 300M, you wi

How to Reset the Root Password of RHEL-7 / systemd

1) Boot your system and wait until the GRUB2 menu appears. 2) In the boot loader menu, highlight any entry and press e . 3) Find the line beginning with linux. At the end of this line, append the following: init=/bin/sh Or if you face a panic, instead of "ro" change to "rw" to sysroot as example below: rw init=/sysroot/bin/sh 4) Press F10 or Ctrl+X to boot the system using the options you just edited. Once the system boots, you will be presented with a shell prompt without having to enter any user name or password: sh-4.2# 5) Load the installed SELinux policy: sh-4.2# /usr/sbin/load_policy -i 6) Execute the following command to remount your root partition: sh4.2# mount -o remount,rw / 7) Reset the root password: Raw sh4.2# passwd root 9) Reboot the system. From now on, you will be able to log in as the root user using the new password set up during this procedure.  

How to tie a system to a specific update Red Hat

1.Update Subscription Manager Package, validate first that system is registered   #yum -y update subscription-manager* 2.-Delete the Yum Cache   rm –rf /var/cache/yum/* 3.-Clean with command to be sure that it was cleaned correctly #yum clean all 4.-Set the release to tie teh Red Hat OS, where  you are working to the specific release to avoid to update for example from 6.6 to 6.8 Stable in this case.   These is usable if you need to have support and the application is only supported in a specific release #subscription-manager release --set=6.7 --proxy=http://<ipaddress_proxy>:8080 --proxyuser=<proxyuser> -proxypass=<proxypassword> or if you have Access directly to internet #subscription-manager release --set=6.7 5.-Update the OS   yum -y update    

How to break a bonded network interface red hat

1.- Bonding device called bond0 which aggregated by eth0 and eth1 # ifconfig bond0     Link encap:Ethernet  HWaddr 44:a8:42:5d:6d:5d           inet addr:192.168.1.51  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::5054:ff:fe4d:9004/64 Scope:Link           UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1 eth0      Link encap:Ethernet  HWaddr 44:a8:42:5d:6d:5d           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1 eth2      Link encap:Ethernet  HWaddr 44:a8:42:5d:76:29           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1           RX packets:6 errors:0 dropped:0 overruns:0 frame:0 # cat /proc/net/bonding/bond0 Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009) Bonding Mode: fault-tolerance (active-backup) Primary Slave: em1 (primary_reselect always) Currently Active Slave: em1 MII Status: up MII Polling Interval (ms): 50 Up Delay (ms): 0 Down Delay (ms): 0 Slave Interface: eth0 MII Status: up Speed: 10000

HOW TO INSTALL APACHE 2.4 on Red Hat 6

1.- We will need to enable the following Repository rhel-server-rhscl-6-rpms   server1# subscription-manager repos --enable rhel-server-rhscl-6-rpms     If you do not have internet Access and you are using a proxy you will need to  set the proxy,before activate the repository.       server1# subscription-manager repos --enable=rhel-server-rhscl-6-rpms --proxy=192.1.1.3 --proxyuser=user1 --proxypass=password365   2.-Proceed to install the package   server1# yum install httpd24-httpd           After finishing we have installed Apache 2.4 with all the dependencies.   3.- Finally you can install the other packages  that you need separately as :   httpd24-mod-auth httpd24-mod-ldap httpd24-mod-sesiĆ³n httpd24-mod-ssl   Depending of the application you will need to install openssl (n order to have security socket layer)   4.- Now you can start the apache 2.4   # service httpd24-httpd start     Validate errors in the log

HOW TO CHANGE HOSTNAME RED HAT LINUX

HOW TO CHANGE HOSTNAME RED HAT LINUX 1.-Validate Hostname and host file that you need to change #hostname rhel #cat /etc/hosts 127.0.0.1  localhost 192.168.1.13  rhel 2.-Edit the following file in order to change HOSTNAME #vi /etc/sysconfig/network NETWORKING=yes HOSTNAME=TEST GATEWAY=192.168.1.1 3.-When you are ready and you save the information you will need to edit the hosts file #vi /etc/hosts 127.0.0.1  localhost 192.168.1.13  test 4.- Finally you will need to restart de network services #service network restart #hostname test

RHEL 4.X 5.X 6.X Bond that is going between two switches

            When using a pair of redundant switches how the bond be configured to ensure maximum availability     # vi /etc/sysconfig/network-scripts/ifcfg-bond0 DEVICE=bond0 BOOTPROTO=static IPADDR=192.168.0.2 NETMASK=255.255.255.0 ONBOOT=yes BONDING_OPTS="mode=1 arp_ip_target =192.168.0.1 arp_interval =1000" arp_ip_target Specifies the IP addresses to use as ARP monitoring peers when arp_interval is > 0. These are the targets of the ARP request sent to determine the health of the link to the targets.Specify these values in ddd.ddd.ddd.ddd format. Multiple IP addresses must be separated by a comma. At least one IP address must be given for ARP monitoring to action. The maximum number of targets that can be specified is 16. The default value is no IP addresses.   arp_interval Specifies the ARP link monitoring frequency in milliseconds. The ARP monitor works by periodically checking the slave devices to  determine whe