1832305 Members
2026 Online
110041 Solutions
New Discussion

raw device and raw data

 
SOLVED
Go to solution
KCS_1
Respected Contributor

raw device and raw data

Hi,everyone!!

I know that usally used in database.
could you tell me what's means raw device and raw data?

thanks~
Easy going at all.
4 REPLIES 4
harry d brown jr
Honored Contributor
Solution

Re: raw device and raw data

A raw device, like those typically used by databases is a disk that does not have a file system on it. The databases typically use the "character" device to read and write what they want anywhere on the disk.

Raw data is data that is or isn't necessarily human readable. For instance a program.

live free or die
Live Free or Die
Michael Tully
Honored Contributor

Re: raw device and raw data

Hi,

The term 'raw' is used because you can't actually see the data through standard tools, like 'ls' etc. You need a front-end database to view/modify the data etc

The term 'cooked' means that the logical volume
that has been created is mounted with a filesystem.

The 'raw' partition or logical volume(s) are used traditionally by databases so that they by-pass any filesystem overhead and contention. You will see that each and every database will have a different recommendation, informix leaning toward raw and oracle toward filesystem. Also note that these same vendors change their recommendation frequently. Below is a fairly good discussion on raw v's cooked performance.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xb51a8ffa98a2d5118ff10090279cd0f9,00.html

HTH
~Michael~
Anyone for a Mutiny ?
steven Burgess_2
Honored Contributor

Re: raw device and raw data

Patrick

A raw device is also interpreted as a character device. I/O to the devices is performed one character at a time.

This is how I understand it

Hope this helps

Steve
take your time and think things through
Tim D Fulford
Honored Contributor

Re: raw device and raw data

The above stuff is great. I'm just wondering why you might want to know. I expect that there are two reasons

a) Database uses raw stuff (covered above)
b) people may have suggested a raw copy of a "cooked" filesystem. (not covered)

It may seem ironic but you can copy the raw devices of cooked filesystems to speed things up. I usually do this for upgrades.

e.g /dev/vg00/lvol4 is mounted on /home

If I want to get a copy of this I could make a new filesystem & copy one to the other OR the super quick way

lvcreate -L -n newhome vgnew
dd if=/dev/vg00/rlvol4 bs=64k of=/dev/vgnew/rnewhome
mkdir /newhome
mount /dev/newhome /newhome

bs==Blocksize
Note the rlvol4 & rnewhome (Raw lvols)

obviously the two lvols will need to be the same size but it by-passes the "front-end" (to borrow an above phrase) so speeds things up considerably.

after the dd you can mount the new lvol, again bypassing newfs etc, so

Tim

-