LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-23-2020, 08:43 PM   #1
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Rep: Reputation: 54
Is there a way to show only ACTUAL normal mounted devices? Lot of distros seem to put lot of stuff in there


On some distros there's so much junk to sift through when you do mount -l to see what is mounted. I just want to see actual disk devices, not 50+ system devices. Is there a way to streamline that? Maybe another argument than -l that I should be using or another command altogether?
 
Old 05-23-2020, 10:28 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
You can provide the filesystem type, e.g.
Code:
mount -t ext4 -t xfs -t vfat
This works on Ubuntu 16.04.
EDIT: It doesn't quite work; it seems that the mount command only takes into account the last -t option.
EDIT2: While looking into this, I found this very interesting paragraph in the mount manual page:
Quote:
The listing mode is maintained for backward compatibility only.
For more robust and customizable output use findmnt(8), especially in your
scripts. Note that control characters in the mountpoint name are replaced
with '?'.
That's one reason why I like answering questions. It forces me to think and research, and I occasionally learn something.

Or use good old grep to trim the list:
Code:
mount -l | grep -v -e /sys -e /run
Or filter for dev:
Code:
mount -l |grep /dev/

Last edited by berndbausch; 05-23-2020 at 10:36 PM.
 
1 members found this post helpful.
Old 05-23-2020, 10:33 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,141

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
df ?.
 
Old 05-24-2020, 12:31 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by syg00 View Post
df ?.
While your answer is more efficient than mine, I don't know if df delivers the same clarity of insight as mount.
 
Old 05-24-2020, 12:34 AM   #5
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by berndbausch View Post
You can provide the filesystem type, e.g.
Code:
mount -t ext4 -t xfs -t vfat
This works on Ubuntu 16.04.
EDIT: It doesn't quite work; it seems that the mount command only takes into account the last -t option.

<snip>
You can also add:
Code:
$ mount | grep -E 'ext|xfs|vfat|btrfs'
to the various ways to skin this cat.
 
Old 05-24-2020, 12:39 AM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by berndbausch View Post
You can provide the filesystem type, e.g.
Code:
mount -t ext4 -t xfs -t vfat
This works on Ubuntu 16.04.
EDIT: It doesn't quite work; it seems that the mount command only takes into account the last -t option.
This:
Code:
More than one type may be specified in a comma separated list.
So:
Code:
mount -t ext4,xfs,vfat
Perhaps?
 
1 members found this post helpful.
Old 05-24-2020, 02:37 AM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by scasey View Post
This:
Code:
More than one type may be specified in a comma separated list.
So:
Code:
mount -t ext4,xfs,vfat
Perhaps?
One never ceases to learn.
 
1 members found this post helpful.
Old 05-24-2020, 02:57 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,141

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
One hopes so - should that day ever come, we're in real strife.
 
1 members found this post helpful.
Old 05-24-2020, 03:48 AM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I think that’s what we’re here for...to learn...the teaching is but a plus.
 
Old 05-24-2020, 12:42 PM   #10
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Original Poster
Rep: Reputation: 54
Damn so there's no easier way? I don't really want to have to type up all that each time. I can make a script, but that won't always be available on a new or foreign system.

I guess that's probably the best bet though, if I make the script universal enough I can just make it part of my "deploy kit" which is basically a set of helper scripts I load on any machine I setup.

I don't like having to specify each file system though, if a new file system comes out or there is one I don't know about then I won't see that mount point. I could maybe use df, and then get the mount names, then check those individually. Essentially could just make my own mount script to check the mount points. Though grep is a good idea too, if I get rid of anything in /sys, /proc etc it will clean up the list. Can just make a new command called showmounts or something and throw in in /usr/bin.

Last edited by Red Squirrel; 05-24-2020 at 12:45 PM.
 
Old 05-24-2020, 01:03 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,758

Rep: Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930Reputation: 5930
Alternative? The output of the lsblk will show all physical block devices which could be large and their mount points if mounted.
 
Old 05-24-2020, 01:50 PM   #12
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by Red Squirrel View Post
Damn so there's no easier way? I don't really want to have to type up all that each time.
I don't think "df" is too much typing. Even "findmnt --real" isn't very long.

Last edited by berndbausch; 05-24-2020 at 01:53 PM.
 
1 members found this post helpful.
Old 05-24-2020, 02:24 PM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,954

Rep: Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329Reputation: 7329
I would say if you have a special requirement you need to implement it. Either you use what was suggested or make a script/function/alias to filter whatever you need from the output of any command and also to print it in your preferred format.
It looks like there is no ready made solution for you (or at least we don't know about it). Actually the expression "normal mount" is not really well defined.
 
Old 05-24-2020, 04:54 PM   #14
Red Squirrel
Senior Member
 
Registered: Dec 2003
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,336

Original Poster
Rep: Reputation: 54
Quote:
Originally Posted by berndbausch View Post
I don't think "df" is too much typing. Even "findmnt --real" isn't very long.
Ohhh I missed that, did not know about findmnt. That may be exactly what I need thanks.
 
Old 05-25-2020, 02:16 AM   #15
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
df also spits out some tmpfs and /run partitions.
Code:
mount -t ext4 -l
does pretty much exactly what you desire - but that's only because all my partitions are ext4.
 
  


Reply



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
Pcmanfm does not show mounted devices in side panel. black-clover antiX / MX Linux 6 11-09-2019 01:04 AM
list devices to find (mounted and) unmounted devices ti mount them lse123 Linux - Newbie 3 05-26-2017 11:59 AM
Able to access the mounted folder though the actual folder is moved VGM Linux - Networking 2 09-16-2010 12:10 PM
Is there a way to force panning to be smaller than the actual screen? Willrandship Linux - Software 0 05-09-2010 05:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:39 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