Remove or deconfig NFS mount from a host

Stop the NFS service

[root@dpprod oracle]# /bin/systemctl stop nfs.service
[root@dpprod oracle]# /bin/systemctl status nfs.service

Disable the nfs services

[root@dpprod oracle]# chkconfig nfslock off
Note: Forwarding request to 'systemctl disable nfslock.service'.
[root@dpprod oracle]# chkconfig rpcgssd off
Note: Forwarding request to 'systemctl disable rpcgssd.service'.
[root@dpprod oracle]# chkconfig rpcidmapd off
Note: Forwarding request to 'systemctl disable rpcidmapd.service'.
[root@dpprod oracle]# chkconfig portmap off
error reading information on service portmap: No such file or directory
[root@dpprod oracle]# chkconfig nfs off
Note: Forwarding request to 'systemctl disable nfs.service'.
Removed symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service.

Remove the installed packages

[root@dpprod oracle]# yum remove portmap nfs-utils
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package nfs-utils.x86_64 1:1.3.0-0.68.0.1.el7.2 will be erased
--> Processing Dependency: nfs-utils for package: oracle-database-preinstall-19c-1.0-3.el7.x86_64
--> Processing Dependency: nfs-utils for package: oracle-database-server-12cR2-preinstall-1.0-5.el7.x86_64
--> Processing Dependency: nfs-utils for package: ipa-client-4.6.6-11.0.1.el7.x86_64
--> Processing Dependency: nfs-utils for package: libvirt-daemon-driver-storage-core-4.5.0-33.el7.x86_64
--> Processing Dependency: nfs-utils for package: targetd-0.8.6-1.el7.noarch
--> Processing Dependency: nfs-utils for package: oracle-rdbms-server-12cR1-preinstall-1.0-7.el7.x86_64
---> Package rpcbind.x86_64 0:0.2.0-49.el7 will be erased
--> Processing Dependency: rpcbind for package: 1:quota-4.01-19.el7.x86_64
--> Running transaction check
---> Package ipa-client.x86_64 0:4.6.6-11.0.1.el7 will be erased
--> Processing Dependency: ipa-client = 4.6.6-11.0.1.el7 for package: ipa-server-4.6.6-11.0.1.el7.x86_64
---> Package libvirt-daemon-driver-storage-core.x86_64 0:4.5.0-33.el7 will be erased
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-iscsi-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-mpath-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-rbd-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-qemu-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-scsi-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-logical-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-gluster-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-storage-core = 4.5.0-33.el7 for package: libvirt-daemon-driver-storage-disk-4.5.0-33.el7.x86_64
---> Package oracle-database-preinstall-19c.x86_64 0:1.0-3.el7 will be erased
---> Package oracle-database-server-12cR2-preinstall.x86_64 0:1.0-5.el7 will be erased
---> Package oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-7.el7 will be erased
---> Package quota.x86_64 1:4.01-19.el7 will be erased
---> Package targetd.noarch 0:0.8.6-1.el7 will be erased
--> Running transaction check
---> Package ipa-server.x86_64 0:4.6.6-11.0.1.el7 will be erased
---> Package libvirt-daemon-driver-qemu.x86_64 0:4.5.0-33.el7 will be erased
--> Processing Dependency: libvirt-daemon-driver-qemu = 4.5.0-33.el7 for package: libvirt-4.5.0-33.el7.x86_64
--> Processing Dependency: libvirt-daemon-driver-qemu = 4.5.0-33.el7 for package: libvirt-daemon-kvm-4.5.0-33.el7.x86_64
---> Package libvirt-daemon-driver-storage.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-driver-storage-disk.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-driver-storage-gluster.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-driver-storage-iscsi.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-driver-storage-logical.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-driver-storage-mpath.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-driver-storage-rbd.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-driver-storage-scsi.x86_64 0:4.5.0-33.el7 will be erased
--> Running transaction check
---> Package libvirt.x86_64 0:4.5.0-33.el7 will be erased
---> Package libvirt-daemon-kvm.x86_64 0:4.5.0-33.el7 will be erased
--> Processing Dependency: libvirt-daemon-kvm >= 3.9.0-1 for package: 1:libguestfs-1.40.2-9.0.1.el7.x86_64
--> Processing Dependency: libvirt-daemon-kvm for package: gnome-boxes-3.28.5-4.el7.x86_64
--> Running transaction check
---> Package gnome-boxes.x86_64 0:3.28.5-4.el7 will be erased
---> Package libguestfs.x86_64 1:1.40.2-9.0.1.el7 will be erased
--> Finished Dependency Resolution
ol7_UEKR5/x86_64                                                                  | 3.0 kB  00:00:00
ol7_UEKR5/x86_64/updateinfo                                                       | 186 kB  00:00:00
ol7_UEKR5/x86_64/primary_db                                                       |  34 MB  00:00:03
ol7_latest/x86_64                                                                 | 3.6 kB  00:00:00
ol7_latest/x86_64/updateinfo                                                      | 3.4 MB  00:00:00
ol7_latest/x86_64/primary_db                                                      |  37 MB  00:00:03

