Operating System - HP-UX
1751968 Members
4710 Online
108783 Solutions
New Discussion

Re: find if under one filesystem other filesystems are mounted

 
SOLVED
Go to solution
support_billa
Valued Contributor

find if under one filesystem other filesystems are mounted

hello,

i have following situation:

mounted filesystems:

/filesystem
/filesystem/fs1
/filesystem/fs2

how can i find out , if under one filesystem other filesystems are mounted ? (filesystem where mounted with server startup (/etc/fstab) or with service guard package start)
when i want to umount /filesystem? , i got following message :
umount: cannot unmount /dev/vg/lvol_fs : Device busy  
umount: return error 1. 

                                                                                                                                                                                                         
can i use following infomartion from thread "hard link (find file , which it points to )
i learned :  inode number 2  is a mounted filesystem , right ?
with command "/sbin/vxupgrade ?" i can see the filesystem version and with version greater 6 , i can use
/usr/sbin/vxlsino <inode>  <file_system>          ?

regards,                    

                                                             

11 REPLIES 11
Dennis Handly
Acclaimed Contributor

Re: find if under one filesystem other filesystems are mounted

>if under one filesystem other filesystems are mounted?

 

You can look first in /etc/fstab, then in /etc/mnttab.

Doug O'Leary
Honored Contributor

Re: find if under one filesystem other filesystems are mounted

Hey;

 

mount | grep filesystem | awk '{print $1}'

 

I typically write an inline script to umount all the filesystems for vgoracle, for instance:

 

mount | grep vgoracle |awk '{print $1}' | sort -r | while read mp

do

   echo ${mp}

   umount ${mp}

done

 

HTH;

 

Doug O'Leary


------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Naj
Valued Contributor

Re: find if under one filesystem other filesystems are mounted

Hi,

I agree with Dennis, you may look into both file

____________________________________________
:: Really appreciate if you could assign some points.
:: Don't know how to assign point? Click the KUDOS! star!
James R. Ferguson
Acclaimed Contributor

Re: find if under one filesystem other filesystems are mounted


@support_billa wrote:


i learned :  inode number 2  is a mounted filesystem , right ?


This is correct.

 

Regards!

 

...JRF...

Dennis Handly
Acclaimed Contributor

Re: find if under one filesystem other filesystems are mounted

>I learned: inode number 2  is a mounted filesystem, right?

 

I'm not sure how useful this will be for you.  While you could do "ll -i /" to find all of the mounted filesystems under /, looking deeper will be a waste of time.

Johnson Punniyalingam
Honored Contributor

Re: find if under one filesystem other filesystems are mounted

You can check  /etc/fstab . more over if the /etc/fstab has been updated promptly by (Sysadmin) if some have mounted it manually. you refer to /etc/mnttab

 

Best Regards,

Johnson

Problems are common to all, but attitude makes the difference
Hiren N Dave
Valued Contributor

Re: find if under one filesystem other filesystems are mounted

>> when i want to umount /filesystem? , i got following message : >> umount: cannot unmount /dev/vg/lvol_fs : Device busy

 

You can check current processes which are using this mount point using this command

 

# fuser -cu /mount_point

 

Regards,

HD

I am an HP Employee

Was this post useful? - You may click the KUDOS! star to say thank you.
support_billa
Valued Contributor

Re: find if under one filesystem other filesystems are mounted

hello,

 

/etc/mnttab is a very good idea, here can i find all mounted filesystems (like mount -p )

when i want to "grep" with a reg expr. then i can see also if under a filesystem other filesystems are mounted ?

 

like : grep "/testfs" /etc/mnttab | wc -l ?

 

with a script  umount all other filesystems  is a good solution, but not for my case usable.

 

regards

support_billa
Valued Contributor

Re: find if under one filesystem other filesystems are mounted

here my idea to search for filesystem(s) in /etc/mnttab with help from replace a string with "/" in a variable

 

awk -v FSYS="/filesystem" 'BEGIN {found=0} $2 ~ ("^"FSYS) { found=found+1 } END {print found}' /etc/mnttab


this show show following filesystem(s)

/filesystem
/filesystem/fs1
/filesystem/fs2

 

regards