cancel
Showing results for 
Search instead for 
Did you mean: 

Device files for LVM

sreeIN
Occasional Contributor

Device files for LVM

What is the use of two device files for lvm ??why in /dev/vg00 for the same logical volume it is showing both character and block device
??
can a device be both block and character????
5 REPLIES
Vijaykumar_1
Valued Contributor

Re: Device files for LVM

Read this to understand,

Character devices
Character special files or character devices relate to devices through which the system transmits data one character at a time. These device nodes often serve for stream communication with devices such as mice, keyboards, virtual terminals, and serial modems, and usually do not support random access to data.

In most implementations, character devices use unbuffered input and output routines. The system reads each character from the device immediately or writes each character to the device immediately.

[edit] Block devices
Block special files or block devices correspond to devices through which the system moves data in the form of blocks. These device nodes often represent addressable devices such as hard disks, CD-ROM drives, or memory-regions.

Block devices often support random access and seeking, and generally use buffered input and output routines. The operating system allocates a data buffer to hold a single block each for input and output. When a program sends a request to read data from or to write data to the device, the system stores each character of that data in the appropriate buffer. When the buffer fills up, the appropriate operation takes place (data transfer) and the system clears the buffer.
Kapil Jha
Honored Contributor

Re: Device files for LVM

apart from above explanation,

yes one device can act as both block and character
example, tape device.

You probably should go and read some books to get better picture.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
sreeIN
Occasional Contributor

Re: Device files for LVM

I know about character and block devices my question is why two device files for lvm disk


crw-r----- 1 root sys 64 0x000000 Sep 30 2009 group
brw-r----- 1 root sys 64 0x000001 Jun 14 19:25 lvol1
brw------- 1 root sys 64 0x00000e Jun 24 00:55 lvol10
brw------- 1 root sys 64 0x000010 Jun 24 22:27 lvol100
brw------- 1 root sys 64 0x00000c Jun 17 21:33 lvol12
brw------- 1 root sys 64 0x00000d Jun 19 00:35 lvol13
brw-r----- 1 root sys 64 0x000002 Sep 30 2009 lvol2
brw------- 1 root sys 64 0x00000f Jun 24 02:15 lvol20
brw-r----- 1 root sys 64 0x000003 Sep 30 2009 lvol3
brw-r----- 1 root sys 64 0x000004 Sep 30 2009 lvol4
brw-r----- 1 root sys 64 0x000005 Sep 30 2009 lvol5
brw-r----- 1 root sys 64 0x000006 Sep 30 2009 lvol6
brw-r----- 1 root sys 64 0x000007 Sep 30 2009 lvol7
brw-r----- 1 root sys 64 0x000008 Sep 30 2009 lvol8
brw------- 1 root sys 64 0x000009 Jun 8 17:32 lvol9
brw------- 1 root sys 64 0x00000a Jun 9 06:43 mylog
crw-r----- 1 root sys 64 0x000001 Sep 30 2009 rlvol1
crw------- 1 root sys 64 0x00000e Jun 24 00:55 rlvol10
crw------- 1 root sys 64 0x000010 Jun 24 22:27 rlvol100
crw------- 1 root sys 64 0x00000c Jun 17 21:33 rlvol12
crw------- 1 root sys 64 0x00000d Jun 19 00:35 rlvol13
crw-r----- 1 root sys 64 0x000002 Sep 30 2009 rlvol2
crw------- 1 root sys 64 0x00000f Jun 24 02:15 rlvol20
crw-r----- 1 root sys 64 0x000003 Sep 30 2009 rlvol3
crw-r----- 1 root sys 64 0x000004 Sep 30 2009 rlvol4
crw-r----- 1 root sys 64 0x000005 Sep 30 2009 rlvol5
crw-r----- 1 root sys 64 0x000006 Sep 30 2009 rlvol6
crw-r----- 1 root sys 64 0x000007 Sep 30 2009 rlvol7
crw-r----- 1 root sys 64 0x000008 Sep 30 2009 rlvol8
crw------- 1 root sys 64 0x000009 Jun 8 17:32 rlvol9
crw------- 1 root sys 64 0x00000a Jun 9 06:43 rmylog
crw------- 1 root sys 64 0x00000b Jun 9 06:46 rsree
brw------- 1 root sys 64 0x00000b Jun 9 06:46 sree




EG : lvol1 and rlvol1 ???????



Vijaykumar_1
Valued Contributor

Re: Device files for LVM

Device files are used to communicate with the hardware or a pseudo device such as logical volume.

So it doesnt make any difference to LVM as compared to any hardware or device.

Similarly like other hardware,

/dev/vgnn/lvoln - transmitting data in blocks
/dev/vgnn/rlvoln - transmitting byte_by_byte
Dennis Handly
Acclaimed Contributor

Re: Device files for LVM

>I know about character and block devices my question is why two device files for lvm disk

To have both character and block devices.
Typically the rlvol1 is the "raw" device that bypass the buffer cache.