Sponsored Content
Contact Us Post Here to Contact Site Administrators and Moderators How to Post in the The UNIX and Linux Forums NFS mounted and unmounted shell script Post 302951443 by jim mcnamara on Thursday 6th of August 2015 11:24:13 AM
Old 08-06-2015
Exactly what Linux/UNIX are you using? I am guessing CentOS.

Do you know about /etc/mnttab or etc/mtab (if it exists on your system)?

/proc/mounts has a specific format, if I understand correctly it has a column that specifies the status. So, simply finding the mountpoint in there may nort be what you want?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How can I tell if a filesystem is NFS mounted?

I would like to know if there is a command or set of commands that I can run to verify that there are no 'extraneous' nfs mounted filesystems on our server. I didn't see anything in doing a search on NFS. We think that we may have some filesystems that are still nfs mounted when the link should... (3 Replies)
Discussion started by: giannicello
3 Replies

2. Shell Programming and Scripting

Testing if nfs filesystem is mounted

Hello, I have a backup script that backs up my system to a nfs mounted file system. The mount point on my local system is /backup. I want my script to check whether the nfs file system is mounted on /backup before actually backing anything up. Even if the nfs file system was NOT mounted,... (2 Replies)
Discussion started by: xadamz23
2 Replies

3. UNIX Desktop Questions & Answers

VNC + GNOME with nfs mounted homedirs.

Hi! I'm experiencing some disturbing problems with a machine at work. I've got about 20 users and of which 15 uses VNC to connect to the machine for working with GNOME. The problem is that after a while it seems like the homedir get some nfs stales or something, gnome processes hangs and so... (0 Replies)
Discussion started by: Esaia
0 Replies

4. Shell Programming and Scripting

Kill shell script when host program not running/disk unmounted

I have my Mac OS X program executing a shell script (a script that copies files to a drive). I want to make it so that the shell script automatically kills itself if it finds that the host .app is not running OR kill itself if the drive that it is copying files to has been unmounted. Right now what... (2 Replies)
Discussion started by: pcwiz
2 Replies

5. Solaris

NFS mounted files

If I am not a system admin. How can I tell where a particular mounted file is mounted from. (12 Replies)
Discussion started by: Harleyrci
12 Replies

6. Shell Programming and Scripting

if (disk is mounted) unmount if (disk is unmounted) mount

Hey there, sorry if this is a bit too much of a noob question, trying to get to grips with a simple bash script - but i have done ZERO bash scripting. basically having worked out how to mount and unmount disks using: disktool -m *device* & disktool -e *device* - and looking at the result of... (2 Replies)
Discussion started by: hollister
2 Replies

7. Red Hat

doubt in NFS mounted filesystem in linux

Hi, I have some filesystem which is nfs mounted and shared to other servers. Nfs server name= nfsserver (here filesystem is locally mounted) server name where filesystem is shared = sharedserver1 and sharedserver2 filesystem which is shared = /filesystem1 when i am checking utilization by... (1 Reply)
Discussion started by: anshu ranjan
1 Replies

8. UNIX for Dummies Questions & Answers

Unable to write to a mounted NFS share

Hi All, I created a nfs share in the server(Solaris 10) with the following command and also updated the dfstab file share -F nfs -o rw=server_name2,anon=0 /to_share And then in the client(solaris 10) added the following command to mount the share mount -F nfs server_name1:/to_share... (4 Replies)
Discussion started by: Rossdba
4 Replies

9. HP-UX

Unable to write to NFS mounted directory

Hi, I have exported a few nfs mounts from one server to the nfs clients. This is my nfs server dfstab : # cat /etc/dfs/dfstab # place share(1M) commands here for automatic execution # on entering init state 3. # # share <pathname> # .e.g, # share -F... (3 Replies)
Discussion started by: anaigini45
3 Replies

10. AIX

Mounted and unmounted

Hi Guys I'm new here, and I need urgent help. This my first steps to be Aix admin and I have this task -instal Oracle database on Aix machine and create mounting point /u02 of size 100GB for Oracle Standalone database installation. -download and install the following OS patches - IV42025... (5 Replies)
Discussion started by: khaled_ly84
5 Replies
UMOUNT(8)						       System Administration							 UMOUNT(8)

NAME
umount - unmount file systems SYNOPSIS
umount [-hV] umount -a [-dflnrv] [-t vfstype] [-O options] umount [-dflnrv] {dir|device}... DESCRIPTION
The umount command detaches the file system(s) mentioned from the file hierarchy. A file system is specified by giving the directory where it has been mounted. Giving the special device on which the file system lives may also work, but is obsolete, mainly because it will fail in case this device was mounted on more than one directory. Note that a file system cannot be unmounted when it is 'busy' - for example, when there are open files on it, or when some process has its working directory there, or when a swap file on it is in use. The offending process could even be umount itself - it opens libc, and libc in its turn may open for example locale files. A lazy unmount avoids this problem. OPTIONS
-a, --all All of the file systems described in /etc/mtab are unmounted. (With umount version 2.7 and later: the proc filesystem is not unmounted.) -A, --all-targets Unmount all mountpoints in the current namespace for the specified filesystem. The filesystem could be specified by one of the mountpoints or device name (or UUID, etc.). This option could be used together with --recursive then all nested mounts within the filesystem are recursively unmounted. -c, --no-canonicalize Do not canonicalize paths. For more details about this option see the mount(8) man page. -d, --detach-loop In case the unmounted device was a loop device, also free this loop device. --fake Causes everything to be done except for the actual system call; this 'fakes' unmounting the filesystem. It can be used to remove entries from /etc/mtab that were unmounted earlier with the -n option. -f, --force Force unmount (in case of an unreachable NFS system). (Requires kernel 2.1.116 or later.) -i, --internal-only Do not call the /sbin/umount.<filesystem> helper even if it exists. By default /sbin/umount.<filesystem> helper is called if one exists. -n, --no-mtab Unmount without writing in /etc/mtab. -l, --lazy Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.) -O, --test-opts options,list Indicate that the actions should only be taken on file systems with the specified options in /etc/fstab. More than one option type may be specified in a comma separated list. Each option can be prefixed with no to specify options for which no action should be taken. -R, --recursive Recursively unmount each directory specified. Recursion for each directory will stop if any unmount operation in the chain fails for any reason. The relationship between mountpoints is determined by /proc/self/mountinfo entries. The filesystem must be specified by mountpoint path, recursive unmount by device name (or UUID) is unsupported. -r, --read-only In case unmounting fails, try to remount read-only. -t, --types vfstype,ext2,ext3 Indicate that the actions should only be taken on file systems of the specified type. More than one type may be specified in a comma separated list. The list of file system types can be prefixed with no to specify the file system types on which no action should be taken. -v, --verbose Verbose mode. -h, --help Print help message and exit. -V, --version Print version and exit. THE LOOP DEVICE
The umount command will free the loop device (if any) associated with the mount, in case it finds the option 'loop=...' in /etc/mtab, or when the -d option was given. Any pending loop devices can be freed using 'losetup -d', see losetup(8). NOTES
The syntax of external umount helpers is: /sbin/umount.<suffix> {dir|device} [-nlfvr] [-t type.subtype] where the <suffix> is filesystem type or a value from "uhelper=" or "helper=" mtab option. The -t option is used for filesystems with sub- types support (for example /sbin/mount.fuse -t fuse.sshfs). The uhelper= (unprivileged umount helper) is possible to use when non-root user wants to umount a mountpoint which is not defined in the /etc/fstab file (e.g. devices mounted by udisk). The helper= mount option redirects all umount requests to the /sbin/umount.<helper> independently on UID. FILES
/etc/mtab table of mounted file systems ENVIRONMENT
LIBMOUNT_FSTAB=<path> overrides the default location of the fstab file LIBMOUNT_MTAB=<path> overrides the default location of the mtab file LIBMOUNT_DEBUG=0xffff enables debug output SEE ALSO
umount(2), mount(8), losetup(8) HISTORY
A umount command appeared in Version 6 AT&T UNIX. AVAILABILITY
The umount command is part of the util-linux package and is available from Linux Kernel Archive <ftp://ftp.kernel.org/pub/linux/utils/util- linux/>. util-linux August 2012 UMOUNT(8)
All times are GMT -4. The time now is 08:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy