Mounting gets all the attention, but shares are usually broken at the other end of the day - a laptop closed mid-copy, a Windows PC switched off under a live mount, a folder yanked away from a program using it. Unmounting properly is a thirty-second habit that prevents the weird errors.
A mounted share is a live connection between two machines, with your programs potentially holding files open across it. Ending it cleanly is part of the skill: close what is using it, run one command, and confirm it let go. This page covers the clean way, the honest way to handle the famous target is busy refusal, the lazy unmount that exists for emergencies and deserves its bad reputation when used casually, and - for a share that is gone for good - how to retire the fstab entry and its credentials so nothing tries to mount a ghost at every boot.
Thirty seconds, three moves.
cd ~sudo umount /mnt/SharedDocsmount | grep cifs should show nothing for that share, and the mount-point folder should look empty again - empty here means disconnected, not deleted; the files are safe on the Windows PCThe busy message is the kernel protecting open files. Do not reach for force first - find the holder; it is embarrassingly often you.
sudo fuser -vm /mnt/SharedDocs shows the processes with files or folders open under it, including terminals sitting in a directory theresudo lsof /mnt/SharedDocs lists the open files themselvescd the stray terminal out - then repeat the plain sudo umount /mnt/SharedDocsSometimes the holder cannot be closed - the Windows PC already crashed or was switched off, and every access to the folder hangs. The lazy unmount exists for exactly this: sudo umount -l /mnt/SharedDocs detaches the folder from your directory tree immediately and finishes the real cleanup whenever the holders finally release it.
sudo umount -f /mnt/SharedDocs forces the issue - same warning, stronger handWhen the Windows PC is replaced or the folder unshared, retire the configuration or every boot will keep trying to mount a ghost.
sudo umount /mnt/SharedDocssudo nano /etc/fstab and delete the share's line - or comment it with a # if there is any chance of return. If the line was an automount, this also removes the on-demand triggersudo systemctl daemon-reloadsudo rmdir /mnt/SharedDocs - it succeeds only when empty, which is the safety check built insudo rm /root/.smbcredentials - a stored password for a dead share is pure leftover riskWatch the video for the mounting side of this pair - a clean setup makes every unmount and removal this page describes equally uneventful.
Watch Full VideoNo - if your fstab line uses automount, opening the folder is supposed to remount it; that is the feature working. To stop it, you stop the automount behaviour: comment or remove the fstab line and run systemctl daemon-reload. A plain boot-time mount, by contrast, never returns on its own after umount until the next reboot or mount command.
Only when the mount was set up for it - an fstab entry carrying the user option lets that user mount and unmount it themselves. The permanent mounts in this series are created by root at boot and are root's to release. On your own machine the sudo prompt is a small price; on a shared machine it is the correct boundary.
No. The mount point is just a window: mounted, you see the share through it; unmounted, you see the empty local folder that was always underneath. The files never lived in that folder - they live on the Windows PC and are untouched. Remount and they will all be exactly where they were.