Either run as root or make the user a member of a group that has read/write access to the device. You can see the groups with ls -lgsgs wrote:> Reading and writing a raw device is easy in Linux, as long
> as the user has the correct permissions.
how does he get the correct permissions ?
Code: Select all
pi@raspi3 ~ $ ls -l /dev/mmcblk0 brw-rw---- 1 root disk 179, 0 Jan 1 1970 /dev/mmcblk0
Do you mean what "language" is this? It's not. It's just the idea of the code required. It's close-ish to C, but you need to write your own code.> For the SD card you could do something like
> card = open( "/dev/mmcblk0" )
> seek( card, address * 512 )
> read( buffer, card, 512 ) // Read a sector
> close( card )
thanks...sounds good ... what Linux is it ? bash ? reads the raspberry2b system-card or from USB ?
Not sure what you mean by thisNow read all the sectors and write it to a file on another, bigger card in another USB-port
Or write it directly to their corresponding sectors/blocks
dd is a command. It is very flexible. Type "man dd" at the command line for the full, gory, details. Or look here http://manpages.debian.org/cgi-bin/man.cgi?query=dd> You can even read/write sectors from the command line with the skip/seek and count options of dd.
so the above wasn't the command line ?! what's dd ?
No idea. Windows is too complicated.(I have no easy Linux access ATM)
how to do that in Windows cmd.exe commandline or with a C-program
or x86 assembly