Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Raw data usb
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Wed Sep 19, 2012 1:22 pm    Post subject: Raw data usb Reply with quote

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.
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Wed Sep 19, 2012 2:28 pm    Post subject: Re: Raw data usb Reply with quote

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?
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10589
Location: Somewhere over Atlanta, Georgia

PostPosted: Wed Sep 19, 2012 2:39 pm    Post subject: Reply with quote

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
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
ev56o
Apprentice
Apprentice


Joined: 26 Jan 2010
Posts: 180

PostPosted: Fri Sep 21, 2012 10:54 am    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
DaggyStyle
Watchman
Watchman


Joined: 22 Mar 2006
Posts: 5909

PostPosted: Fri Sep 21, 2012 11:08 am    Post subject: Reply with quote

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.
_________________
Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10589
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Sep 21, 2012 11:08 am    Post subject: Reply with quote

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
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9530
Location: beyond the rim

PostPosted: Tue Sep 25, 2012 10:51 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum