When writing to a file, does all the pages in memory map to contiguous disk blocks in the Disk?
I am interested in knowing how the Filesystem actually writes the files to disk? Does it write it in all contiguous blocks and store the starting block# and device# in the file as metadata? If they are not stored as contiguous blocks (which I think is the case) then how does it determine the disk blocks so that the read times are optimized?
That's entirely filesystem dependent, there is no general answer.
Here's a good presentation: ext3 on-disk layout for the EXT3 filesystem. Others might do it similarly, or completely differently. Have a look at The structure of the Reiser file system for the reiserfs 3.6 layout.
For a rather different approach, look at XFS on-disk specification.
The ext2 disk organization could probably be described as a "classic" way of doing things that could be found in other filesystems (including its successors).
精彩评论