nothing is broken.. I am just trying to understand how it works.
(ok, and I am preparing for an O.S. exam at the openu.ac.il)

I was thinking about block special files, and realized that I
don't know a system call to read a specific block from a file.
(I suspect it is 'read'??)

I thought 'fsck' probably uses such a system call, but I havent
found out yet:

1) couldnt find fsck sources. (probably I don't have them)
2) I tried to use strace on fsck, but I don't see a system call 
reading from the filesystem (/dev/hda5) at all. how does it check 
the partition, then? 
is this maybe a technicality of strace? same reason that it doesn't
show the exec() after the fork()?

Thanks!!


$> strace fsck -Vnf /dev/hda5
tail of the output:

open("/etc/fstab", O_RDONLY)            = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=258, ...}) = 0
brk(0x8009000)                          = 0x8009000
read(3, "/dev/hda3        /        ext2  "..., 4096) = 258
brk(0x800a000)                          = 0x800a000
brk(0x800b000)                          = 0x800b000
brk(0x800c000)                          = 0x800c000
read(3, "", 4096)                       = 0
close(3)                                = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=2228, ...}) = 0
brk(0x800d000)                          = 0x800d000
stat("/sbin/fsck.ext2", 0xbffff9e0)     = -1 ENOENT (No such file or
directory)
stat("/sbin/fs.d/fsck.ext2", 0xbffff9e0) = -1 ENOENT (No such file or
directory)
stat("/sbin/fs/fsck.ext2", 0xbffff9e0)  = -1 ENOENT (No such file or
directory)
stat("/etc/fs/fsck.ext2", {st_mode=S_IFREG|0750, st_size=69252, ...}) =
0
fork()                                  = 352
wait4(-1, e2fsck 0.5b, 14-Feb-95 for EXT2 FS 0.5a, 95/03/19
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/hda5: 18/13104 files, 1701/52384 blocks
[WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 352
--- SIGCHLD (Child exited) ---
write(1, "Parallelizing fsck version 0.5b "..., 89Parallelizing fsck
version 0.5b (14-Feb-95)
[/etc/fs/fsck.ext2] fsck.ext2 -nf /dev/hda5 
) = 89
_exit(0)                                = ?


-- 
Christoph Bugel         [EMAIL PROTECTED]

Reply via email to