How to change MTU size for bonding interface

Environment

  • Red Hat Enterprise Linux (All Versions)

Issue

  • To set MTU for a bond interface, is there a need to change MTU in all slave interface configuration files ? Or is changing the configuration of the bond enough ?

Resolution

  • The MTU need only be set on the bond device. This will be propagated to the slave interfaces.
  • To make the setting permanent for bondX, edit the configuration file /etc/sysconfig/network-scripts/ifcfg-bondX and add the following line:
MTU=<value>
  • Then, restart the network service:
# service network restart
[root@rhel7 ~]# grep MTU /etc/sysconfig/network-scripts/ifcfg-*
/etc/sysconfig/network-scripts/ifcfg-bond0:MTU="9000"
/etc/sysconfig/network-scripts/ifcfg-eth0:MTU="9000"
/etc/sysconfig/network-scripts/ifcfg-eth1:MTU="9000"

[root@rhel7 ~]# systemctl restart network.service

[root@rhel7 ~]# ip addr show
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 52:54:00:41:c1:4a brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9000 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 52:54:00:41:c1:4a brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 9000 qdisc noqueue state UP 
    link/ether 52:54:00:41:c1:4a brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.136/24 brd 192.168.122.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::5054:ff:fe41:c14a/64 scope link tentative dadfailed 
       valid_lft forever preferred_lft forever

Diagnostic Steps

  • Check MTU values in output of command ifconfig -a.

lvremove failed with error " Logical volume vgname/lvname contains a filesystem in use."

Environment

  • Red Hat Enterprise Linux 6

Issue

  • Not able to remove unounted logical volume.
  • lvremove failed with below error.
# lvremove /dev/mapper/testvg-testlv
  Logical volume testvg-testlv contains a filesystem in use.

Resolution

  • Stop nfs service and remove logical volume.
  • Check whether there are any processes which are accessing the logical volume. In some cases kernel thread for journald might be accessing the LVM device due to which the lvm can be left open. In such case rebooting the server is the safest way to recover since the journald process should not be killed.

Root Cause

  • Mount point was exported through nfs.

Diagnostic Steps

1. Verify filesystem is not mounted.
# df 
# cat /proc/mount
2. verify no process in lsof/fuser is holdering this lv or mount point.
3. Verify whether this lv is exported through nfs
#cat /etc/exportfs
4. Try to to flush block device and drop cache
# blockdev --flushbufs /dev/vg/lv
# echo 1 > /proc/sys/vm/drop_caches
# echo 2 > /proc/sys/vm/drop_caches
# echo 3 > /proc/sys/vm/drop_caches

How to change time zone from command line on RHEL 7 ?

How to change time zone from command line on RHEL 7 ?

Environment

  • Red Hat Enterprise Linux 7

Issue

  • How to change time zone from command line on RHEL 7 ?

Resolution

On RHEL7,there is a different way for us to change time zone.
  1. Find the desired time zone with the below command or we can use the command "tzselect" to find the desired time zone..Let's make "Asia/Shanghai" as an example.
    # timedatectl list-timezones
    
  2. Change the time zone.
    # timedatectl set-timezone Asia/Shanghai
    
  3. Verify the status of time zone.
    # timedatectl status
    

Root Cause

timedatectl is a new feature on RHEL7. It may be used to query and change the system clock and its settings. See more at man timedatectl or Changing the Time Zone