LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2020, 05:03 AM   #1
JASlinux
Member
 
Registered: Oct 2020
Posts: 380

Rep: Reputation: Disabled
Question UNmounting all partitions simultaneously


JWM desktop environment has a menu option for unmounting all mounted partitions on each partition icon.

Is there such a terminal command? Is the same possible in XFCE?

https://www.2daygeek.com/mount-unmou...tion-in-linux/

Last edited by JASlinux; 11-15-2020 at 05:05 AM. Reason: adding a topic link/url
 
Old 11-15-2020, 08:42 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by JASlinux View Post
JWM desktop environment has a menu option for unmounting all mounted partitions on each partition icon.

Is there such a terminal command? Is the same possible in XFCE?

https://www.2daygeek.com/mount-unmou...tion-in-linux/
Generally no. The problem is that some filesystems will be mounted into directories in other mounted filesystems.

Hence they have to dismounted in reverse.

Normally the /etc/fstab would show that hierarchy - but if the /etc/fstab was converted to systemd mount entries - then that simple list doesn't exist.

The advantage of the simple list is that most administrators would put the list in the order to be mounted. Thus if device D was mounted in a directory in device C... then the D mount would follow the C mount.

This should also apply to any bind mounts (bind mounts provide cross filesystem connections as if a mount were done - which is good for use in chroot environments. So dismounting those in proper order would also be useful.

This ordering makes it easy read the /etc/fstab and proceed by dismounting the last mount first.

The ONLY dismount that would fail is for the root filesystem, as it is always in use.

Now, in the GUI case it is likely not trying to dismount EVERYTHING, but dismount only what the user has accessed (memory sticks, CD/DVD and possibly other external storage).

To find those you actually look elsewhere using the mount command to list the external devices and limit to those the user owns.

Last edited by jpollard; 11-15-2020 at 08:46 AM.
 
Old 11-15-2020, 10:22 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Have you tried "umount -av" ?
 
Old 11-15-2020, 12:08 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by rknichols View Post
Have you tried "umount -av" ?
works for root.

would fail for a user. -a can only be used by root.
 
Old 11-15-2020, 12:13 PM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
umounting every partition will stop your linux immediately (or just won't work).
you can always write a small script to do what you need and execute it when you want.
 
Old 11-15-2020, 04:38 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by pan64 View Post
umounting every partition will stop your linux immediately (or just won't work).
It will not unmount any filesystems that are currently in use, i.e., those that have open files, the CWD of any process, active mount points, ... . It will unmount everything that can be unmounted, and will not "stop your Linux immediately".
 
Old 11-16-2020, 01:03 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,879

Rep: Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317Reputation: 7317
Quote:
Originally Posted by rknichols View Post
It will not unmount any filesystems that are currently in use, i.e., those that have open files, the CWD of any process, active mount points, ... . It will unmount everything that can be unmounted, and will not "stop your Linux immediately".
I don't really like if you pick only the half of a post. That was written too: (or just won't work).
Either OP can do what was requested (=umount everything) - in that case the system will die,
or it won't work (as you explained).
The goal was to highlight: the original request [most probably] cannot be fulfilled.
 
  


Reply

Tags
console, partition, terminal, unmount, unmounting



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unmounting all nfs filesystems without unmounting local ones kaplan71 Linux - General 1 03-05-2009 11:00 AM
Unmounting partitions rushi Linux - Hardware 4 07-18-2006 02:43 PM
Is there a way to view all workspaces on one monitor screen simultaneously? Booger Linux - General 4 12-03-2003 08:46 AM
is there a way to resize my desktop icons simultaneously and all the same size? kublador Linux - Newbie 3 03-14-2003 07:46 PM
Partitions, partitions, partitions..... Clueless in VA Linux - Newbie 7 08-08-2001 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration