[cs615asa] How to read data from device
Jan Schaumann
jschauma at stevens.edu
Wed May 16 22:47:22 EDT 2018
Zhitao Chen <zchen69 at stevens.edu> wrote:
> Is anyone know to read data from device? I use dd(1) to try to read the data, e.g.
>
> # dd if=/dev/xbd3a | od -l
Make sure to use the correct disk device and, if applicable, partition.
I.e., if you have a disklabled device, then you probably can't use the
'a' partition but need to use the full disk partition:
# tar cvf - . | dd of=/dev/xbd0a
[...]
.dd: //dev/xbd0a: Read-only file system
tar: Failed write to archive volume: 1 (Broken pipe)
But:
# tar cvf - . | dd of=/dev/xbd0a
[...]
tar: ustar vol 1, 335 files, 0 bytes read, 8478720 bytes written in 5
secs (1695744 bytes/sec)
# dd if=/dev/xbd0a | tar tvf -
will then show your data.
Be careful to not use e.g. /dev/xbd2 when that is not actually the block
device in question:
# tar cvf - . | dd of=/dev/xbd2
[...] # looks like success
# ls -l /dev/xbd2
-rw-r--r-- 1 root wheel 8478720 May 17 02:46 /dev/xbd2
# whoops, we just created a regular file named "/dev/xbd2" on the root
# file system
-Jan
More information about the cs615asa
mailing list