A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Placing Namenode in safemode and Perform checkpoint

Normally in real environment secondary node performs checkpoint operation and keep syncing with active namenode to keep latest FSimage.  In HA environment active namenode writes edit log into  journal node and standby node go and get the edit log and create new FSimage.

[hdfs@datanode1 ~]$ hdfs dfsadmin -safemode get
Safe mode is OFF

[hdfs@datanode1 ~]$ hdfs dfsadmin -safemode enter
Safe mode is ON

[hdfs@datanode1 ~]$ hdfs dfsadmin -saveNamespace       (checkpoint command)
Save namespace successful

[hdfs@datanode1 ~]$ hdfs dfsadmin -safemode leave
Safe mode is OFF

 

 

RHEL 5 vs RHEL 7 comparision

Command changes for common tasks

System basics

Task RHEL5 RHEL7
View subscription information /etc/sysconfig/rhn/systemid subscription-manager identity
Configure subscription rhn_register subscription-manager
rhn_register
View system profile sosreport
dmidecode
hwbrowser
sosreport
dmidecode
lstopo
lscpu

Basic configuration

Task RHEL5 RHEL7
Graphical configuration tools system-config-* gnome-control-center
Configure network system-config-network nmcli
nmtui
nm-connection-editor
Configure system language system-config-language localectl
Configure time and date system-config-date
date
timedatectl
date
Synchronize time and date ntpdate
/etc/ntp.conf
timedatectl
/etc/chrony.conf
ntpdate
Configure keyboard system-config-keyboard localectl

Jobs and services

