LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 03-03-2011, 10:14 AM   #1
snowball0916
Member
 
Registered: Mar 2006
Location: China
Distribution: CentOS
Posts: 89

Rep: Reputation: 15
About raw device or raw fs


Hi, all
What is raw device or raw fs?
I have seems some one use dd command to generate a file and he said it would use as raw device for db.

Can someone kindly tell me what it is? And why it can use for db?

Thanks very much,
BR,
Milo
 
Old 03-03-2011, 10:33 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Some years ago I ran a Sun OS/Solaris machine that had Sybase SQL Server installed. It used raw partitions (slices in Solaris terms) to store its database. The DBA said that it was faster than using a standard file system. Evidently the Sybase SQL Server software had its own code that performed the function normally performed by a file system driver.
 
Old 03-03-2011, 11:25 AM   #3
snowball0916
Member
 
Registered: Mar 2006
Location: China
Distribution: CentOS
Posts: 89

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by stress_junkie View Post
Some years ago I ran a Sun OS/Solaris machine that had Sybase SQL Server installed. It used raw partitions (slices in Solaris terms) to store its database. The DBA said that it was faster than using a standard file system. Evidently the Sybase SQL Server software had its own code that performed the function normally performed by a file system driver.
Hi,
As far as I know, raw has no file system on it.
so is that possible to view the data on this raw, if yes ,then how?

Thanks very much,
BR,
Milo
 
Old 03-06-2011, 05:45 PM   #4
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Quote:
Originally Posted by snowball0916 View Post
As far as I know, raw has no file system on it.
That is correct.
Quote:
Originally Posted by snowball0916 View Post
so is that possible to view the data on this raw, if yes ,then how?
It is possible. As my first post said an application can use a raw partition to store data if it also has its own method of storing and retrieving that information.

Also you can find data on a raw partition if it conforms to some recognizable format. In that case you can look for well known headers and end-of-file markers in the files. This is known as file carving.

Consider the case where I have a file named my.jpg and I have a disk where partition sda6 has no file system. I can put the file onto the raw partition as follows:
Code:
dd if=my.jpg of=/dev/sda6
Now the data in the file is stored on the raw partition. If I want to retrieve the file and if I don't know which blocks hold the file data then I can search /dev/sda6 for the file header that starts every jpg file. If the file spans more than one block then hopefully it will be stored on consecutive blocks so I can search each consecutive block on the partition until I find the end of file marker.

Last edited by stress_junkie; 03-06-2011 at 05:50 PM.
 
1 members found this post helpful.
Old 03-08-2011, 04:27 AM   #5
snowball0916
Member
 
Registered: Mar 2006
Location: China
Distribution: CentOS
Posts: 89

Original Poster
Rep: Reputation: 15
Hi, when you said
Quote:
I don't know which blocks hold the file data then I can search /dev/sda6 for the file header that starts every jpg file
Do you mean I can use 'find' command to search this file header or other tools?
Could you kindly provide me an example?
Thanks a lot.

BR,
Milo
 
Old 03-09-2011, 03:45 PM   #6
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Look at this post for more information.

http://www.linuxquestions.org/questi...ommand-362506/

You could also use Google to research file carving although this technique is used for data recovery, not for normal data storage and retrieval.

Last edited by stress_junkie; 03-09-2011 at 03:46 PM.
 
1 members found this post helpful.
Old 03-10-2011, 07:39 AM   #7
snowball0916
Member
 
Registered: Mar 2006
Location: China
Distribution: CentOS
Posts: 89

Original Poster
Rep: Reputation: 15
It's cool. Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RAW device sachinh Programming 2 01-19-2010 01:40 PM
Difference between using Raw block device with O_DIRECT and Raw Character Device srithi Linux - Newbie 1 08-19-2009 10:52 AM
raw device sunnyboy Linux - Software 1 07-10-2009 08:14 PM
raw device I/O sunnyboy Programming 1 07-10-2009 07:52 AM
what is raw device? DataSheet Linux - Newbie 19 01-08-2007 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 05:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration