How do I get my NFS drive deleted?

My internal HDD hard disks are mounted as NFS drives with mount --bind. The files are mounted in /srv/nfsv4
For automount I use an entry in /etc/fstab .

Basically and for unserstanding, I would like to know if it is sufficient to remove the fstab entry to remove the NFS entry. Do I have to unmount these disks separately and how to do?

Its about sda and sdb

~ 
❯  lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda           8:0    0 931,5G  0 disk 
└─sda1        8:1    0 931,5G  0 part /srv/nfsv4/Share
                                      /run/media/swh/Mediathek
sdb           8:16   0 931,5G  0 disk /srv/nfsv4/Filme
                                      /run/media/swh/Stuff
sdc           8:32   0 223,6G  0 disk 
└─sdc1        8:33   0 223,6G  0 part /srv/nfsv4/edit
                                      /run/media/swh/76bd6be1-9d39-40d3-817a-e3acbc647e0a
sr0          11:0    1  1024M  0 rom  
nvme1n1     259:0    0 232,9G  0 disk 
├─nvme1n1p1 259:3    0   500M  0 part /efi
└─nvme1n1p2 259:4    0 232,4G  0 part /
nvme0n1     259:1    0 931,5G  0 disk 
└─nvme0n1p1 259:2    0 931,5G  0 part /home


I’m going to install a larger hard disk and I won’t need these two HDD’s anymore. If I want to use these hard disks again, I can mount them as NSF drives as usual. So far everything is clear to me. As I said, is it enough to remove the hard disks from the fstab? And how do I have to handle the --bind command to delete Share and Filme from the NFS file directory?

/srv/nfsv4 🔒 
❯  ls
 edit
 Filme
 Share

EDIT: findmnt --real for understanding

❯  findmnt --real
TARGET                                                SOURCE                      FSTYPE      OPTIONS
/                                                     /dev/nvme1n1p2              ext4        rw,noatime
├─/run/media/swh/76bd6be1-9d39-40d3-817a-e3acbc647e0a /dev/sdc1                   ext4        rw,relatime
├─/run/media/swh/Mediathek                            /dev/sda1                   ext4        rw,relatime
├─/run/media/swh/Stuff                                /dev/sdb                    ext4        rw,relatime
├─/run/user/1000/doc                                  portal                      fuse.portal rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
├─/efi                                                /dev/nvme1n1p1              vfat        rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remou
├─/srv/nfsv4/edit                                     /dev/sdc1[/swh/Videos/edit] ext4        rw,relatime
├─/home                                               /dev/nvme0n1p1              ext4        rw,noatime
├─/srv/nfsv4/Filme                                    /dev/sdb[/Filme]            ext4        rw,relatime
└─/srv/nfsv4/Share                                    /dev/sda1[/Share]           ext4        rw,relatime

It is enough to remove the fstab entries and to stop the nfs server.
To be sure I would also look into /etc/exports and remove and sda/sdb from there.

But why do you have such a setup? sda and sdb are local discs. It does not make sense to mount them locally with a “network” filesystem. You should better be using ext4, btrfs or xfs.

2 Likes

As I understand it, the NFS files are no longer bound as soon as I remove the entry from the fstab. I thought so, just wanted to make sure. I just didn’t know if --bind option is relevant for unmounting

I use this NFS directory to have access from my LinuxBox on the TV. This way I can view files that are on my computer on my TV. This is the reason

EDIT: Thanks for the quick and detailed answer :enos_flag:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.