Dependencies Resolved

=========================================================================================================
 Package                                    Arch      Version                     Repository        Size
=========================================================================================================
Removing:
 nfs-utils                                  x86_64    1:1.3.0-0.68.0.1.el7.2      @ol7_latest      1.1 M
 rpcbind                                    x86_64    0.2.0-49.el7                @anaconda/7.8    101 k
Removing for dependencies:
 gnome-boxes                                x86_64    3.28.5-4.el7                @anaconda/7.8    5.5 M
 ipa-client                                 x86_64    4.6.6-11.0.1.el7            @anaconda/7.8    254 k
 ipa-server                                 x86_64    4.6.6-11.0.1.el7            @anaconda/7.8    1.0 M
 libguestfs                                 x86_64    1:1.40.2-9.0.1.el7          @anaconda/7.8    7.1 M
 libvirt                                    x86_64    4.5.0-33.el7                @anaconda/7.8    0.0
 libvirt-daemon-driver-qemu                 x86_64    4.5.0-33.el7                @anaconda/7.8    1.5 M
 libvirt-daemon-driver-storage              x86_64    4.5.0-33.el7                @anaconda/7.8    0.0
 libvirt-daemon-driver-storage-core         x86_64    4.5.0-33.el7                @anaconda/7.8    707 k
 libvirt-daemon-driver-storage-disk         x86_64    4.5.0-33.el7                @anaconda/7.8     68 k
 libvirt-daemon-driver-storage-gluster      x86_64    4.5.0-33.el7                @anaconda/7.8    132 k
 libvirt-daemon-driver-storage-iscsi        x86_64    4.5.0-33.el7                @anaconda/7.8     64 k
 libvirt-daemon-driver-storage-logical      x86_64    4.5.0-33.el7                @anaconda/7.8     72 k
 libvirt-daemon-driver-storage-mpath        x86_64    4.5.0-33.el7                @anaconda/7.8     60 k
 libvirt-daemon-driver-storage-rbd          x86_64    4.5.0-33.el7                @anaconda/7.8     80 k
 libvirt-daemon-driver-storage-scsi         x86_64    4.5.0-33.el7                @anaconda/7.8     64 k
 libvirt-daemon-kvm                         x86_64    4.5.0-33.el7                @anaconda/7.8    0.0
 oracle-database-preinstall-19c             x86_64    1.0-3.el7                   @ol7_latest       76 k
 oracle-database-server-12cR2-preinstall    x86_64    1.0-5.el7                   @ol7_latest       55 k
 oracle-rdbms-server-12cR1-preinstall       x86_64    1.0-7.el7                   @ol7_latest       53 k
 quota                                      x86_64    1:4.01-19.el7               @anaconda/7.8    887 k
 targetd                                    noarch    0.8.6-1.el7                 @anaconda/7.8    152 k

Transaction Summary
=========================================================================================================
Remove  2 Packages (+21 Dependent packages)

Installed size: 19 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : libvirt-4.5.0-33.el7.x86_64                                                          1/23
  Erasing    : oracle-database-server-12cR2-preinstall-1.0-5.el7.x86_64                             2/23
  Erasing    : oracle-database-preinstall-19c-1.0-3.el7.x86_64                                      3/23
  Erasing    : targetd-0.8.6-1.el7.noarch                                                           4/23
  Erasing    : oracle-rdbms-server-12cR1-preinstall-1.0-7.el7.x86_64                                5/23
  Erasing    : 1:libguestfs-1.40.2-9.0.1.el7.x86_64                                                 6/23
  Erasing    : gnome-boxes-3.28.5-4.el7.x86_64                                                      7/23
  Erasing    : libvirt-daemon-kvm-4.5.0-33.el7.x86_64                                               8/23
  Erasing    : libvirt-daemon-driver-storage-4.5.0-33.el7.x86_64                                    9/23
  Erasing    : libvirt-daemon-driver-storage-disk-4.5.0-33.el7.x86_64                              10/23
  Erasing    : libvirt-daemon-driver-storage-logical-4.5.0-33.el7.x86_64                           11/23
  Erasing    : libvirt-daemon-driver-storage-scsi-4.5.0-33.el7.x86_64                              12/23
  Erasing    : libvirt-daemon-driver-storage-iscsi-4.5.0-33.el7.x86_64                             13/23
  Erasing    : libvirt-daemon-driver-storage-mpath-4.5.0-33.el7.x86_64                             14/23
  Erasing    : libvirt-daemon-driver-storage-gluster-4.5.0-33.el7.x86_64                           15/23
  Erasing    : libvirt-daemon-driver-storage-rbd-4.5.0-33.el7.x86_64                               16/23
  Erasing    : libvirt-daemon-driver-qemu-4.5.0-33.el7.x86_64                                      17/23
  Erasing    : libvirt-daemon-driver-storage-core-4.5.0-33.el7.x86_64                              18/23
  Erasing    : ipa-server-4.6.6-11.0.1.el7.x86_64                                                  19/23
  Erasing    : ipa-client-4.6.6-11.0.1.el7.x86_64                                                  20/23
  Erasing    : 1:nfs-utils-1.3.0-0.68.0.1.el7.2.x86_64                                             21/23
