Why were "block devices" dropped?

Pegasus711

Member

Reaction score: 4
Messages: 58

I am a relative noob to the storage world in general and FreeBSD in particular. OF what I have been learning of late, I have become somewhat familiar with such concepts like disk queuing, IOPs, latencies and the likes
I am also reading the classic 'The design and implementation of the FreeBSD operating system'. However of what I am reading, FreeBSD has "done away" with "block devices" altogether

Of what I have been reading in that book and elsewhere it appears that the "block" devices have been dropped out of the architecture. So what I, with my (still) very limited knowledge of storage, understand this as there are no drivers in FreeBSD that would deal with blocks of data.

But when I check the disk nodes under /dev I get this
Code:
ls -l /dev/*disk0
brw-r----- 1 root operator 14, 0 Jan 2 09:39 /dev/disk0
crw-r----- 1 root operator 14, 0 Jan 2 09:39 /dev/rdisk0
where 'b' means block interface and 'c' means char or raw interface. So how do I reconcile this with what I read about "block devices being gone" before. What does 'block' mean here?

Of what I know, the block device would be served through the "page cache" (a place where file system caches it's data and meta data) where as the raw device would be served via the "buffer cache" where "disk blocks" are cached by the OS. Thus a block device would be served via the file system where as the raw device won't. Is this correct?? If yes, then what does 'block' above signify? Or rephrasing the question, what was there earlier in FreeBSD before 'block device support' was dropped?

I am sure seasoned storage veterans would have a lot more to add. I would be highly obliged if some one could please elaborate and add more context to it.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,371
Messages: 29,907

This explains it rather well:
Other UNIX® systems may support a second type of disk device known as block devices. Block devices are disk devices for which the kernel provides caching. This caching makes block-devices almost unusable, or at least dangerously unreliable. The caching will reorder the sequence of write operations, depriving the application of the ability to know the exact disk contents at any one instant in time.
https://www.freebsd.org/doc/en/books/arch-handbook/driverbasics-block.html
 
Top