Android / Linux dd help! [closed]
Clash Royale CLAN TAG#URR8PPP
up vote
-5
down vote
favorite
Can any one give me a simple example? The partition size is 4 MB but the data inside is 3.1 MB. I need to dd
only the 3.1 MB.
dd if=/dev/block/partition of=/tmp/3.1mb.img bs= skip=
I'm confused about bs
and skip
. Hopefully an example can clarify it.
dd android
closed as unclear what you're asking by Hauke Laging, Kusalananda, Jeff Schaller, Jesse_b, Kiwy May 4 at 6:29
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |Â
up vote
-5
down vote
favorite
Can any one give me a simple example? The partition size is 4 MB but the data inside is 3.1 MB. I need to dd
only the 3.1 MB.
dd if=/dev/block/partition of=/tmp/3.1mb.img bs= skip=
I'm confused about bs
and skip
. Hopefully an example can clarify it.
dd android
closed as unclear what you're asking by Hauke Laging, Kusalananda, Jeff Schaller, Jesse_b, Kiwy May 4 at 6:29
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Where in the 4MB partition is the 3.1MB that you're interested in? Beginning? End? Sprinkled throughout the partition?
â Mark Plotnick
May 3 at 18:51
1
What sort of embedded system are you on where 900KB is too much slack to bring along for the ride?
â DopeGhoti
May 3 at 18:52
What comprises 3.1MB that you want to copy? Is that a bunch of files? Your block size can be as small as 1 byte, and you can use as many in thecount
as you need.man dd
should help.
â ajeh
May 3 at 22:24
Its actually a carrier partition in Android, actual size of partition is 23MB but data inside that partition incld some small files and folder is around 2.9MB so what i was trying is too just dd the actual data, instead of whole partition.
â Rogers Drave
May 5 at 1:45
add a comment |Â
up vote
-5
down vote
favorite
up vote
-5
down vote
favorite
Can any one give me a simple example? The partition size is 4 MB but the data inside is 3.1 MB. I need to dd
only the 3.1 MB.
dd if=/dev/block/partition of=/tmp/3.1mb.img bs= skip=
I'm confused about bs
and skip
. Hopefully an example can clarify it.
dd android
Can any one give me a simple example? The partition size is 4 MB but the data inside is 3.1 MB. I need to dd
only the 3.1 MB.
dd if=/dev/block/partition of=/tmp/3.1mb.img bs= skip=
I'm confused about bs
and skip
. Hopefully an example can clarify it.
dd android
edited May 3 at 18:51
Kusalananda
102k13199316
102k13199316
asked May 3 at 18:48
Rogers Drave
1
1
closed as unclear what you're asking by Hauke Laging, Kusalananda, Jeff Schaller, Jesse_b, Kiwy May 4 at 6:29
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Hauke Laging, Kusalananda, Jeff Schaller, Jesse_b, Kiwy May 4 at 6:29
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, itâÂÂs hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Where in the 4MB partition is the 3.1MB that you're interested in? Beginning? End? Sprinkled throughout the partition?
â Mark Plotnick
May 3 at 18:51
1
What sort of embedded system are you on where 900KB is too much slack to bring along for the ride?
â DopeGhoti
May 3 at 18:52
What comprises 3.1MB that you want to copy? Is that a bunch of files? Your block size can be as small as 1 byte, and you can use as many in thecount
as you need.man dd
should help.
â ajeh
May 3 at 22:24
Its actually a carrier partition in Android, actual size of partition is 23MB but data inside that partition incld some small files and folder is around 2.9MB so what i was trying is too just dd the actual data, instead of whole partition.
â Rogers Drave
May 5 at 1:45
add a comment |Â
1
Where in the 4MB partition is the 3.1MB that you're interested in? Beginning? End? Sprinkled throughout the partition?
â Mark Plotnick
May 3 at 18:51
1
What sort of embedded system are you on where 900KB is too much slack to bring along for the ride?
â DopeGhoti
May 3 at 18:52
What comprises 3.1MB that you want to copy? Is that a bunch of files? Your block size can be as small as 1 byte, and you can use as many in thecount
as you need.man dd
should help.
â ajeh
May 3 at 22:24
Its actually a carrier partition in Android, actual size of partition is 23MB but data inside that partition incld some small files and folder is around 2.9MB so what i was trying is too just dd the actual data, instead of whole partition.
â Rogers Drave
May 5 at 1:45
1
1
Where in the 4MB partition is the 3.1MB that you're interested in? Beginning? End? Sprinkled throughout the partition?
â Mark Plotnick
May 3 at 18:51
Where in the 4MB partition is the 3.1MB that you're interested in? Beginning? End? Sprinkled throughout the partition?
â Mark Plotnick
May 3 at 18:51
1
1
What sort of embedded system are you on where 900KB is too much slack to bring along for the ride?
â DopeGhoti
May 3 at 18:52
What sort of embedded system are you on where 900KB is too much slack to bring along for the ride?
â DopeGhoti
May 3 at 18:52
What comprises 3.1MB that you want to copy? Is that a bunch of files? Your block size can be as small as 1 byte, and you can use as many in the
count
as you need. man dd
should help.â ajeh
May 3 at 22:24
What comprises 3.1MB that you want to copy? Is that a bunch of files? Your block size can be as small as 1 byte, and you can use as many in the
count
as you need. man dd
should help.â ajeh
May 3 at 22:24
Its actually a carrier partition in Android, actual size of partition is 23MB but data inside that partition incld some small files and folder is around 2.9MB so what i was trying is too just dd the actual data, instead of whole partition.
â Rogers Drave
May 5 at 1:45
Its actually a carrier partition in Android, actual size of partition is 23MB but data inside that partition incld some small files and folder is around 2.9MB so what i was trying is too just dd the actual data, instead of whole partition.
â Rogers Drave
May 5 at 1:45
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
The dd on my version of Android appears to be similar to that of most linux distributions in its operation. So for documentation that explains its features I'd look at the dd man page (you can just google it).
The man page has this to say about bs
, count
, and skip
:
bs=BYTES
read and write up to BYTES bytes at a time (default: 512);
overrides ibs and obs
count=N
copy only N input blocks
skip=N skip N ibs-sized blocks at start of input
If you're looking for an exact number of bytes, you need to figure out
if you want 3.1MB or 3.1MiB. That is to say are your megabytes 1000*1000 bytes or 1024*1024 bytes? I'll assume the later in the following examples:
dd if=/dev/block/partition of=/tmp/3.1mb.img count=6349
So as above the default blocksize for dd is 512 bytes. Thus the following will copy out a little more than 3.1MiB starting from the beginning of the partition. Its a little more because 3.1MiB does not compute to a whole number of bytes (
3.1*1024*1024 = 3250585.6
). 6349 is used because3.1 * 1024*1024 / 512 (blocksize) = 6348.8
and then I round up to make sure at least 3.1MiB of data is retrieved. Keep in mind that dd only reads and writes data in a multiple of blocksize, so in this case rounding up adds an extra 102 bytes. This shows you some of the things to think about if you are concerned about how many bytes you're actually getting.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 count=3250586
If you want an exact number of bytes which you do not know to be a multiple of some number, you can set the block size to
1
and thecount
to the exact number of bytes you want.dd if=/dev/block/partition of=/tmp/3.1mb.img skip=1K count=6349
Suppose that the data you want to copy is half a megabyte (512KiB, or 512*1024 bytes) into the partition. Then skip can be used as above. 1K is used because the
K
suffix in dd mean 1024 bytes. Since the block size is the default 512, that means we are skipping 512KiB or 512 * 1024 bytes into the partition. Skip means that a certain number of blocks from the beginning of the input file (partition in our case) will be skipped from the beginning to get to the position in the input file where dd will begin reading.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 skip=524288 count=3250586
To get an exact number of bytes while skipping an in initial 512KiB we could rewrite the previous example as the one above.
Keep in mind that, since you are looking to copy a certain number of bytes, the count
option should always be given. Otherwise, dd will read until it can no longer do so, which may read a lot more than you want.
add a comment |Â
up vote
1
down vote
Simple arithmetic:
dd if=/dev/block/partition of=/tmp/partition.img bs=1K count=3100
1 kilobyte times 3100 = 3.1 megabytes, more or less.
Are you sure the partition in question is so very small though?
Thanks, I guess this will help. Yes partition size is 23MB actually, but data inside the partition is 2.9MB incld some files and folders.
â Rogers Drave
May 5 at 1:47
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
The dd on my version of Android appears to be similar to that of most linux distributions in its operation. So for documentation that explains its features I'd look at the dd man page (you can just google it).
The man page has this to say about bs
, count
, and skip
:
bs=BYTES
read and write up to BYTES bytes at a time (default: 512);
overrides ibs and obs
count=N
copy only N input blocks
skip=N skip N ibs-sized blocks at start of input
If you're looking for an exact number of bytes, you need to figure out
if you want 3.1MB or 3.1MiB. That is to say are your megabytes 1000*1000 bytes or 1024*1024 bytes? I'll assume the later in the following examples:
dd if=/dev/block/partition of=/tmp/3.1mb.img count=6349
So as above the default blocksize for dd is 512 bytes. Thus the following will copy out a little more than 3.1MiB starting from the beginning of the partition. Its a little more because 3.1MiB does not compute to a whole number of bytes (
3.1*1024*1024 = 3250585.6
). 6349 is used because3.1 * 1024*1024 / 512 (blocksize) = 6348.8
and then I round up to make sure at least 3.1MiB of data is retrieved. Keep in mind that dd only reads and writes data in a multiple of blocksize, so in this case rounding up adds an extra 102 bytes. This shows you some of the things to think about if you are concerned about how many bytes you're actually getting.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 count=3250586
If you want an exact number of bytes which you do not know to be a multiple of some number, you can set the block size to
1
and thecount
to the exact number of bytes you want.dd if=/dev/block/partition of=/tmp/3.1mb.img skip=1K count=6349
Suppose that the data you want to copy is half a megabyte (512KiB, or 512*1024 bytes) into the partition. Then skip can be used as above. 1K is used because the
K
suffix in dd mean 1024 bytes. Since the block size is the default 512, that means we are skipping 512KiB or 512 * 1024 bytes into the partition. Skip means that a certain number of blocks from the beginning of the input file (partition in our case) will be skipped from the beginning to get to the position in the input file where dd will begin reading.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 skip=524288 count=3250586
To get an exact number of bytes while skipping an in initial 512KiB we could rewrite the previous example as the one above.
Keep in mind that, since you are looking to copy a certain number of bytes, the count
option should always be given. Otherwise, dd will read until it can no longer do so, which may read a lot more than you want.
add a comment |Â
up vote
2
down vote
The dd on my version of Android appears to be similar to that of most linux distributions in its operation. So for documentation that explains its features I'd look at the dd man page (you can just google it).
The man page has this to say about bs
, count
, and skip
:
bs=BYTES
read and write up to BYTES bytes at a time (default: 512);
overrides ibs and obs
count=N
copy only N input blocks
skip=N skip N ibs-sized blocks at start of input
If you're looking for an exact number of bytes, you need to figure out
if you want 3.1MB or 3.1MiB. That is to say are your megabytes 1000*1000 bytes or 1024*1024 bytes? I'll assume the later in the following examples:
dd if=/dev/block/partition of=/tmp/3.1mb.img count=6349
So as above the default blocksize for dd is 512 bytes. Thus the following will copy out a little more than 3.1MiB starting from the beginning of the partition. Its a little more because 3.1MiB does not compute to a whole number of bytes (
3.1*1024*1024 = 3250585.6
). 6349 is used because3.1 * 1024*1024 / 512 (blocksize) = 6348.8
and then I round up to make sure at least 3.1MiB of data is retrieved. Keep in mind that dd only reads and writes data in a multiple of blocksize, so in this case rounding up adds an extra 102 bytes. This shows you some of the things to think about if you are concerned about how many bytes you're actually getting.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 count=3250586
If you want an exact number of bytes which you do not know to be a multiple of some number, you can set the block size to
1
and thecount
to the exact number of bytes you want.dd if=/dev/block/partition of=/tmp/3.1mb.img skip=1K count=6349
Suppose that the data you want to copy is half a megabyte (512KiB, or 512*1024 bytes) into the partition. Then skip can be used as above. 1K is used because the
K
suffix in dd mean 1024 bytes. Since the block size is the default 512, that means we are skipping 512KiB or 512 * 1024 bytes into the partition. Skip means that a certain number of blocks from the beginning of the input file (partition in our case) will be skipped from the beginning to get to the position in the input file where dd will begin reading.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 skip=524288 count=3250586
To get an exact number of bytes while skipping an in initial 512KiB we could rewrite the previous example as the one above.
Keep in mind that, since you are looking to copy a certain number of bytes, the count
option should always be given. Otherwise, dd will read until it can no longer do so, which may read a lot more than you want.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
The dd on my version of Android appears to be similar to that of most linux distributions in its operation. So for documentation that explains its features I'd look at the dd man page (you can just google it).
The man page has this to say about bs
, count
, and skip
:
bs=BYTES
read and write up to BYTES bytes at a time (default: 512);
overrides ibs and obs
count=N
copy only N input blocks
skip=N skip N ibs-sized blocks at start of input
If you're looking for an exact number of bytes, you need to figure out
if you want 3.1MB or 3.1MiB. That is to say are your megabytes 1000*1000 bytes or 1024*1024 bytes? I'll assume the later in the following examples:
dd if=/dev/block/partition of=/tmp/3.1mb.img count=6349
So as above the default blocksize for dd is 512 bytes. Thus the following will copy out a little more than 3.1MiB starting from the beginning of the partition. Its a little more because 3.1MiB does not compute to a whole number of bytes (
3.1*1024*1024 = 3250585.6
). 6349 is used because3.1 * 1024*1024 / 512 (blocksize) = 6348.8
and then I round up to make sure at least 3.1MiB of data is retrieved. Keep in mind that dd only reads and writes data in a multiple of blocksize, so in this case rounding up adds an extra 102 bytes. This shows you some of the things to think about if you are concerned about how many bytes you're actually getting.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 count=3250586
If you want an exact number of bytes which you do not know to be a multiple of some number, you can set the block size to
1
and thecount
to the exact number of bytes you want.dd if=/dev/block/partition of=/tmp/3.1mb.img skip=1K count=6349
Suppose that the data you want to copy is half a megabyte (512KiB, or 512*1024 bytes) into the partition. Then skip can be used as above. 1K is used because the
K
suffix in dd mean 1024 bytes. Since the block size is the default 512, that means we are skipping 512KiB or 512 * 1024 bytes into the partition. Skip means that a certain number of blocks from the beginning of the input file (partition in our case) will be skipped from the beginning to get to the position in the input file where dd will begin reading.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 skip=524288 count=3250586
To get an exact number of bytes while skipping an in initial 512KiB we could rewrite the previous example as the one above.
Keep in mind that, since you are looking to copy a certain number of bytes, the count
option should always be given. Otherwise, dd will read until it can no longer do so, which may read a lot more than you want.
The dd on my version of Android appears to be similar to that of most linux distributions in its operation. So for documentation that explains its features I'd look at the dd man page (you can just google it).
The man page has this to say about bs
, count
, and skip
:
bs=BYTES
read and write up to BYTES bytes at a time (default: 512);
overrides ibs and obs
count=N
copy only N input blocks
skip=N skip N ibs-sized blocks at start of input
If you're looking for an exact number of bytes, you need to figure out
if you want 3.1MB or 3.1MiB. That is to say are your megabytes 1000*1000 bytes or 1024*1024 bytes? I'll assume the later in the following examples:
dd if=/dev/block/partition of=/tmp/3.1mb.img count=6349
So as above the default blocksize for dd is 512 bytes. Thus the following will copy out a little more than 3.1MiB starting from the beginning of the partition. Its a little more because 3.1MiB does not compute to a whole number of bytes (
3.1*1024*1024 = 3250585.6
). 6349 is used because3.1 * 1024*1024 / 512 (blocksize) = 6348.8
and then I round up to make sure at least 3.1MiB of data is retrieved. Keep in mind that dd only reads and writes data in a multiple of blocksize, so in this case rounding up adds an extra 102 bytes. This shows you some of the things to think about if you are concerned about how many bytes you're actually getting.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 count=3250586
If you want an exact number of bytes which you do not know to be a multiple of some number, you can set the block size to
1
and thecount
to the exact number of bytes you want.dd if=/dev/block/partition of=/tmp/3.1mb.img skip=1K count=6349
Suppose that the data you want to copy is half a megabyte (512KiB, or 512*1024 bytes) into the partition. Then skip can be used as above. 1K is used because the
K
suffix in dd mean 1024 bytes. Since the block size is the default 512, that means we are skipping 512KiB or 512 * 1024 bytes into the partition. Skip means that a certain number of blocks from the beginning of the input file (partition in our case) will be skipped from the beginning to get to the position in the input file where dd will begin reading.dd if=/dev/block/partition of=/tmp/3.1mb.img bs=1 skip=524288 count=3250586
To get an exact number of bytes while skipping an in initial 512KiB we could rewrite the previous example as the one above.
Keep in mind that, since you are looking to copy a certain number of bytes, the count
option should always be given. Otherwise, dd will read until it can no longer do so, which may read a lot more than you want.
answered May 3 at 19:56
crass
963
963
add a comment |Â
add a comment |Â
up vote
1
down vote
Simple arithmetic:
dd if=/dev/block/partition of=/tmp/partition.img bs=1K count=3100
1 kilobyte times 3100 = 3.1 megabytes, more or less.
Are you sure the partition in question is so very small though?
Thanks, I guess this will help. Yes partition size is 23MB actually, but data inside the partition is 2.9MB incld some files and folders.
â Rogers Drave
May 5 at 1:47
add a comment |Â
up vote
1
down vote
Simple arithmetic:
dd if=/dev/block/partition of=/tmp/partition.img bs=1K count=3100
1 kilobyte times 3100 = 3.1 megabytes, more or less.
Are you sure the partition in question is so very small though?
Thanks, I guess this will help. Yes partition size is 23MB actually, but data inside the partition is 2.9MB incld some files and folders.
â Rogers Drave
May 5 at 1:47
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Simple arithmetic:
dd if=/dev/block/partition of=/tmp/partition.img bs=1K count=3100
1 kilobyte times 3100 = 3.1 megabytes, more or less.
Are you sure the partition in question is so very small though?
Simple arithmetic:
dd if=/dev/block/partition of=/tmp/partition.img bs=1K count=3100
1 kilobyte times 3100 = 3.1 megabytes, more or less.
Are you sure the partition in question is so very small though?
answered May 3 at 18:51
DopeGhoti
40k54779
40k54779
Thanks, I guess this will help. Yes partition size is 23MB actually, but data inside the partition is 2.9MB incld some files and folders.
â Rogers Drave
May 5 at 1:47
add a comment |Â
Thanks, I guess this will help. Yes partition size is 23MB actually, but data inside the partition is 2.9MB incld some files and folders.
â Rogers Drave
May 5 at 1:47
Thanks, I guess this will help. Yes partition size is 23MB actually, but data inside the partition is 2.9MB incld some files and folders.
â Rogers Drave
May 5 at 1:47
Thanks, I guess this will help. Yes partition size is 23MB actually, but data inside the partition is 2.9MB incld some files and folders.
â Rogers Drave
May 5 at 1:47
add a comment |Â
1
Where in the 4MB partition is the 3.1MB that you're interested in? Beginning? End? Sprinkled throughout the partition?
â Mark Plotnick
May 3 at 18:51
1
What sort of embedded system are you on where 900KB is too much slack to bring along for the ride?
â DopeGhoti
May 3 at 18:52
What comprises 3.1MB that you want to copy? Is that a bunch of files? Your block size can be as small as 1 byte, and you can use as many in the
count
as you need.man dd
should help.â ajeh
May 3 at 22:24
Its actually a carrier partition in Android, actual size of partition is 23MB but data inside that partition incld some small files and folder is around 2.9MB so what i was trying is too just dd the actual data, instead of whole partition.
â Rogers Drave
May 5 at 1:45