warning: file /var/lib/nfs/v4recovery: remove failed: No such file or directory
warning: file /var/lib/nfs/statd/sm.bak: remove failed: No such file or directory
warning: file /var/lib/nfs/statd/sm: remove failed: No such file or directory
warning: file /var/lib/nfs/statd: remove failed: No such file or directory
warning: directory /var/lib/nfs/rpc_pipefs: remove failed: Device or resource busy
warning: /var/lib/nfs/etab saved as /var/lib/nfs/etab.rpmsave
  Erasing    : 1:quota-4.01-19.el7.x86_64                                                          22/23
  Erasing    : rpcbind-0.2.0-49.el7.x86_64                                                         23/23
warning: file /var/lib/rpcbind: remove failed: No such file or directory
  Verifying  : 1:nfs-utils-1.3.0-0.68.0.1.el7.2.x86_64                                              1/23
  Verifying  : oracle-rdbms-server-12cR1-preinstall-1.0-7.el7.x86_64                                2/23
  Verifying  : libvirt-daemon-driver-storage-scsi-4.5.0-33.el7.x86_64                               3/23
  Verifying  : libvirt-daemon-driver-storage-disk-4.5.0-33.el7.x86_64                               4/23
  Verifying  : libvirt-daemon-driver-qemu-4.5.0-33.el7.x86_64                                       5/23
  Verifying  : ipa-server-4.6.6-11.0.1.el7.x86_64                                                   6/23
  Verifying  : rpcbind-0.2.0-49.el7.x86_64                                                          7/23
  Verifying  : libvirt-daemon-kvm-4.5.0-33.el7.x86_64                                               8/23
  Verifying  : targetd-0.8.6-1.el7.noarch                                                           9/23
  Verifying  : libvirt-daemon-driver-storage-core-4.5.0-33.el7.x86_64                              10/23
  Verifying  : libvirt-daemon-driver-storage-mpath-4.5.0-33.el7.x86_64                             11/23
  Verifying  : oracle-database-preinstall-19c-1.0-3.el7.x86_64                                     12/23
  Verifying  : oracle-database-server-12cR2-preinstall-1.0-5.el7.x86_64                            13/23
  Verifying  : libvirt-daemon-driver-storage-4.5.0-33.el7.x86_64                                   14/23
  Verifying  : 1:quota-4.01-19.el7.x86_64                                                          15/23
  Verifying  : libvirt-daemon-driver-storage-rbd-4.5.0-33.el7.x86_64                               16/23
  Verifying  : libvirt-4.5.0-33.el7.x86_64                                                         17/23
  Verifying  : gnome-boxes-3.28.5-4.el7.x86_64                                                     18/23
  Verifying  : libvirt-daemon-driver-storage-gluster-4.5.0-33.el7.x86_64                           19/23
  Verifying  : libvirt-daemon-driver-storage-iscsi-4.5.0-33.el7.x86_64                             20/23
  Verifying  : ipa-client-4.6.6-11.0.1.el7.x86_64                                                  21/23
  Verifying  : 1:libguestfs-1.40.2-9.0.1.el7.x86_64                                                22/23
  Verifying  : libvirt-daemon-driver-storage-logical-4.5.0-33.el7.x86_64                           23/23

Removed:
  nfs-utils.x86_64 1:1.3.0-0.68.0.1.el7.2                  rpcbind.x86_64 0:0.2.0-49.el7

Dependency Removed:
  gnome-boxes.x86_64 0:3.28.5-4.el7
  ipa-client.x86_64 0:4.6.6-11.0.1.el7
  ipa-server.x86_64 0:4.6.6-11.0.1.el7
  libguestfs.x86_64 1:1.40.2-9.0.1.el7
  libvirt.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-qemu.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-core.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-disk.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-gluster.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-iscsi.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-logical.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-mpath.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-rbd.x86_64 0:4.5.0-33.el7
  libvirt-daemon-driver-storage-scsi.x86_64 0:4.5.0-33.el7
  libvirt-daemon-kvm.x86_64 0:4.5.0-33.el7
  oracle-database-preinstall-19c.x86_64 0:1.0-3.el7
  oracle-database-server-12cR2-preinstall.x86_64 0:1.0-5.el7
  oracle-rdbms-server-12cR1-preinstall.x86_64 0:1.0-7.el7
  quota.x86_64 1:4.01-19.el7
  targetd.noarch 0:0.8.6-1.el7

Complete!

Clear the directories

rm -rf /etc/exports
rm -rf /nfs

Remove the entries from fstab

Leave a Reply