1824981 Members
3773 Online
109678 Solutions
New Discussion юеВ

block i/o and file i/o

 
Gourab Baksi
Occasional Contributor

block i/o and file i/o

What is the difference between block i/o (as in case of a SAN device) and file i/o (as in case of a NAS device)?

Why is block i/o faster than file i/o?
2 REPLIES 2
mmax
Valued Contributor

Re: block i/o and file i/o

Hi.
Block IO is faster because the block level is under file (file system) layer.

when you are writing to file it looks like

FILE IO to file system
--------
Volume manager layer (if it's implemented)
manage RAID level or extending/reducing volumes etc.
--------
BLOCK IO where it's written to block device


When you are writing to block device you're skipping through file system and volume manager layer then it's faster to write direct to block, but managment of block layer is not so nice like on file system which gives added value to you.
Bill Costigan
Honored Contributor

Re: block i/o and file i/o

File I/O is built on top of block I/O.

An application makes file I/O calls (e.g. open a file, read a record, create a directory)

A file system takes these file I/O requests and returns the records or performs the actions. Often this requires the file system to read and write blocks of data to disks. These are block I/Os.

File I/Os do more work so they are somewhat slower. Also a single file I/O might require a number of block I/Os.

A SAN device looks like disk drives, They don't have any concept of files or directories. The just know disk blocks.

A NAS devices has filesystem software on it and understands things like files, directories, and file records.