RHEL: XFS basic operations
Viewed 15638 times since Sat, Jun 2, 2018
RHEL: XFS basic operations # Tested on RHEL 6 & 7 # XFS filesystem supports up to 16 EiB filesystems and up to 8 EiB and directory structures # holding tens of millions entries. # On the other hand it is a single node filesystem. It comes...
Read More
RHEL: How to change a USER/GROUP UID/GID and all owned files
Viewed 20878 times since Sat, Jun 2, 2018
RHEL: How to change a USER/GROUP UID/GID and all owned files # How to change a UID/GID and all belonging filesUSER=myuserOLDUID=7773NEWUID=7774GROUP=mygroupOLDGID=157NEWGID=158# Assign a new UID to USER. Any files which the user owns and which ...
Read More
RHEL: udev rules basics
Viewed 8164 times since Sat, Jun 2, 2018
RHEL: udev rules basics # Tested on RHEL 6 & 7# 'udev' is a mechanism for maintaining device nodes on a server. It handles the management# of the devices nodes through the 'udevd' daemon as well as rules defined on the ...
Read More
RHEL: What is "SysRq key" and how to use it
Viewed 5063 times since Sat, Jun 2, 2018
RHEL: What is "SysRq key" and how to use it # Tested on RHEL 5, 6 & 7# What is the "Magic" 'SysRq' key?# ------------------------------------------------------------------------------------------# According to the Linux kernel doc...
Read More
RHEL: Display swap/RAM size
Viewed 3111 times since Sat, Jun 2, 2018
RHEL: Display swap/RAM size # File containing information about system memory /proc/meminfo# Display physical memory sizecat /proc/meminfo | grep MemTotal MemTotal: 11508864 kB# Display swap sizecat /proc/meminfo | grep SwapTotal Swap...
Read More
RHEL: Forgotten ’root’ password / using single-user to gain access
Viewed 7120 times since Sat, Jun 2, 2018
RHEL: Forgotten 'root' password / using single-user to gain access # Tested on RHEL 6 & 7# RHEL 6 -----------------------------------------------------------------------------------# Booting into single user mode is the easiest ...
Read More
RHEL: Force system to prompt for password in Single User mode
Viewed 7026 times since Sat, Jun 2, 2018
RHEL: Force system to prompt for password in Single User mode # Tested on RHEL 5, 6 & 7# Due to security reasons, one may want to force system to prompt for root password even# in Single User mode# By default, system doesn't ask for pa...
Read More
RHEL: Services basic management - systemd
Viewed 18389 times since Sat, Jun 2, 2018
RHEL: Services basic management - systemd # Tested on CentOS 7# systemd is the new Fedora init system adopted by Red Hat from RHEL 7 on.# It is backwards compatible with SysV init scripts, enhances the administrative process# and provides new ...
Read More
RHEL: Services basic management - chkconfig
Viewed 5383 times since Sat, Jun 2, 2018
RHEL: Services basic management - chkconfig # Tested on RHEL 5 & 6 # If one of "on", "off", "reset", or "resetpriorities" is specified after the service name,# 'chkconfig' command changes the startup information for the specified...
Read More
RHEL: Retrieve and generate a unique SCSI identifier
Viewed 2889 times since Sat, Jun 2, 2018
RHEL: Retrieve and generate a unique SCSI identifier # Tested on RHEL 5, 6 & 7# There are many situations were we may need a unique identifier for a SCSI device# (disk, etc.) to be identified in an unambiguous and persistent way.# To obtain...
Read More
RHEL: How to rebuild and/or patch a RPM package
Viewed 8414 times since Sat, Jun 2, 2018
RHEL: How to rebuild and/or patch a RPM package # Tested on RHEL 6 & 7 # If possible, avoid creating packages as 'root' as this is quite dangerous because we # could delete or overwrite OS existing files. # Setup the folder str...
Read More
Build a simple RPM that packages a single file
Viewed 8223 times since Sat, Jun 2, 2018
Build a simple RPM that packages a single file # Tested on RHEL 6 & 7# The 'rpmbuild' command is used to build a binary RPM from source code, as configured# with a .spec file.# Install the necessary packages: rpm-build and rpmdevt...
Read More
RHEL: Allowing users to ’su’ to "root" / Allowing ’root’ to login directly to the system using ’ssh’
Viewed 2662 times since Sat, Jun 2, 2018
RHEL: Allowing users to 'su' to "root" / Allowing 'root' to login directly to the system using 'ssh' # Tested on RHEL 5, 6 & 7# Allowing users to "su" to 'root'# -------------------------------------...
Read More
RHEL: Route network packets to go out via the same interface they came in
Viewed 2851 times since Sat, Jun 2, 2018
RHEL: Route network packets to go out via the same interface they came in # Tested on RHEL 6 # When working on a server with several network interfaces, if we don't define any specific # VLAN routing, all the outgoing traffic will usual...
Read More
RHEL: Rename a network interface on RHEL 7
Viewed 10244 times since Sat, Jun 2, 2018
RHEL: Rename a network interface on RHEL 7 # Tested on CentOS 7 (Virtual server)# RHEL 6 introduced the Consistent Network Device Naming, feature that sets the name of# network interfaces in order to make locating and differentiating the interf...
Read More
RHEL: Bonding network interfaces
Viewed 3507 times since Sat, Jun 2, 2018
RHEL: Bonding network interfaces # Tested on RHEL 5, 6 & 7 # Red Hat Enterprise Linux allows administrators to bind multiple network interfaces# together into a single channel using the bonding kernel module and a special network# interfac...
Read More
RHEL: Multipathing basics
Viewed 8520 times since Sat, Jun 2, 2018
RHEL: Multipathing basics # Tested on RHEL 5 & 6# DM-Multipath is a feature of Red Hat from RHEL 5 on and can be used to provide:## Redundancy: DM-Multipath can provide failover in an active/passive configuration. In an# active/passive co...
Read More
RHEL: Remove existing SAN LUNs
Viewed 13905 times since Sat, Jun 2, 2018
RHEL: Remove existing SAN LUNs # Tested on RHEL 5 & 6 # Given following LUN, for instance: multipath -ll [...] 3600508b4000971cd0001000022fa0000 dm-0 HP,HSV210 [size=2.0G][features=0][hwhandler=0][rw] \_ round-robin 0 [prio...
Read More
RHEL: Rebuilding the initial ramdisk image
Viewed 7027 times since Sat, Jun 2, 2018
RHEL: Rebuilding the initial ramdisk image # Tested on RHEL 5, 6 & 7 # Sometimes it may be necessary to rebuild the initial ramdisk (also known as initrd or # initramfs) to include new kernel modules, files, etc. # RHEL 3, 4 & 5: Reb...
Read More
RHEL: Displaying/setting kernel parameters - ’sysctl’
Viewed 2780 times since Sat, Jun 2, 2018
RHEL: Displaying/setting kernel parameters - 'sysctl' # Tested on RHEL 6 & 7# Setting kernel parameters is a fairly straightforward task. If we check the file# /etc/sysctl.conf, we will see several attributes with their appropria...
Read More
RHEL: Building a custom kernel on RHEL 6
Viewed 3914 times since Sat, Jun 2, 2018
RHEL: Building a custom kernel on RHEL 6 # Tested on RHEL 6.4 i386# Notes mainly from http://wiki.centos.org/HowTos/Custom_Kernel# WARNING: Please note that customizing kernel is not supported by Red Hat Support Services# NOTE: It is advisable ...
Read More
RHEL: Crash kernel dumps configuration and analysis on RHEL 7
Viewed 6881 times since Sat, Jun 2, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 7 # The memory reserved for the kdump kernel is always reserved during system boot. That# means that the amount of memory is specified in the system's boot loader configuration.# ...
Read More
RHEL: Crash kernel dumps configuration and analysis on RHEL 6
Viewed 4524 times since Sat, Jun 2, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 6 Kernel dumps may provide invaluable insights when debugging serious issues.1.- Install following RPMs: kexec-tools crash To be able to analyze crash dumps, followi...
Read More
RHEL: Crash kernel dumps configuration and analysis on RHEL 5
Viewed 6974 times since Sat, Jun 2, 2018
RHEL: Crash kernel dumps configuration and analysis on RHEL 5 Apart from this recipe, more information about the configuration can be found inthe file “/usr/share/doc/kexec-tools-*/kexec-kdump-howto.txt“https://access.redhat.com/knowledge/docs/...
Read More
RHEL: iSCSI target/initiator configuration on RHEL7
Viewed 10746 times since Sat, Jun 2, 2018
RHEL: iSCSI target/initiator configuration on RHEL7 # Tested on RHEL 7# iSCSI target configuration# ------------------------------------------------------------------------------------------# Install required package: targetcliyum install -y ta...
Read More
RHEL: iSCSI target/initiator configuration on RHEL6
Viewed 8575 times since Sat, Jun 2, 2018
RHEL: iSCSI target/initiator configuration on RHEL6 # Tested on RHEL 6# iSCSI target configuration# ------------------------------------------------------------------------------------------# Required package: scsi-target-utils# Some documentat...
Read More
RHEL: Getting/Setting hardware clock’s time
Viewed 2850 times since Sat, Jun 2, 2018
RHEL: Getting/Setting hardware clock's time # Tested on RHEL 6 & 7 # Just an extract from 'hwclock' man page hwclock -r or hwclock --show hwclock -w or hwclock --systohc hwclock -s or hwclock --hctosys hwclock --set -...
Read More
RHEL: Change system’s hostname
Viewed 3291 times since Sun, May 27, 2018
# Tested on RHEL 5, 6 & 7 # RHEL 5 & 6 -------------------------------------------------------------------------------# Change hostname in /etc/sysconfig/network file# and run following command:hostname <new_hostname># Do not forget t...
Read More
RHEL: Checking HBAs
Viewed 14468 times since Sun, May 27, 2018
# Tested on RHEL 6# Show the instances of FC ports connected to the pci bus:lspci | grep -i "Fibre" 07:00.0 Fibre Channel: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA (rev 02) 07:00.1 Fibre Channel: QLogic Corp. ISP2532-based ...
Read More
RHEL: Adding a boot entry to GRUB/GRUB2 configuration
Viewed 4406 times since Sun, May 27, 2018
# Tested on RHEL 6 & 7# RHEL 6# ------------------------------------------------------------------------------------------# Adding a new entry to grub boot file is as simple as adding a new boot stanza, at the end# of the file, to /boot/grub/grub...
Read More
RHEL: GPT/MBR partition tables (using disks larger than 2 TiB)
Viewed 12082 times since Sun, May 27, 2018
# Tested on RHEL 6 & 7# Up to now the default type of the partition table of a hard disk is MBR (msdos). This# old method presents some problems like the limitation of having a maximum of four primary# partitions but the main problem is that we c...
Read More
RHEL: Enabling standard ftp/telnet
Viewed 3246 times since Sun, May 27, 2018
# Tested on RHEL 5# By default system is as secured as to be accesible only via ssh/sftp.# Enabling ftp# ------------------------------------------------------------------------------------------# 1.- Edit File /etc/xinetd.d/gssftp and change followi...
Read More
RHEL: Manually encrypting a filesystem with LUKS
Viewed 3595 times since Sun, May 27, 2018
# Tested on RHEL 7# LUKS, Linux Unified Key Setup-on-disk-format, allow encrypting partitions. By default, the# option to encrypt the file systems is unchecked during the installation, otherwise we will# be prompted for a passphrase every time the s...
Read More
RHEL: Reserved space on a ext2/ext3/ext4 filesystem
Viewed 4191 times since Sun, May 27, 2018
# Tested on RHEL 6 & 7# By default, when creating a new ext2/ext3/ext4 filesystem, five percent of the partition# is reserved for the superuser, allowing root to carry out administrative tasks on the# filesystem in the eventuality that F.S. becom...
Read More
RHEL: Extending the maximum inode count on a ext2/ext3/ext4 filesystem
Viewed 2959 times since Sun, May 27, 2018
# Tested on RHEL 6 & 7 # An inode is a data structure that contains information about a file or directory. Inodes# rarely get used up when the file system has available space. Nevertheless, this may# happen when there is a large amount of small f...
Read More
RHEL: Displaying system info (firmware, serial numbers... )
Viewed 11739 times since Sun, May 27, 2018
# Tested on RHEL 5, 6 & 7# Network interface cards driver, driver version, firmware version, and bus informationethtool -i eth0 driver: bnx2 version: 2.0.8-rh firmware-version: bc 5.2.3 NCSI 2.0.6 bus-info: 0000:03:00.0cat /var/log/dmes...
Read More
RHEL: Extending a vmdk (Virtual Machine disk)
Viewed 3937 times since Sun, May 27, 2018
# Tested on RHEL 5, 6 & 7 # This procedure may be carried out to make visible the new size of a disk that is already# presented and used by the OS and that has been extended at virtual server level.# Whenever possible I recommend to create a new...
Read More
RHEL: Handling SCSI disks
Viewed 12188 times since Sun, May 27, 2018
# Tested on RHEL 5, 6 & 7 # Check devices currently known to the SCSI subsystem # ------------------------------------------------------------------------------------------ cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00...
Read More
RHEL: Back-up/Replicate a partition table
Viewed 3184 times since Sun, May 27, 2018
# Tested on RHEL 5, 6 & 7 # Given the importance of disk's partition table, one should consider to make a backup# in a regular basis in order to be able to restore it in case it will get corrupted,# modified or deleted by mistake.# We may st...
Read More
RHEL: ACLs basics
Viewed 5949 times since Sun, May 27, 2018
Files and directories have permission sets for the owner of the file, the group associated with the file,and all other users for the system. However, these permission sets have limitations. For example, differentpermissions cannot be configured for d...
Read More
RHEL: Reinstalling Boot Loader on the Master Boot Record (MBR)
Viewed 3141 times since Sun, May 27, 2018
# Tested on RHEL 5 & 6# In many cases, the GRUB boot loader can mistakenly be deleted, corrupted or replaced.# We can manually reinstall GRUB on the master boot record, using either "grub-install"# or the "grub" prompt.# Ensure the device.map fil...
Read More
RHEL: Resize/disable /dev/shm filesystem
Viewed 14433 times since Sun, May 27, 2018
# Tested on RHEL 5, 6 & 7 # Notes from www.walkernews.net, www.generation-linux.fr and Red Hat web site# Thanks to big memory size, nowadays most of RAM is not used at all. It is thus possible# to allocate a part of this physical memory to be use...
Read More
RHEL: Extending a multipath LUN
Viewed 4685 times since Sun, May 27, 2018
# Tested on RHEL 6# This procedure may be carried out to make visible the new size of a LUN that is already# presented and used by the OS and that has been extended at SAN storage level.# Whenever possible I recommend to create a new LUN at SAN level...
Read More
RHEL: Scan and configure new SAN (fibre channel) LUNs
Viewed 7781 times since Sun, May 27, 2018
# Tested on RHEL 5 & 6 # Identify host adapters on the systemsystool -c fc_host Class = "fc_host" Class Device = "host3" Device = "host3" Class Device = "host4" Device = "host4"ls /sys/class/fc_host host3 host4# Rescan t...
Read More
RHEL: Create a local RPM repository
Viewed 10999 times since Sun, May 27, 2018
# Tested on RHEL/CentOS 6 & 7# Mount the installation disk and copy packages from <cdrom>/Packages to a local directory.# I'll use /depot as local repository.# Once done, first of all, you have to install createrepo package:cd /depotll...
Read More