Task RHEL5 RHEL7
List all services chkconfig –list
ls /etc/init.d/
systemctl -at service
ls /etc/systemd/system/*.service
ls /usr/lib/systemd/system/*.service
List running services service –status-all systemctl -t service –state=active
Start/stop service service name start
service name stop
systemctl start name.service
systemctl stop name.service
Enable/disable service chkconfig name on
chkconfig name off
systemctl enable name.service
systemctl disable name.service
View service status service name status systemctl status name.service
Check if service is enabled chkconfig name –list systemctl is-enabled name
Create new service file or modify configuration chkconfig –add systemctl daemon-reload
/etc/systemd/system/*.service
View run level/target runlevel
who -r
systemctl get-default
who -r
Change run level/target /etc/inittab
init run_level
systemctl isolate name.target
systemctl set-default
Configure logging /etc/syslog.conf /etc/rsyslog.conf
/etc/rsyslog.d/*.conf
/var/log/journal
systemd-journald.service
View logs /var/log /var/log
journalctl

Kernel, boot, and hardware

Task RHEL5 RHEL7
Single user/rescue mode append 1 or s or init=/bin/bash to kernel cmdline append rd.break or init=/bin/bash to kernel cmdline
Shut down system shutdown shutdown
systemctl shutdown
Power off system poweroff poweroff
systemctl poweroff
Halt system halt halt
systemctl halt
Reboot system reboot reboot
systemctl reboot
Configure default run level/target /etc/inittab systemctl set-default
Configure GRUB bootloader /boot/grub/grub.conf /etc/default/grub
grub2-mkconfig
grub-set-default
View hardware configured hwbrowser lshw (in EPEL)

Software management

Task RHEL5 RHEL7
Install software yum install
yum groupinstall
yum install
yum group install
View software info yum info
yum groupinfo
yum info
yum group info

File systems, volumes, and disks

Task RHEL5 RHEL7
Default file system ext3 xfs
Create/modify disk partitions fdisk
parted
fdisk
gdisk
parted
ssm create
Format disk partition mkfs.filesystem_type (ext4, xfs)
mkswap
mkfs.filesystem_type (ext4, xfs)
mkswap
ssm create
Defragment disk space copy data to new file system
fsck (look for ‘non-contiguous inodes’)
copy data to new file system
fsck (look for ‘non-contiguous inodes’)
xfs_fsr
Mount storage mount
/etc/fstab
mount
/etc/fstab
ssm mount
Create physical volume pvcreate pvcreate
ssm create (if backend is lvm)
Create volume group vgcreate vgcreate
ssm create (if backend is lvm)
Create logical volume lvcreate lvcreate
ssm create (if backend is lvm)
Enlarge volumes formatted with default file system vgextend
lvextend
resize2fs
vgextend
lvextend
xfs_growfs
ssm resize
Shrink volumes formatted with default file system resize2fs
lvreduce
vgreduce
XFS cannot currently be shrunk; copy desired data to a smaller file system.
Check/repair file system fsck fsck
ssm check
Configure NFS share /etc/exports
service nfs reload
/etc/exports
systemctl reload nfs.service

Networking

Task RHEL5 RHEL7
Configure name resolution /etc/hosts
/etc/resolv.conf
/etc/hosts
/etc/resolv.conf
nmcli con mod
Configure hostname /etc/sysconfig/network hostnamectl
/etc/hostname
nmtui
View network interface info ip addr
ifconfig
brctl
ip addr
nmcli dev show
teamdctl
brctl
bridge
Configure network interface /etc/sysconfig/network-scripts/ifcfg-* /etc/sysconfig/network-scripts/ifcfg-*
nmcli con [add|mod|edit]
nmtui
nm-connection-editor
Configure routes ip route add
system-config-network
/etc/sysconfig/route-iface
ip route add
nmcli
nmtui
nm-connection-editor
/etc/sysconfig/route-iface
Configure firewall iptables and ip6tables
/etc/sysconfig/ip*tables
firewall-cmd
firewall-config
View ports/sockets ss
lsof
netstat
ss
lsof

Resource management

Task RHEL5 RHEL7
View system usage top
ps
sar
iostat
netstat
vmstat
mpstat
numastat
top
ps
sar
iostat
ss
vmstat
mpstat
numastat
tuna
View disk usage df df
iostat

RHEL 7 – Changed mount behavior at boot – Nofail

Earlier versions of Red Hat Enterprise Linux booted regardless of whether all partitions specified in /etc/fstab could be mounted. This could result in a system appearing “up” and healthy, while booting without required partitions.
To prevent this situation, in Red Hat Enterprise Linux 7, if a partition defined in /etc/fstab cannot be mounted at boot, boot fails. If a partition should not cause boot to fail in the event that it cannot be mounted, use the new nofail parameter in /etc/fstab.
/dev/critical     /critical   xfs   defaults          1  2
/dev/optional     /optional   xfs   defaults,nofail   1  2
In this example, the device mounted at /optional would not cause boot to fail if it could not be mounted successfully.

RHEL 7 reset root password

If you lost the root password to the system and you have access to the boot loader, you can reset the password by editing the GRUB2 configuration.

 Resetting the Root Password

  1. Boot your system and wait until the GRUB2 menu appears.
  2. In the boot loader menu, highlight any entry and press e to edit it.
  3. Find the line beginning with linux. At the end of this line, append the following:
    init=/bin/sh

    Important

    Some systems (notably virtual machines) may have problems displaying correct output when you boot using this procedure. Some characters or even entire lines may be hidden, making the shell difficult to use. To solve this problem, delete the rhgb command from the linux line.
  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:
    sh4.2# passwd root
    When prompted to, enter your new root password and confirm by pressing the Enter key. Enter the password for the second time to make sure you typed it correctly and confirm with Enter again. If both passwords match, a message informing you of a successful root password change will appear.
  8. Remount the root partition again, this time as read-only:
    sh4.2# mount -o remount,ro /
  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.

RHEL 7 XFS command vs EXT4

Task ext4 XFS
Creating a file system mkfs.ext4 mkfs.xfs
Mounting a file system mount mount
Resizing a file system resize2fs xfs_growfs
Repairing a file system e2fsck xfs_repair
Changing the label on a file system e2label xfs_admin -L
Reporting on disk space and file usage quota quota
Debugging a file system debugfs xfs_db
Store critical file system metadata to a file e2image xfs_metadump

How to find lun number in Solaris 10

Solaris 10: Find LUN id
Step 1. Use format command to find your disk.

12. c4t60060480000190105493533033443843d0
/scsi_vhci/ssd@g60060480000190105493533033443843

Step 2. Find Logical Path of the disk

# luxadm probe|grep c4t60060480000190105493533033443843d0
Logical Path:/dev/rdsk/c4t60060480000190105493533033443843d0s2

Step 3. Get Device Address
# luxadm display /dev/rdsk/c4t60060480000190105493533033443843d0s2
DEVICE PROPERTIES for disk: /dev/rdsk/c4t60060480000190105493533033443843d0s2
Vendor: EMC
Product ID: SYMMETRIX
Revision: 5773
Serial Num: 105493″R0
Unformatted capacity: 1035787.500 MBytes
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0xffff
Device Type: Disk device
Path(s):
/dev/rdsk/c4t60060480000190105493533033443843d0s2
/devices/scsi_vhci/ssd@g60060480000190105493533033443843:c,raw
Controller /devices/pci@500/pci@0/pci@9/SUNW,qlc@0/fp@0,0
Device Address 50060482d531e552,335 Host controller port WWN 21000024ff3019ea
Class primary
State ONLINE
Controller /devices/pci@500/pci@0/pci@9/SUNW,qlc@0,1/fp@0,0
Device Address 50060482d531e558,335 Host controller port WWN 21000024ff3019eb
Class primary
State ONLINE