Friday 7 October 2022

Linux Change Mount Point Name

Let us change /mnt to /opt  on Linux 7.9


Rename the folder if it already exist.

[root@ip-172-31-27-116 opt]# mv opt optt

[root@ip-172-31-27-116 opt]# mount -l

Identify the volume information of existing mount point

[root@ip-172-31-27-116 opt]# ps -ef |grep mnt

Make sure no process is using. Either kill or restart OS

[root@ip-172-31-27-116 opt]# umount /mnt

Un mount the existing mount point which we need to rename

[root@ip-172-31-27-116 opt]# mkdir opt

Create the folder for our new mount point

[root@ip-172-31-27-116 opt]# mount /dev/nvme2n1 /opt

[root@ip-172-31-27-116 opt]# mount -l

[root@ip-172-31-27-116 opt]# cat /etc/fstab

[root@ip-172-31-27-116 opt]# vi /etc/fstab

[root@ip-172-31-27-116 opt]# mount -l

[root@ip-172-31-27-116 opt]# reboot

No comments:

Post a Comment