/sbin/rc0,rc5 and rc6 having same inode numbers


 
Thread Tools Search this Thread
Operating Systems Solaris /sbin/rc0,rc5 and rc6 having same inode numbers
# 1  
Old 09-22-2012
/sbin/rc0,rc5 and rc6 having same inode numbers

Hi All,

While going through the old SUN docs, it occured to me that the run level initiating scripts /sbin/rc0,rc5 and rc6 have the same inode number. I understand they perform the same fuction (call /etc/rc0.d/K* and S* scripts) but still they are three different files and not linked to each other. They all also lie in the same partition. So, how come three different files in the same partition use the same inode number?? Am I missing something here?

Code:
# ls -li /sbin/rc?
     33682 -rwxr--r--   3 root     sys         1983 Jan 21  2005 /sbin/rc0
     33683 -rwxr--r--   1 root     sys         2242 Jan 21  2005 /sbin/rc1
     33684 -rwxr--r--   1 root     sys         2536 Jan 21  2005 /sbin/rc2
     33685 -rwxr--r--   1 root     sys         2567 Jan 21  2005 /sbin/rc3
     33682 -rwxr--r--   3 root     sys         1983 Jan 21  2005 /sbin/rc5
     33682 -rwxr--r--   3 root     sys         1983 Jan 21  2005 /sbin/rc6
     33686 -rwxr--r--   1 root     sys         5125 Jan 21  2005 /sbin/rcS

Observe that rc0, rc5 and rc6 have the same inode number 33682 and the link count is 3.
# 2  
Old 09-22-2012
I have never used Solaris. But, those seem like hard links. Hard links will have the same inode number. All those 3 names will be referring to the same physical location on disk. Basically, you use the 3 names to refer to the same thing. This is esp. used when you want something (script,etc.) to do different things and these "different" things do not differ much and so it does not warrant creation of separate scripts for the "different" things. So, you use only 1 copy and do these "different" things depending on the name the script is called with.

Last edited by elixir_sinari; 09-22-2012 at 09:01 AM..
# 3  
Old 09-22-2012
Smilie Correct! Forgot that.. that is why the link counter is 3
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Solaris

How to increase Inode numbers in Solaris 10

Hi guys, need your help on this since i dont know much about solaris. the problem is i need to increase inodes space on /export/home/ root@BRF-DANCCM1 # /usr/ucb/df -i Filesystem iused ifree %iused Mounted on /dev/vx/dsk/bootdg/rootvol 53026 1162206 ... (7 Replies)
Discussion started by: ichiko
7 Replies

2. Solaris

different between /sbin/init and /usr/sbin/init

root@test09 # ls -al /sbin/init -r-xr-xr-x 1 root sys 550000 Jun 29 2002 /sbin/init root@test09 # ls -al /usr/sbin/init -r-xr-xr-x 1 root sys 37100 Jun 29 2002 /usr/sbin/init (2 Replies)
Discussion started by: userking
2 Replies
Login or Register to Ask a Question