Upload
karson-harvey
View
220
Download
0
Embed Size (px)
Citation preview
Fichiers et systèmes de fichiers 1.1
Fichiers et Systèmes de fichiers
Fichiers et systèmes de fichiers 1.2
Lister les numéros d ’inode
alpha12.couveep$ ls -il
total 5896
2090 -rwxr-xr-x 1 couveep frec 657 Jan 10 2000 Approve
2072 -rwxr--r-- 1 couveep frec 36 Jun 26 1996 colog
2073 -rwxr-xr-x 1 couveep frec 501 Feb 05 1997 escale
2074 -rw-r--r-- 1 couveep frec 2967138 Nov 21 1997 gsv22w32.exe
2071 -rwxr--r-- 1 couveep frec 85 Mar 05 1998 infoServer
2078 -rwxr-xr-x 1 couveep frec 95 Mar 17 1998 lanoffice
2077 -rwxr-xr-x 1 couveep frec 423 Feb 10 1998 wnc2checkb
2075 -rwxr-xr-x 1 couveep frec 646 Feb 10 1998 wnc2doc
2076 -rwxr-xr-x 1 couveep frec 1070 Feb 10 1998 wnc2waitb
2079 -rwxr-xr-x 1 couveep frec 9164 Mar 27 12:55 xd
2070 -rwxr--r-- 1 couveep frec 73 Apr 17 1997 xemacs
Fichiers et systèmes de fichiers 1.3
Fichier de type répertoire
alpha12.couveep$ xd .00000000: 08152E00 00000000 00000000 00000000 ................00000010: 00022E2E 00000000 00000000 00000000 ................00000020: 08167865 6D616373 00000000 00000000 ..xemacs........00000030: 0817696E 666F5365 72766572 00000000 ..infoServer....00000040: 0818636F 6C6F6700 00000000 00000000 ..colog.........00000050: 08196573 63616C65 00000000 00000000 ..escale........00000060: 081A6773 76323277 33322E65 78650000 ..gsv22w32.exe..00000070: 081B776E 6332646F 63000000 00000000 ..wnc2doc.......00000080: 081C776E 63327761 69746200 00000000 ..wnc2waitb.....00000090: 081D776E 63326368 65636B62 00000000 ..wnc2checkb....000000A0: 081E6C61 6E6F6666 69636500 00000000 ..lanoffice.....000000B0: 081F7864 00000000 00000000 00000000 ..xd............000000C0: 082A4170 70726F76 65000000 00000000 .*Approve.......
Fichiers et systèmes de fichiers 1.4
Lien sur un fichier
alpha12.couveep$ ln xd hexadump
alpha12.couveep$ ls -il
total 5920
2090 -rwxr-xr-x 1 couveep frec 657 Jan 10 2000 Approve
2072 -rwxr--r-- 1 couveep frec 36 Jun 26 1996 colog
2073 -rwxr-xr-x 1 couveep frec 501 Feb 05 1997 escale
2074 -rw-r--r-- 1 couveep frec 2967138 Nov 21 1997 gsv22w32.exe
2079 -rwxr-xr-x 2 couveep frec 9164 Mar 27 12:55 hexadump
2071 -rwxr--r-- 1 couveep frec 85 Mar 05 1998 infoServer
2078 -rwxr-xr-x 1 couveep frec 95 Mar 17 1998 lanoffice
2077 -rwxr-xr-x 1 couveep frec 423 Feb 10 1998 wnc2checkb
2075 -rwxr-xr-x 1 couveep frec 646 Feb 10 1998 wnc2doc
2076 -rwxr-xr-x 1 couveep frec 1070 Feb 10 1998 wnc2waitb
2079 -rwxr-xr-x 2 couveep frec 9164 Mar 27 12:55 xd
2070 -rwxr--r-- 1 couveep frec 73 Apr 17 1997 xemacs
Fichiers et systèmes de fichiers 1.5
Contenu du répertoire
alpha12.couveep$ xd -c .00000000: 08 15 2E 00 00 00 00 00 00 00 00 00 00 00 00 00 ................00000010: 00 02 2E 2E 00 00 00 00 00 00 00 00 00 00 00 00 ................00000020: 08 16 78 65 6D 61 63 73 00 00 00 00 00 00 00 00 ..xemacs........00000030: 08 17 69 6E 66 6F 53 65 72 76 65 72 00 00 00 00 ..infoServer....00000040: 08 18 63 6F 6C 6F 67 00 00 00 00 00 00 00 00 00 ..colog.........00000050: 08 19 65 73 63 61 6C 65 00 00 00 00 00 00 00 00 ..escale........00000060: 08 1A 67 73 76 32 32 77 33 32 2E 65 78 65 00 00 ..gsv22w32.exe..00000070: 08 1B 77 6E 63 32 64 6F 63 00 00 00 00 00 00 00 ..wnc2doc.......00000080: 08 1C 77 6E 63 32 77 61 69 74 62 00 00 00 00 00 ..wnc2waitb.....00000090: 08 1D 77 6E 63 32 63 68 65 63 6B 62 00 00 00 00 ..wnc2checkb....000000A0: 08 1E 6C 61 6E 6F 66 66 69 63 65 00 00 00 00 00 ..lanoffice.....000000B0: 08 1F 78 64 00 00 00 00 00 00 00 00 00 00 00 00 ..xd............000000C0: 08 2A 41 70 70 72 6F 76 65 00 00 00 00 00 00 00 .*Approve.......000000D0: 08 1F 68 65 78 61 64 75 6D 70 00 00 00 00 00 00 ..hexadump......
Fichiers et systèmes de fichiers 1.6
Création d’un système de fichiersalpha12.couveep$ man mkfs
mkfs Command
Purpose
Makes a file system.
Syntax
mkfs [ -b Boot ] [ -l Label ] [ -i i-Nodes ] [ -o Options ] [ -p Prototype ] [-s Size ] [ -v VolumeLabel ] [ -V VfsName ] Device
Description
The mkfs command makes a new file system on a specified device. The mkfs command initializes the volume label, file system label, and startup block.
dev Device name
-v vol Volume ID
-s size File system size
-b boot Program to be installed in the startup block
-V vfs Definition of the virtual file system
-b Boot Names the program to be installed in block 0 of the new file system.
-i i-Nodes Specifies the initial number of i-nodes on the file system.
-l Label Specifies the file system label for the new file system.
-o Options Specifies a comma-separated list of virtual file system implementation-specific options.
Fichiers et systèmes de fichiers 1.7
Sous Windows
Fichiers et systèmes de fichiers 1.8
Le même sous UNIX...
>mount -v cdrfs /dev/cd0 /cdrom>cd /cdrom>ls -iltotal 41983655296 -r-xr-xr-x 1 root system 170 Oct 2 1996 autorun.inf57344 -r-xr-xr-x 1 root system 39936 Oct 1 1996 autozoo.exe53248 -r-xr-xr-x 1 root system 417 Oct 28 1996 autozoo.inf10758144 -r-xr-xr-x 1 root system 40258 Dec 11 1994 he.bmp10799104 -r-xr-xr-x 1 root system 60576 Nov 12 1996 install.exe10860544 -r-xr-xr-x 1 root system 3810 Oct 28 1996 install.inf10864640 -r-xr-xr-x 1 root system 132406 Oct 17 1996 puttzoo.bmp10997760 -r-xr-xr-x 1 root system 34816 Oct 16 1996 puttzoo.exe11032576 -r-xr-xr-x 1 root system 42070 Nov 18 1996 puttzoo.he011075584 -r-xr-xr-x 1 root system 98120877 Nov 18 1996 puttzoo.he1109197312 -r-xr-xr-x 1 root system 49893769 Nov 18 1996 puttzoo.he2159092736 -r-xr-xr-x 1 root system 36864 Jun 13 1995 puttzoo.he3159129600 -r-xr-xr-x 1 root system 65940986 Nov 6 1996 puttzoo.he4225071104 -r-xr-xr-x 1 root system 304160 Nov 18 1996 puttzoo.hlp225376256 -r-xr-xr-x 1 root system 413 Oct 28 1996 puttzoo.inf225378304 -r-xr-xr-x 1 root system 286720 Nov 12 1996 puttzoo.w32225665024 -r-xr-xr-x 1 root system 1285 Nov 7 1996 sndcards.inf98304 dr-xr-xr-x 2 root system 2048 Nov 19 1996 system1263224832 -r-xr-xr-x 1 root system 0 Oct 17 1996 testit.bpt
Fichiers et systèmes de fichiers 1.9
Le lien symbolique
alpha12.couveep$ ln -s /tmp/toto tataalpha12.couveep$ ls -iltotal 5896 2090 -rwxr-xr-x 1 couveep frec 657 Jan 10 2000 Approve 2072 -rwxr--r-- 1 couveep frec 36 Jun 26 1996 colog 2073 -rwxr-xr-x 1 couveep frec 501 Feb 05 1997 escale 2074 -rw-r--r-- 1 couveep frec 2967138 Nov 21 1997 gsv22w32.exe 2071 -rwxr--r-- 1 couveep frec 85 Mar 05 1998 infoServer 2078 -rwxr-xr-x 1 couveep frec 95 Mar 17 1998 lanoffice 2091 lrwxrwxrwx 1 couveep frec 9 Mar 27 14:12 tata -> /tmp/toto 2077 -rwxr-xr-x 1 couveep frec 423 Feb 10 1998 wnc2checkb 2075 -rwxr-xr-x 1 couveep frec 646 Feb 10 1998 wnc2doc 2076 -rwxr-xr-x 1 couveep frec 1070 Feb 10 1998 wnc2waitb 2079 -rwxr-xr-x 1 couveep frec 9164 Mar 27 12:55 xd 2070 -rwxr--r-- 1 couveep frec 73 Apr 17 1997 xemacsalpha12.couveep$ ls -il /tmp/toto 62 -rw-r--r-- 1 couveep frec 5 Mar 27 14:12 /tmp/totoalpha12.couveep$ xd -b tata00000000: 74 6F 74 6F 0A titi.
Fichiers et systèmes de fichiers 1.10
Structure bufstruct buf { /* buffer header */
__long64_t b_flags; /* flag word (see defines below) */
#define B_WRITE (long)0x0000 /* non-read pseudo-flag */
#define B_READ (long)0x0001 /* read when I/O occurs */
#define B_DONE (long)0x0002 /* I/O complete */
#define B_ERROR (long)0x0004 /* error detected */
#define B_BUSY (long)0x0008 /* in use or I/O in progress */
struct buf *b_forw; /* hash list forward link */
struct buf *b_back; /* hash list backward link */
struct buf *av_forw; /* free list forward link */
struct buf *av_back; /* free list backward link */
void (*b_iodone)(); /* ptr to iodone routine */
struct vnode *b_vp; /* vnode associated with block */
dev_t b_dev; /* major+minor device name */
daddr_t b_blkno; /* block # on device or in file */
caddr_t b_addr; /* buffer address */
__ulong64_t b_bcount; /* transfer count, OR */
/* #blks in list (bfreelist only) */
char b_error; /* returned after I/O */
__ulong64_t b_resid; /* words not xferred after error */
__long64_t b_work; /* work area for device drivers */
tid_t b_event; /* anchor for event list */
struct timestruc_t b_start; /* request start time */
}
Fichiers et systèmes de fichiers 1.11
Mesure du temps d’exécution
# time find /usr -type f -print > /dev/null
real 0m18.94s
user 0m0.29s
sys 0m3.44s
#
# time find /usr -type f -print > /dev/null
real 0m1.47s
user 0m0.14s
sys 0m1.32s
#