Operating System - HP-UX
1825775 Members
1889 Online
109687 Solutions
New Discussion

Re: File Systems or Directory Structure

 
SOLVED
Go to solution
Manoj1
Advisor

File Systems or Directory Structure

Hi All,

If i see a directory structure like /dir1/dir2/dir3/dir4/ then how to distinguish whether it is a file system or directory structure ?

Thanks,
Manoj
9 REPLIES 9
Shibin_2
Honored Contributor
Solution

Re: File Systems or Directory Structure

Do bdf or df on it.

e.g. df -k /dir1/dir2/dir3/dir4/

if it showing, mounted on /dir1 then it is a file system on /dir1. If it is showing mounted on /, then it is a directory structure mounted on /.
Regards
Shibin
Jayakrishnan G Naik
Trusted Contributor

Re: File Systems or Directory Structure

Hi Manoj,

I can't guess what you are searching for in this case, the best reply here is to run a bdf command and see whether any logical volume have the mentioned directory structure as the mount point. /etc/fstab also should have an entry for this directory stucture, if it has a filesystem.

Thanks & Regards
Jayakrishnan G Naik


Steven Schweda
Honored Contributor

Re: File Systems or Directory Structure

uname -a

man mount

mount
James R. Ferguson
Acclaimed Contributor

Re: File Systems or Directory Structure

Hi Manoj:

A mounted directory ("filesystem") will always have an inode number of two (2). Hence to test whether or not your directory is mounted, simply do:

# ls -ild /directory

The inode number is the first column of the output.

Regards!

...JRF...
Ismail Azad
Esteemed Contributor

Re: File Systems or Directory Structure

Hi Manoj,


> alternative method

do a cat /etc/mnttab. All of the output you would see there would be filesystems.

Regards
Ismail Azad
Read, read and read... Then read again until you read "between the lines".....
Eric SAUBIGNAC
Honored Contributor

Re: File Systems or Directory Structure

Bonsoir,

Yet An Other Method ;-)

fuser -c /directory will return an error code if it is not a mounted filesystem.

root@ockham:/#fuser -c /tmp >/dev/null 2>&1; echo $?
0
root@ockham:/#fuser -c /tmp/lost+found >/dev/null 2>&1; echo $?
1

Eric
Manoj1
Advisor

Re: File Systems or Directory Structure

Where do we use file systems and directories ?
I mean in which scenarios they are used and for which type of applications ?

Thanks,
Manoj
P Arumugavel
Respected Contributor

Re: File Systems or Directory Structure

P Arumugavel
Respected Contributor

Re: File Systems or Directory Structure

A file system is a portion of the disk that has been allocated, formatted and is mounted using the directory as a mount point.

Filesystem:
Is a technolgy method of storing and organizing computer data and files. It is used on data storage devices to maintian the physical location of the files. Other than this, they might give access to data on a file server acting as clents for a network protocol.

Mountpoint:
It is a empty directory which is used to mount and provide an entry point to the filesystems.

Directory:
It is virtual container within a filesystem in which groups of files and other folders can be kept and organized.

Rgds...