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
Miscellaneous files can come in all forms on your phone's internal storage. Such files could relate to a number of aspects of your phone, including apps or your system. Because of this, you shouldn't just clear all your miscellaneous files, as tempting as that may be if they're taking up a lot of space.
On an Android phone, go to Settings > StorageIf you drill down into the category, you can delete individual files or data. For example, under “Audio,” long-press on one or more files and tap Delete. Or under “Apps,” tap the app's name and then Uninstall to remove it from your phone.
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With