# Raw data usb

## ev56o

Hi!

I like to know if there is a way for read/write data from a usb memory mass in raw format. Perhaps (if necessary) no mount the device. For raw data i mean something under the partition standard (lower level) and manipulate out of the standard of the file system.

----------

## DaggyStyle

 *ev56o wrote:*   

> Hi!
> 
> I like to know if there is a way for read/write data from a usb memory mass in raw format. Perhaps (if necessary) no mount the device. For raw data i mean something under the partition standard (lower level) and manipulate out of the standard of the file system.

 

how about dd?

----------

## John R. Graham

All attached block devices under *nix can be read raw. In /dev/ you'll see the raw devices underneath the partitioned devices. For instance, for a given USB drive, you might see /dev/sdb, /dev/sdb1. The sdb1 is the 1st partition on the device and sdb is the raw device.

- John

----------

## ev56o

Yes, but if i perform cat /dev/sdb i have a lot of symbols that aren' t usable. How to do for edit a text file (for example) stored in the device through raw?

----------

## DaggyStyle

 *ev56o wrote:*   

> Yes, but if i perform cat /dev/sdb i have a lot of symbols that aren' t usable. How to do for edit a text file (for example) stored in the device through raw?

 

you really need to read about file systems.

----------

## John R. Graham

 *ev56o wrote:*   

> Yes, but if i perform cat /dev/sdb i have a lot of symbols that aren' t usable. How to do for edit a text file (for example) stored in the device through raw?

 You say that like you're surprised. The filesystem driver stores all sorts of binary metadata on the raw device. Without the help of the filesystem driver, you need to know the location and length of the text file in order to retrieve it. Tell me the name of the raw device and the location and length of the text file and I'll give you the commands to retrieve and store it. However, beware: if there is a filesystem on the device, uncareful or unknowledgeable raw manipulation could destroy the filesystem.

Or, if you just want to write a text file to a raw device, well then, you just write it. Some raw devices (specifically, block devices) don't store length information, so you'll need to keep up with that yourself. Others do (e.g., tape).

Edit: DaggyStyle was faster than me.   :Wink: 

- John

----------

## Genone

Maybe you should try to explain in more detail what you're actually trying to accomplish. Accessing raw devices is only useful in very specific situations. If you simply want to access your files without mounting your disk first for convenience you better forget about that idea.

----------

