Not sure if it's better suited for superuser of unix&linux boards, let me know.
We have a server which is one of the main key points of a somehow large architecture. This server has a backup disk which was not used, although it hosted very old backups. So I decided to set it up, and while it was at the beginning a single partition I used fdisk
to repartition it the same way as the primary drive (both are identical).
Unfortunately, after the repartitionning fdisk
couldn't manage to get the kernel see the new partition table, nor could partrobe
, blockdev
or sfdisk
. All faced the same issue : BLKRRPART: Device or resource busy
, though neither lsof
nor fuser
did show anything using the device. Here I have to mention that I used umount -l
to force the unmount before using fdisk
(yes, now it seems stupid and I should have read the doc more carefully).
Afterwards I figured out NFS was sharing one of the directory of the drive, which is why it didn't appear in lsof
and fuser
— don't ask me who had the silly idea of using a directory from an old backup drive to share startup configuration files for NFS clients…
I can't reboot this server, and I won't restart NFS. I've read I could use nfs-kernel-server reload
to keep NFS transfers while reloading /etc/exports
(if I understood correctly), but first I'm not sure this will work and second I really don't want to try that. I really want to avoid interfering with running processes.
Now, if the directory indeed appears in the output of showmount -e
(which seems basically the same as /etc/exports
), it appears neither in showmount -a
nor in showmount -d
. I guess this means the directory is not in used, so maybe there is some way to force the unmount from NFS ?
Any suggestions ?
NFSv2 and NFSv3 are stateless protocols. This means that, particularly when using UDP, you can restart the server with no effect whatsoever on connected clients.
If you're not going to trust what you read, it's hard to give suggestions. Editing
/etc/exports
and runningnfs-kernel-server reload
is of course the right solution. Running this simply executesexportfs -r
, which is the correct way to update the exports of a running server without restarting it.As an aside, you said:
To clarify,
umount -l
does not force an unmount. It's possible that your filesystem is still mounted, or was still mounted while you ran fdisk.