Sponsored Content
Top Forums Shell Programming and Scripting Umount an entire device with multiple file systems Post 302466770 by temp4746 on Wednesday 27th of October 2010 09:10:48 AM
Old 10-27-2010
Question Umount an entire device with multiple file systems

I wish to umount in a bash script a specific device (/dev/sdb for example) that has multiple mounted file systems. how will I go about doing this?

Also is there a way to get a list of removable devices currently connected and offer the user a selection of them? (The devices themself not their mounts)
And also it would be nice to be know how to display a formatted list of mounts from a certain device.

Thanks for any help.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

umount, device busy, but..

I'm trying to unmount a file system, but umount says the device is busy. A fuser -c /myfs tells me that nothing on this fs is in use. Any idea? Oh, and btw, why isn't my signature beeing displayed? Show user's signature is enabled and I have entered one :/ (10 Replies)
Discussion started by: sTorm
10 Replies

2. UNIX for Dummies Questions & Answers

Installing Software on Multiple Systems

I have been given the task of installing subversion on rhe4 32 and 64 bit, suse9 ia64, hpux 11.22 ia64, hpux 11.11 pa_risc, solaris 2.8 sparc, and irix 6.5. How can I do this? I know that rhe5 and debian have things like yum and apt for packages. What are the equivalents for these systems? ... (4 Replies)
Discussion started by: ldb88
4 Replies

3. HP-UX

Cannot umount - device busy

Anyone have any idea why I cannot umount a directory even though fuser shows no process attached to it? fuser -cu /data/oracle/GMPSHRDM/export /data/oracle/GMPSHRDM/export: umount /data/oracle/GMPSHRDM/export umount: cannot unmount /data/oracle/GMPSHRDM/export : Device busy umount:... (2 Replies)
Discussion started by: keelba
2 Replies

4. Solaris

Filesystem - umount the / (root) file system

Hi all Is it ok to umount the / (root) file system? Because recently i had extend the swap space by add the cylinders, now only found that the cylinders is overlap with the root. Is it ok for future server operation? partition> print Current partition table (original): Total disk... (6 Replies)
Discussion started by: SmartAntz
6 Replies

5. Red Hat

How to boot / Install OS on multiple Systems

Q: How to boot or Install a Single LINUX (RED HAT) Operating System (OS) on to Multiple systems? : I intend to Boot an OS from a CD on System. I want to know, how can i boot simultaneously on multiple systems.. Say i have one system as MASTER, and 5 SLAVE Systems. IF i Start booting on... (1 Reply)
Discussion started by: Vabiosis
1 Replies

6. Shell Programming and Scripting

Find a particular directory in multiple file systems and calculate total size

Hello : I need some help in writing a ksh script which will find a particular directory in all the file systems in a server and finally report the total size of the direcotry in all the file systems. Some thing like this.. find /u*/app/oracle -type d -name "product" -prune and then... (1 Reply)
Discussion started by: Sam1974
1 Replies

7. Linux

bash:umount/: no such file or directory

I am trying to connect two system (let's say for time being) together such that it supports clustering. for this I got the following packages: # sudo apt-get install pacemaker sysv-rc-conf glusterfs-server glusterfs-examples glusterfs-client chkconfig nmap ntp Next, I did... (0 Replies)
Discussion started by: dr_mabuse
0 Replies

8. SCO

NFS umount shows the "Device busy (Error 16)"

Hi there After making a backup copy of it sometimes happens that when I want to unmount an NFS indicates the error:umount: /path_mount busy: Device busy (Error 16) if I run lsoff, I can not find the process that is blocking the application. I'm using OpenServer 5.0.2c as one NFS server ... (14 Replies)
Discussion started by: flako
14 Replies

9. Shell Programming and Scripting

Help with create multiple directories under diff file systems

Hi, Need help ...I want to create multiple directories in different /file systems using for loop..eg.../ORCL_data01/oradata/orcl/ctl. ../ORCL_data01/oradata/orcl/data. ../ORCL_data01/oradata/orcl/redo. Script :- ========= for dir in `ls -d... (8 Replies)
Discussion started by: Linux6.5
8 Replies

10. HP-UX

Test cases for file system mount/umount performance in HP

Hi Folks, Could anyone please assist me with the what could be the scenarios to test the file system mount/umount performance check in HPUX. Thanks in advance, Vaishey (5 Replies)
Discussion started by: Vaishey
5 Replies
pumount(1)						      General Commands Manual							pumount(1)

NAME
pumount - umount arbitrary hotpluggable devices as normal user SYNOPSIS
pumount [ options ] device DESCRIPTION
pumount is a wrapper around the standard umount program which permits normal users to umount removable devices without a matching /etc/fstab entry. pumount also supports encrypted devices which use dm-crypt and have LUKS metadata. If a LUKS-capable cryptsetup is installed, pumount will umount the mapped device instead and call cryptsetup to close the decrypted device afterwards. pumount expects the device as its only argument. This will umount device from a directory below /media if policy is met (see below). Please note that, as with pmount, you can use labels and uuids as described in fstab (5) for devices present in /etc/fstab. In this case, the device name need to match exactly the corresponding entry in /etc/fstab, including the LABEL= or UUID= part. Important note for Debian: The permission to execute pumount is restricted to members of the system group plugdev. Please add all desktop users who shall be able to use pmount to this group by executing adduser user plugdev (as root). OPTIONS
-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.) IMPORTANT NOTES This option should not be used unless you really know what you are doing, as chances are high that it will result in data loss on the removable drive. Please run pumount manually and wait until it finishes. In addition, pumount will not luksClose a device which was unmounted lazily. --luks-force Normally, pumount will not luksClose (see cryptsetup(1)) a device pmount did not open. However, you can bypass this restriction with this flag. You probably will need it if you did mess around with the /var/lock/pmount_luks directory. -h, --help Print a help message and exit successfully. -d, --debug Enable verbose debug messages. --version Print the current version number and exit successfully. POLICY
The umount will succeed if all of the following conditions are met: o device is a block device in /dev/ (it does not need to exist if -l is supplied) o device is not in /etc/fstab (if it is, pmount executes umount device as the calling user to handle this transparently) o device is mounted according to /etc/mtab and /proc/mounts with the calling user's uid o mount point is in /media PUMOUNT AND MISSING DEVICES
pumount now supports unmounting devices that have gone missing for some reason, such as a brutal removal of the device, or a kernel/hard- ware problem. Just specify the mount point as argument for pumount. SEE ALSO
pmount(1), cryptsetup(1), umount(8) AUTHOR
pmount is developed by Martin Pitt <martin.pitt@canonical.com>. Martin Pitt August 27, 2004 pumount(1)
All times are GMT -4. The time now is 11:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy