Sponsored Content
Top Forums Shell Programming and Scripting Validation of mounting and unmounting Post 302845147 by Peasant on Wednesday 21st of August 2013 02:54:29 AM
Old 08-21-2013
You might want to use fuser -ck /mountpoint before executing umount.

That way fuser will kill the pids which are potentially holding the mountpoint and umount will work fine.

As for mounting, you can use return code ($?) to verify the mount is successful (should return zero if mount is success).
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Unmounting a cd in Solaris

I am having a rough time with unmounting a CD on a Solaris box. I am installing Oracle 8.1.7 for someone, and everything was going swell until the system tells me to put in CD 2. When I try to eject CD 1, nothing happens because the CD is still mounted. I looked on the man pages for rmmount to... (3 Replies)
Discussion started by: Jody
3 Replies

2. UNIX for Dummies Questions & Answers

Unmounting /home Permanently

Hi! I got tired of running out of disk space on the different partitions on my Solaris 8 Ultra 5 computer so I tried to make just a big / partition and install everything on that. But somehow I managed to get a 0 byte /home partition :-) I tried to delete this (By just clicking it in X-Windows and... (8 Replies)
Discussion started by: alfabetman
8 Replies

3. AIX

unmounting problem

Hello, can someone help me with the problem am facing unmounting a filesystem I wanted to unmount /oradata cause i created it with a larger size and wanted to umount it , delete the fs and create again with less size. i have done below but nothing so far. 1) iam not in /oradata directory 2) i... (3 Replies)
Discussion started by: karthikosu
3 Replies

4. UNIX for Dummies Questions & Answers

Validation

I'm kinda new in shell scripting. How do i validate an input from a user to conform to requirement. For example, echo "Enter First Name: " read FName echo "Enter Date of Employment (dd/mm/yyyy): " read DoE If the user enters data that is alphanumeric, it accepts it. I hope i've... (1 Reply)
Discussion started by: Allenzo
1 Replies

5. Shell Programming and Scripting

Validation help

Hi, I am new to Unix shell scripting and need help to add some validation to an existing script. I've made a script that takes two argument (input) but I want the script to display an error message when nothing (null) is entered. So far I managed to validate the fist argument but fail to... (2 Replies)
Discussion started by: zen10
2 Replies

6. Shell Programming and Scripting

Name validation

Hi All, I need to write a small piece of code to check the following. name should contain (A-Z), spaces, hyphens & apostrophes I need to generate regular expressions for the same. Please help me out as i am not familiar with regular expressions. (1 Reply)
Discussion started by: lifzgud
1 Replies

7. AIX

Unmounting a failed NFS mount

I have an NFS file system mounted on one of my AIX servers with "mount -v cifs".. The server from which the file system was mounted has crashed and now my "df -g" output is hanging. Is there any was to unmount this NFS file system? I have tried "umount -f". Doesn't work. Or is there any way in... (6 Replies)
Discussion started by: wibhore
6 Replies

8. AIX

Error unmounting a remote mounted file system

Hi All, I'm facing an issue while trying to unmount a remotely mounted file system, strangely it's not even getting mounted, Kindly find the reply messages. Mounting error msg nfsmnthelp: 1831-019 <Server host>: Cannot mount a file system that is already remotely mounted. mount: 1831-008... (13 Replies)
Discussion started by: Abhishekag
13 Replies

9. Shell Programming and Scripting

Value validation

Hi All I am trying to validate a value using if condition requirement is need to check whether its a valid numeric value the input contains ( space, #N/A and negative and positive decimal values and Zeros) if it contains the space, I need to display the error message as space ... (15 Replies)
Discussion started by: tsurendra
15 Replies

10. UNIX for Dummies Questions & Answers

Unmounting NFS idle clients from server

Hello World, We have a software repository server in our environment which we use as an NFS server. Now this has been going on well before I was hired. Now, I observed many users not unmounting the NFS resources after their use. I ran showmount and it showed 513 current sessions. :wall: Is... (7 Replies)
Discussion started by: satish51392111
7 Replies
umount(2)							   System Calls 							 umount(2)

NAME
umount, umount2 - unmount a file system SYNOPSIS
#include <sys/mount.h> int umount(const char *file); int umount2(const char *file, int mflag); DESCRIPTION
The umount() function requests that a previously mounted file system contained on a block special device or directory be unmounted. The file argument is a pointer to the absolute pathname of the file system to be unmounted. After unmounting the file system, the directory upon which the file system was mounted reverts to its ordinary interpretation. The umount2() function is identical to umount(), with the additional capability of unmounting file systems even if there are open files active. The mflag argument must contain one of the following values: 0 Perform a normal unmount that is equivalent to umount(). The umount2() function returns EBUSY if there are open files active within the file system to be unmounted. MS_FORCE Unmount the file system, even if there are open files active. A forced unmount can result in loss of data, so it should be used only when a regular unmount is unsuccessful. The umount2() function returns ENOTSUP if the specified file systems does not support MS_FORCE. Only file systems of type nfs, ufs, pcfs, and zfs support MS_FORCE. RETURN VALUES
Upon successful completion, 0 is returned. Otherwise, -1 is returned and errno is set to indicate the error. ERRORS
The umount() and umount2() functions will fail if: EACCES The permission bits of the mount point do not permit read/write access or search permission is denied on a component of the path prefix. The calling process is not the owner of the mountpoint. The mountpoint is not a regular file or a directory and the caller does not have all privileges available in a its zone. The special device device does not permit read access in the case of read-only mounts or read-write access in the case of read/write mounts. EBUSY A file on file is busy. EFAULT The file pointed to by file points to an illegal address. EINVAL The file pointed to by file is not mounted. ELOOP Too many symbolic links were encountered in translating the path pointed to by file. ENAMETOOLONG The length of the file argument exceeds PATH_MAX, or the length of a file component exceeds NAME_MAX while _POSIX_NO_TRUNC is in effect. ENOENT The file pointed to by file does not exist or is not an absolute path. ENOLINK The file pointed to by file is on a remote machine and the link to that machine is no longer active. ENOTBLK The file pointed to by file is not a block special device. EPERM The {PRIV_SYS_MOUNT} privilege is not asserted in the effective set of the calling process. EREMOTE The file pointed to by file is remote. The umount2() function will fail if: ENOTSUP The file pointed to by file does not support this operation. USAGE
The umount() and umount2() functions can be invoked only by a process that has the {PRIV_SYS_MOUNT} privilege asserted in its effective set. Because it provides greater functionality, the umount2() function is preferred. SEE ALSO
mount(2), privileges(5) SunOS 5.11 4 Aug 2008 umount(2)
All times are GMT -4. The time now is 07:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy