Académique Documents
Professionnel Documents
Culture Documents
1.
Directory - special file stores file name(s) (hard link) and inodes.
Every entry in a directory constitutes a hard link.
2.
Links
hard link file name association to inode. Cannot span multiple file systems.
more than one name is allowed (link count).
A hard link is a pointer to a file and is indistinguishable from the original directory entry
Examle: different names, same inode 70, link count is 3.
cd /usr/bin;
ls -li cp mv ln
70 -r-xr-xr-x 3 root bin
27360 Jan 24 2007 cp*
70 -r-xr-xr-x 3 root bin
27360 Jan 24 2007 ln*
70 -r-xr-xr-x 3 root bin
27360 Jan 24 2007 mv*
In Berkley file system opened files inodes are cached dnlc (directory name lookup cache)
touch ./file1;
To create a new directory entry called file2
ln file1 file2;
ls -li
total 4
12091 drwxr-xr-x 2 root root
512 Sep 22 12:03 ./
2 drwxr-xr-x 25 root root
1024 Sep 22 12:02 ../
12095 -rw-r--r-- 2 root root
0 Sep 22 12:03 file1
12095 -rw-r--r-- 2 root root
0 Sep 22 12:03 file2
find . -inum 12095
./file1
./file2
symbolic link a file containing a path to another file. Can span multiple file systems.
ln -s file2 link1
ls -l
drwxr-xr-x 2 root root
drwxr-xr-x 25 root root
-rw-r--r-- 2 root root
-rw-r--r-- 2 root root
lrwxrwxrwx 1 root root
A major device number 267 identifies the specific device driver required to access the device.
modinfo -w | grep -w 267
24 129d660 3a10 267 1 pxb_plx (PCIe/PCI nexus driver 1.25)
A minor device number 255 identifies the specific unit of the type that the device driver controls.
A reconfiguration reboot creates device files and symbolic links to them.
devfsadm command
- attempts to load every driver and attach all possible device instances.
- for new devices found creates physical device files in /devices in memory system directory and
symbolic links in the /dev directory.
- maintains /etc/path_to_inst file.
Character-Special device files. Data access as a data stream.
Block-Special device files
Call for I/O operations based on defined block size.
-Faster - Data transferred between a process and a block special device is first stored in a kernel managed
memory based cache.
-Allow random seeks to be performed.