Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Why inode number of /sys and /proc are same?

227 views
Skip to first unread message

Yoshi

unread,
Nov 22, 2009, 12:26:20 AM11/22/09
to
Hello, I just found that inode number of /sys and /proc are both 1.
And could not figure out why? Does anyone know the reason? I'm using
Ubuntu8.0.4, kernel 2.6.24 as follows:


hiro@HOGE2:/$ uname -a
Linux HOGE2 2.6.24-23-generic #1 SMP Wed Apr 1 21:47:28 UTC 2009 i686
GNU/Linux
hiro@HOGE2:/$ pwd
/
hiro@HOGE2:/$ stat proc sys
File: `proc'
Size: 0 Blocks: 0 IO Block: 1024 directory
Device: 3h/3d Inode: 1 Links: 134
Access: (0555/dr-xr-xr-x) Uid: ( 0/ root) Gid: ( 0/
root)
Access: 2009-11-21 17:33:47.084005250 -0800
Modify: 2009-11-21 17:33:47.084005250 -0800
Change: 2009-11-21 17:33:47.084005250 -0800
File: `sys'
Size: 0 Blocks: 0 IO Block: 4096 directory
Device: 0h/0d Inode: 1 Links: 12
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/
root)
Access: 2009-11-21 21:07:17.074863249 -0800
Modify: 2009-11-21 17:33:48.368013899 -0800
Change: 2009-11-21 17:33:48.368013899 -0800


Thank you
--
Yoshi

Lew Pitcher

unread,
Nov 22, 2009, 12:46:48 AM11/22/09
to
On November 22, 2009 00:26, in alt.os.linux, Yoshi (hiro...@gmail.com)
wrote:

> Hello, I just found that inode number of /sys and /proc are both 1.
> And could not figure out why? Does anyone know the reason? I'm using
> Ubuntu8.0.4, kernel 2.6.24 as follows:

Both the /sys and /proc filesystems are generated "on the fly" by the Linux
kernel; neither are recorded on medium anywhere.

Because they are generated "on the fly" by the kernel, the kernel can take
some liberties with their internal structure that it cannot with "real"
filesystems. In this case, both the /sys and /proc filesystems use inode #1
on their respective "devices".


--
Lew Pitcher
Master Codewright & JOAT-in-training | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
---------- Slackware - Because I know what I'm doing. ------


Yoshi

unread,
Nov 22, 2009, 2:01:05 AM11/22/09
to
On 11月21日, 午後9:46, Lew Pitcher <lpitc...@teksavvy.com> wrote:
> On November 22, 2009 00:26, in alt.os.linux, Yoshi (hirot...@gmail.com)

> wrote:
>
> > Hello, I just found that inode number of /sys and /proc are both 1.
> > And could not figure out why? Does anyone know the reason? I'm using
> > Ubuntu8.0.4, kernel 2.6.24 as follows:
>
> Both the /sys and /proc filesystems are generated "on the fly" by the Linux
> kernel; neither are recorded on medium anywhere.
>
> Because they are generated "on the fly" by the kernel, the kernel can take
> some liberties with their internal structure that it cannot with "real"
> filesystems. In this case, both the /sys and /proc filesystems use inode #1
> on their respective "devices".
>

Yes, it seems that each file system has it's own inode list, so no
wonder that different mounted filesystem has same inode number. And
when I check each mount point on my system, the inode is sometime 1,
sometime not 1.

--
Yoshi


Jasen Betts

unread,
Nov 22, 2009, 3:20:33 AM11/22/09
to
On 2009-11-22, Yoshi <hiro...@gmail.com> wrote:
> Hello, I just found that inode number of /sys and /proc are both 1.

something to do with them not being real filesystems, but virtual
filesystems generated by the kernel,
I get inode 2 for the root of real filesystems.

Yoshi

unread,
Nov 22, 2009, 3:40:03 AM11/22/09
to
On Nov 22, 12:20 am, Jasen Betts <ja...@xnet.co.nz> wrote:

Then I wonder where is the inode 1 - file in that filesytem...

--
Yoshi

0 new messages