LinuxQuestions.org
Help answer threads with 0 replies.
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 10-18-2015, 09:29 PM   #1
kiraan
LQ Newbie
 
Registered: Oct 2015
Posts: 4

Rep: Reputation: Disabled
Question about mounting


Hi,

In Linux systems permanent mounting is done by adding an entry is /etc/fstab. Can anyone tell which files stores information about temporary mount.

For example :
If I mount /dev/sdb1 to /test1 using below command :

mount /dev/sdb1 /test1

Which file will store this mount information.

Thank you.
 
Old 10-18-2015, 09:41 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Read the manpage for mount.
 
1 members found this post helpful.
Old 10-18-2015, 09:54 PM   #3
kiraan
LQ Newbie
 
Registered: Oct 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Read the manpage for mount.
Thanks. It is /etc/mtab.
 
Old 10-18-2015, 09:56 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Not really. Read it again, and run this
Code:
ls -l /etc/mtab
 
Old 10-18-2015, 10:15 PM   #5
kiraan
LQ Newbie
 
Registered: Oct 2015
Posts: 4

Original Poster
Rep: Reputation: Disabled
Is it /etc/mtab.tmp

[root@localhost ~]# ls -l /etc/mtab
-rw-r--r-- 1 root root 193 Aug 12 19:48 /etc/mtab
[root@localhost ~]#
 
Old 10-18-2015, 10:39 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,832

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Interesting. What distro and kernel (uname -a) are you running ?.
 
Old 10-18-2015, 10:44 PM   #7
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora
Posts: 1,687

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
Originally Posted by kiraan View Post
Thanks. It is /etc/mtab.
/etc/mtab doesn't seem to contain everything. On my system, I see the following difference:

Code:
$ cat /etc/mtab
....
/dev/loop0 /var/wwwapa/ubuntuinstall iso9660 ro,relatime 0 0
/dev/loop0 /srv/tftp/pxelinux/install iso9660 ro,relatime 0 0
/dev/loop0 /srv/tftp/pxelinux/preseed iso9660 ro,relatime 0 0
$
$ mount
...
/srv/ubuntu-14.04.2-server-amd64.iso on /var/wwwapa/ubuntuinstall type iso9660 (ro,relatime)
/srv/ubuntu-14.04.2-server-amd64.iso on /srv/tftp/pxelinux/install type iso9660 (ro,relatime)
/srv/ubuntu-14.04.2-server-amd64.iso on /srv/tftp/pxelinux/preseed type iso9660 (ro,relatime)
Full information about temporary mounts is kept in the kernel, not necessarily a file. Why do you need a file anyway? The mount command, without parameters, dumps out the mount table just fine.
 
Old 10-18-2015, 10:46 PM   #8
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 5,872

Rep: Reputation: Disabled
Until very recently in Gentoo mtab was a real file, for instance.
 
Old 10-19-2015, 04:05 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
On my Centos 6.7, /etc/mtab is a real file, but as its updated by the kernel, you shouldn't mess with it.
Also, the content lists the same mount pts, but in a different format, from that returned by 'mount' .
 
Old 10-19-2015, 08:16 AM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,957

Rep: Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267
Quote:
Originally Posted by chrism01 View Post
On my Centos 6.7, /etc/mtab is a real file, but as its updated by the kernel, you shouldn't mess with it.
A real file /etc/mtab is not updated by the kernel. It is updated by the mount command itself. If you want to see what the kernel holds internally, look at /proc/mounts .
 
Old 10-19-2015, 08:34 AM   #11
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Check /proc/mounts
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Mounting question... Quads Linux - Newbie 4 04-21-2009 10:49 PM
mounting question andy1974 Linux - Hardware 9 04-01-2008 09:31 AM
question about mounting a new hd sunman Slackware 4 11-24-2005 03:13 AM
mounting question... hollywoodb Linux - Newbie 4 08-26-2003 04:11 PM
Mounting question? blither Linux - General 3 01-20-2003 01:55 AM


All times are GMT -5. The time now is 10:40 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration