Re: Question about inodes

Glynn Clements <[email protected]> Mon, 28 Jul 2008 12:59:16 +0100
Newsgroups gmane.linux.admin,gmane.comp.security.linux
Message-ID <[email protected]>
Lars wrote:

> I've always thought at indes as something uniq on every file on the
> same file system. Today, I saw something weird that tickled my theory
> about this. I found two folders, on the same filesystem that had the
> same indoe. It is inode 1. Here is some info..
> 
> 
> [root@test ~]# ls -lid /sys
> 	1 drwxr-xr-x 11 root root 0 Jul 25 13:06 /sys
> 
> [root@test ~]# ls -lid /dev/pts
> 	1 drwxr-xr-x 2 root root 0 Jul 25 13:06 /dev/pts

Inode numbers are only unique within a filesystem. /sys and /dev/pts
are separate filesystems.

> [root@test ~]# df
> 	Filesystem           1K-blocks      Used Available Use% Mounted on
> 	/dev/mapper/VolGroup00-LogVol00
> 	                      36756152   2138060  32720828   7% /
> 	/dev/hda1               101086     11818     84049  13% /boot
> 	tmpfs                   253652         0    253652   0% /dev/shm

"df" only lists filesystems which correspond to block devices. Use
"mount" or "cat /proc/mounts" for a complete list.

> As you see, both /sys and /dev/pts have the same inode. This is not an
> issue, but a question.
> I can see that the device is not the same on these two files/folders,
> but they are on the same fs..

No they aren't.

/proc, /proc/bus/usb, /sys, /dev, /dev/pts, and /dev/shm are usually
separate filesystems (/dev might not be if you're using static device
files rather than devfs).

-- 
Glynn Clements <[email protected]>
--
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html