in reply to Re: How to determine if a file is a mount point?
in thread How to determine if a file is a mount point?

Thanks. That seems to help with one exception so far. Using that method, it makes /dev look like a mounted file system which it is not. Is there some special meaning to $dev for certain directories like /dev?
  • Comment on Re^2: How to determine if a file is a mount point?

Replies are listed 'Best First'.
Re^3: How to determine if a file is a mount point?
by pc88mxer (Vicar) on Jun 29, 2008 at 15:02 UTC

    Actually, /dev is a mounted file system -- see what the mount command reports.

    It is not a remote file system like NFS, but then Linux doesn't differentiate "remote" file systems from other kinds of file systems (like /proc or EXT2 or NTFS or FTPFS).

    The value of the device field identifies the handler (file system driver) that the OS uses to implement the file system object. If you only interested in NFS files, you could find out what its device id is and just check for that particular value.

Re^3: How to determine if a file is a mount point?
by grep (Monsignor) on Jun 29, 2008 at 15:04 UTC
    /dev and /proc are both mounted file systems. They are just special, because they are not disk based.

    Look at the output of mount. It should list both /dev and /proc.

    grep
    One dead unjugged rabbit fish later...
      Thanks for the reply. The mount output shows /proc but not /dev. In additional it seems each ext3 mounted filesystem has a different $dev value (which to me makes sense since each is on a separate partition). The ext3 filesystems seems to have a $dev value of >760 while the specials like /dev have a value of <50. It is reliable to use that to determine which is which?