sys-blog

IT Cookbooks

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

Introducing the Solaris 10 OS Directory Hierarchy

E-mail Print PDF

A file name is associeted with an inode, & an inode provides access to data blocks

 

 

File Name

Inode Number

Data Blocks

 

 

Inode (1028 bytes)

  1. information about the file -> owner, permissions, size
  2. pointer to data blocks

 

Data Blocks

units of disk space that are used to store data

 

 

==================================================================

4 main types of files

 

  1. regular
  2. directory
  3. symbolik links
  4. device files (do not use data blocks)

 

 

- regular

d directories

l symbolic link

b block special device files

c character spacial device files

 

 

 

 

==================================================================

ln -s file1 link1

 

==================================================================

DEVICE FILES

/devices/pci@0,0

 

0 crw-rw-rw-   1 root     root      62,  1 Apr 13 11:05 pci8086,1e@3:e1000g0

 

62 mayor device number -> device driver required to access a device

1 minor dvice number -> specific unit of the type that the device driver controls

 

 

devfsadm

 

create new devices

 

 

devfsadm, devfsadmd - administration command for /dev

 

 

 

 

modinfo -w | grep e1

35 feb60484   1e14   -   1  busra (Bus Resource Allocator (BUSRA))

56 febe12e0   1b30  19   1  objfs (kernel object filesystem)

162 f93de000  2c0c4  62   1  e1000g (Intel PRO/1000 Ethernet)

 

modinfo -c | grep -w '162'

162          1 e1000g                           LOADED/INSTALLED

 

 

Device files

  1. character special (c) -> data stream
  2. block special (b) -> disk devices - I/O operations

 

-------------------------------------------------------------------------------------

The modinfo utility displays information  about  the  loaded

modules. The format of the information is as follows:

 

Id Loadaddr Size Info Rev Module Name

 

-c              Display  the  number  of  instances  of  the

module   loaded  and  the  module's  current

state.

 

-i module-id    Display information about this module only.

 

-w              Do not truncate  module  information  at  80

characters.

 

 

==================================================================

Hard Links

 

ls -l

2 drwxr-xr-x   6 root     root         512 Mar  9  2009 Documents

 

6 hard links

 

ls -l

-rw-r--r--   1 root     root          46 Nov  6 12:16 archivo.Z

-rw-r-----   1 root     root          29 Jun  3  2009 archivo2.gz

-rw-r--r--   1 root     root          34 Nov  6 15:28 archivo3.gz

-rw-r--r--   1 root     root           6 Apr 13 10:53 archivo4.txt

 

ln archivo.Z archivo2.Zz

-rw-r--r--   2 root     root          46 Nov  6 12:16 archivo.Z

-rw-r--r--   2 root     root          46 Nov  6 12:16 archivo2.Zz

-rw-r-----   1 root     root          29 Jun  3  2009 archivo2.gz

-rw-r--r--   1 root     root          34 Nov  6 15:28 archivo3.gz

-rw-r--r--   1 root     root           6 Apr 13 10:53 archivo4.txt

 

ls -li

368404 -rw-r--r--   2 root     root          46 Nov  6 12:16 archivo.Z

368404 -rw-r--r--   2 root     root          46 Nov  6 12:16 archivo2.Zz

368713 -rw-r-----   1 root     root          29 Jun  3  2009 archivo2.gz

368714 -rw-r--r--   1 root     root          34 Nov  6 15:28 archivo3.gz

368753 -rw-r--r--   1 root     root           6 Apr 13 10:53 archivo4.txt

 

inode 368404 has 2 hard links

 

find . -inum 368404

./archivo2.Zz

./archivo.Z

 

 

 

rm archivo.Z

 

 

 

ls -li /etc/init.d/apache

20073 -rwxr--r--   6 root     sys         2455 Jan  7  2009 /etc/init.d/apache

 

6 hard links

 

Cuales son sus hard links?

 

find /etc -inum 20073 -exec ls -i {} \;

20073 /etc/init.d/apache

20073 /etc/rc0.d/K16apache

20073 /etc/rc1.d/K16apache

20073 /etc/rc2.d/K16apache

20073 /etc/rc3.d/S50apache

20073 /etc/rcS.d/K16apache

 

find /etc -inum 20073

/etc/init.d/apache

/etc/rc0.d/K16apache

/etc/rc1.d/K16apache

/etc/rc2.d/K16apache

/etc/rc3.d/S50apache

/etc/rcS.d/K16apache

 

 

bash-3.2# mkdir testdir

bash-3.2# cd testdir/

bash-3.2# touch file1

bash-3.2# ln -s file1 link1

bash-3.2# ls -li

total 2

114806 -rw-r--r--   1 root     root           0 Apr 13 17:00 file1

114808 lrwxrwxrwx   1 root     root           5 Apr 13 17:00 link1 -> file1

 

 

symbolic links have different inode number

 

 

 

bash-3.2# mkdir newdir

bash-3.2# ls -ldi newdir

114809 drwxr-xr-x   2 root     root         512 Apr 13 17:03 newdir

 

bash-3.2# ls -lia newdir/

total 4

114809 drwxr-xr-x   2 root     root         512 Apr 13 17:03 .

114803 drwxr-xr-x   3 root     root         512 Apr 13 17:03 ..

 

 

==================================================================

Question:

One of your disks is almost full, so you decide to look for files that can be removed. In the file system,

you find a directory with this content

#ls -li

total 33570624

268566 -rw---------5 bin bin 4294967296 Jan 23 11:59 file1

268566 -rw---------5 bin bin 4294967296 Jan 23 11:59 file2

268566 -rw---------5 bin bin 4294967296 Jan 23 11:59 file3

268566 -rw---------5 bin bin 4294967296 Jan 23 11:59 file4

How much disk space can you reclaim by removing these files?

 

A. 0 bytes *

B. 33,570,624 bytes

C. 4,294,967,296 bytes

D. 17,179,869,184 bytes

 

tienen 5 hard links, habria que borrar todos los hard links

==================================================================

Hard Link

allows two or more names for the same file, but the file name must be located within the same file system

 

Symbolic Link

allows a file or directory name to reference another file or directory name anywhere in the logical file tree

 

block device

suports read & write operations o a file system

 

character device

transfer data to & from a device as a stream of bytes

 

==================================================================

Question:

A user's home directory contains unnecessary flies that the user wants to delete. The ls -li command

presents the following output:

total 4

83215 -rw-r-r-- 2 userr1 other 180 May 7 12:11 file1

83215 -rw-r-r-- 2 userr1 other 180 May 7 12:11 file2

Which two occur when removing file2? (Choose two)

 

A. Both file1 and file2 are removed.

B. The link count value of file1 remains 2.

C. The link count value if file1 decreases to 1.

D. The file1 file no linger provides access to data.

E. The file1 file remains and continues to provide access to data.

 

 

 











Add comment


Security code
Refresh

You are here: OS Solaris Certification Introducing the Solaris 10 OS Directory Hierarchy