13

Sometimes you need to disconnect and reconnect mounts that have gone bad and don't want to disconnect + reconnect the entire list of fstab entries.

Is this possible without having to basically rerun the full underlying mount command that fstab abstracts away? Something like:

mount /Videos

where fstab contains:

//admin@192.168.1.4/Videos$ /Videos smbfs nodev,nosuid,auto

I'd rather not copy and paste the entire fstab entry and modify it to use the mount -o syntax

Sridhar Sarnobat
  • 1,395
  • 2
  • 13
  • 25
  • It's exactly how fstab works: http://man7.org/linux/man-pages/man8/mount.8.html – Tom Yan Apr 16 '16 at 07:06
  • I know that. My question is does the "mount -a" shortcut have some kind of filter that can do the messy stuff for you. – Sridhar Sarnobat Apr 16 '16 at 07:07
  • What does you question have to do with `mount -a`? What "filter"/"messy stuff"? – Tom Yan Apr 16 '16 at 07:10
  • If I haven't made it clear by what I've written in the question then no amount of further explaining will either. But thanks for the reply. – Sridhar Sarnobat Apr 16 '16 at 07:11
  • 4
    `umount /Videos` and `mount /Videos` will work, and the latter will use the source, type and options in `//admin@192.168.1.4/Videos$ /Videos smbfs nodev,nosuid,auto`, if that's what you want to know. – Tom Yan Apr 16 '16 at 07:13
  • You're right! I'm not sure why I never tried this but yes that works. I had assumed it wouldn't be able to distinguish between a mount that does and doesn't read fstab but it behaves exactly as I wanted. If you paste your comment in the answers section i'll mark it as correct. Thank you. – Sridhar Sarnobat Apr 16 '16 at 07:15

1 Answers1

15

(Thanks to Tan for the answer)

umount /Videos and mount /Videos will work, and the latter will use the source, type and options in //admin@192.168.1.4/Videos$ /Videos smbfs nodev,nosuid,auto that is specified in fstab.

Side-note: I don’t bother with /etc/fstab anymore. I use /etc/auto.direct.

Sridhar Sarnobat
  • 1,395
  • 2
  • 13
  • 25