Reputation: 552
I want to fill my device disk space with any dump data as part of stress testing.
I tried writing bytes into a file in external storage; obviously larger & more spacious the disk is longer it will take to get filled. [approx half a minute for 1GB]
Can we do anything from adb shell in this case? I checked creating dump data using dd command:
dd if=/dev/zero of=/tmp/tempFiller.deleteMe bs=1024 count=$COUNT
which basically copies dump data to destination file Hence it also takes significant time. [approx 1 minute for 1GB]
Is there any faster approach? for a normal user / super user?
I also tried fallocate, truncate & mkfile commands in adb shell, but none of these commands are found even inside su. I guess these are bash commands & installing bash shell in Android device will require the device to be rooted.
fallocate -l 10G gentoo_root.img
truncate -s 10M output.file
mkfile 10240m 10Gigfile
Upvotes: 13
Views: 8681
Reputation: 86403
1GB in half a minute (30 seconds) is a write speed of over 30MB/s. Considering that the external storage on most Android devices these days is actually a Secure Digital flash card, that speed could very well be the maximum speed supported by either the card or the card interface of your device.
If using dd
with a moderate block size (e.g. bs=1M
) does not improve things, then chances are that you have just reached the limits of your current hardware.
Upvotes: 1
Reputation: 7718
I tried same thing in past. My purpose was filling all memory on device. After experiments I found out that dd is the best way for writing big files. My best speed was when I used 1MB for block size. I used 100MB files in order to have ability to balance free space on device.
Writing 100MB file:
dd if=/dev/zero of=myfile.dat bs=1048576 count=100
Also for quick experiments I've used written free app FillMemory
Upvotes: 8