Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • The difficult part it is handling a mount point with space. So I would put such important point also on the title of thew question. Commented Oct 19, 2016 at 15:04
  • Did you try to grep through /proc/mounts ? It should have all informations you need. Commented Oct 19, 2016 at 15:16
  • @Kalavan If the source is something /home/user/fs, but another file/device is mounted at /home/user/fs_mnt, then grep is pretty useless. Commented Oct 19, 2016 at 15:23
  • @Melab That's why you grep for the device name, not the mount name. /etc/mtab (for RH and similar systems) stores the mount information for all currently mounted filesystems. So you grep for the device name in /etc/mtab. See the answer provided by a0f3dd13. Commented Oct 19, 2016 at 15:32
  • @Xalorous Except if /home/user/fs is a device name… Commented Oct 19, 2016 at 16:42