01 July 2008

Raw devices & Block devices

Most of the people will get confused when to use /dev/dsk/c0t1d0s7 and /dev/rdsk/c0t1d0s7 device files.

Generally /dev/dsk is a block disk device whereas /dev/rdsk is a character disk device

As a thumb rule raw devices are used before filesystem creation.Block devices are user after filesystem creation.

E.g., In Solaris whenever you create a new slice using format command a raw physical slice or a Raw Device will be created which is addressed as /dev/rdsk/c#t#d#s#
After formatting it with newfs command the slice will be addressed as /dev/dsk/c#t#d#s# which can now be used for mounting.

newfs /dev/rdsk/c0t1d0s4
mkdir /oracle
mount /dev/dsk/c0t1d0s4 /oracle

After mounting /dev/dsk/c#t#d#s# is called as Block Device