fbpx

Solutions

How to change the default mount option of root filesystem in RHEL?

by ,


We have by far the largest RPM repository with NGINX module packages and VMODs for Varnish. If you want to install NGINX, Varnish, and lots of useful performance/security software with smooth yum upgrades for production use, this is the repository for you.
Active subscription is required.

Operating System and Software

  • Rocky Linux 8
  • CentOS 7

Problem

  • How to change the default mount option of root filesystem in CentOS 7?
  • Why the options set in /etc/fstab make no effect?

How to Fix

  1. Add [rootflags] variable at the end of the line of GRUB_CMDLINE_LINUX in /etc/default/grub as below:
    [example]

    GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/swap crashkernel=auto rd.lvm.lv=rhel/root rhgb quiet biosdevname=0 rootflags=pquota"
    
  2. Generate a GRUB configuration file.

    # grub2-mkconfig -o /boot/grub2/grub.cfg
    
  3. Reboot the host.

    # reboot
    
  4. Check the option we set be effective.

    # mount | grep root
     /dev/mapper/rhel-root on / type xfs (rw,relatime,attr2,inode64,prjquota)                             //prjquota
    

    Note: prjquota is the same with pquota. Please refer the man page of mount.

    # man mount
    

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.