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 > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-08-2010, 01:24 AM   #1
sajanagr
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
Display mount table


Hi friends
I am looking to display the mount table of my system using printk.
But I am not able to find the right method.

I am exploring fs/namespace.c file and explored it and came across lookup_mnt function.
I know that a global list is maintained to store the descriptors of the mounted filesystems( vfsmount ), and I am in the process to track and display it.

Any pointers will also be helpful.

Thanks in advance.
 
Old 09-08-2010, 01:32 AM   #2
basheer
Member
 
Registered: Mar 2009
Location: Bangalore, India
Distribution: CentOS6.5, CentOS7, Ubuntu14.04
Posts: 182

Rep: Reputation: 29
Smile

open a terminal

#mount -l (-l is small character L)
 
Old 09-08-2010, 08:35 AM   #3
sajanagr
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by basheer View Post
open a terminal

#mount -l (-l is small character L)
Hi
Thanks for replying but I am looking to print the mount table from the list at kernel space.
 
Old 09-09-2010, 02:30 AM   #4
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
you could try using the proc file system /proc/mounts
 
Old 09-09-2010, 03:00 AM   #5
basheer
Member
 
Registered: Mar 2009
Location: Bangalore, India
Distribution: CentOS6.5, CentOS7, Ubuntu14.04
Posts: 182

Rep: Reputation: 29
Yeah I agree with bsat.
 
Old 09-10-2010, 12:55 AM   #6
sajanagr
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Hi thanks for reply. I think the implementation is similar to displayed by /proc/mounts

Can you tell me what data structure the mount table is stored in (the name of structure) ? and what kind of strucutre it is ?
 
Old 09-11-2010, 01:00 PM   #7
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
I am not sure but you can see in linux/mount.h it might help.
 
  


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
display a row of data from a database in a table format 3vra Programming 2 03-13-2009 10:25 AM
Building a table to display from user input: PHP, MySQL deesto Programming 11 06-11-2008 05:25 PM
Accessing mount table from inside the kernel pranshu1410 Linux - Newbie 2 01-31-2008 08:59 AM
Display file contents in table format dresch Linux - Newbie 1 01-04-2007 09:35 AM
how to redefine the mount table? xpucto Linux - Newbie 5 02-11-2006 10:20 AM

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

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