How to Change or Rename a Mount Point in Linux

As a Linux admin, you must have got a request for renaming a mount point. Well, it is fairly easy to rename the mount point name in Linux, but it needs some mount point.

Note: You may have clustering software like Veritas Infoscale or PCS cluster which might be controlling the mount point configuration. This post only discusses cases where no external clustering software is controlling the mount point configuration.

In our example, we need to change the /ORABIN12c mount point to /grid on our server.

Follow below steps to change the mount point name.

$ df -hP
Filesystem                                 Size  Used Avail Use% Mounted on
devtmpfs                                   126G     0  126G   0% /dev
tmpfs                                      126G  640M  126G   1% /dev/shm
tmpfs                                      126G  4.1G  122G   4% /run
tmpfs                                      126G     0  126G   0% /sys/fs/cgroup
/dev/mapper/vg_os-lv_root                  296G   52G  229G  19% /
/dev/mapper/vg_os2-lv_data                 197G   15G  173G   8% /data
/dev/mapper/vg_os2-ora12c                   50G   18G   30G  38% /ORABIN12c

1. Login as root.

$ sudo su -

2. Create a directory with name /grid. This directory will be used to mount.

# mkdir /grid

3. edit the /etc/fstab file, replace /ORABIN12c with /grid in fstab file.

# vi /etc/fstab

Before:

/dev/mapper/vg_os2-ora12c /ORABIN12c       ext4    defaults        0 0

After:

/dev/mapper/vg_os2-ora12c /grid       ext4    defaults        0 0

4. Check if any process is utilizing the /ORABIN12c mount point. You may have to kill the processes running on this mount point or ask app/DBA team to shutdown the app/DB. The command to check if any process is running:

# fuser -cu /ORABIN12c

5. Once you have confirmed that nothing is running on the /ORABIN12c mount point, unmount it using the umount command:

# umount /ORABIN12c

6. Now mount the new mount point /grid

# mount /grid

7. Verify if the new mount point is reflected in the df command output:

# df -hP /grid
Filesystem                     Size  Used Avail Use% Mounted on
/dev/mapper/vg_os2-ora12c       50G   18G   30G  38% /grid
Related Post