1

I want to wipe sdcard, but am not sure how best it should be done. usually wiping is done into device, for example:

cat /dev/urandom > /dev/mydev

The thing is that I don't find a device which is related to sdcard. I understand it can be found in symlink /sdcard, and doing mount I find:

/dev/fuse /mnt/runtime/read/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/fuse /mnt/runtime/write/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0

but trying to wipe the device fails as following:

cat /dev/urandom > /dev/fuse
sh: cat: <stdout>: Operation not permitted

I also tried to find all partitions in emmc, but I don't see any storage/sdcard type:

lrwxrwxrwx root     root              2017-01-01 00:45 boot -> /dev/block/mmcblk0p7
lrwxrwxrwx root     root              2017-01-01 00:45 cache -> /dev/block/mmcblk0p21
lrwxrwxrwx root     root              2017-01-01 00:45 expdb -> /dev/block/mmcblk0p10
lrwxrwxrwx root     root              2017-01-01 00:45 flashinfo -> /dev/block/mmcblk0p23
lrwxrwxrwx root     root              2017-01-01 00:45 frp -> /dev/block/mmcblk0p17
lrwxrwxrwx root     root              2017-01-01 00:45 keystore -> /dev/block/mmcblk0p14
lrwxrwxrwx root     root              2017-01-01 00:45 lk -> /dev/block/mmcblk0p5
lrwxrwxrwx root     root              2017-01-01 00:45 logo -> /dev/block/mmcblk0p9
lrwxrwxrwx root     root              2017-01-01 00:45 metadata -> /dev/block/mmcblk0p19
lrwxrwxrwx root     root              2017-01-01 00:45 nvdata -> /dev/block/mmcblk0p18
lrwxrwxrwx root     root              2017-01-01 00:45 nvram -> /dev/block/mmcblk0p2
lrwxrwxrwx root     root              2017-01-01 00:45 oemkeystore -> /dev/block/mmcblk0p12
lrwxrwxrwx root     root              2017-01-01 00:45 para -> /dev/block/mmcblk0p6
lrwxrwxrwx root     root              2017-01-01 00:45 proinfo -> /dev/block/mmcblk0p1
lrwxrwxrwx root     root              2017-01-01 00:45 protect1 -> /dev/block/mmcblk0p3
lrwxrwxrwx root     root              2017-01-01 00:45 protect2 -> /dev/block/mmcblk0p4
lrwxrwxrwx root     root              2017-01-01 00:45 recovery -> /dev/block/mmcblk0p8
lrwxrwxrwx root     root              2017-01-01 00:45 seccfg -> /dev/block/mmcblk0p11
lrwxrwxrwx root     root              2017-01-01 00:45 secro -> /dev/block/mmcblk0p13
lrwxrwxrwx root     root              2017-01-01 00:45 system -> /dev/block/mmcblk0p20
lrwxrwxrwx root     root              2017-01-01 00:45 tee1 -> /dev/block/mmcblk0p15
lrwxrwxrwx root     root              2017-01-01 00:45 tee2 -> /dev/block/mmcblk0p16
lrwxrwxrwx root     root              2017-01-01 00:45 userdata -> /dev/block/mmcblk0p22

Thanks for any idea,

ranran

6
  • 1
    cat /dev/urandom > isn't a good way to wipe an SD card. SD cards do write balancing, so your command won't overwrite all data, but it still causes more write cycles than simply formatting it. It's the worst of both worlds.
    – Dan Hulme
    Apr 13, 2018 at 14:21
  • how is best to format ? seems sdcard is not a seperate memory storage in my case.
    – ransh
    Apr 13, 2018 at 14:46
  • Is your card adopted or portable storage?
    – acejavelin
    Apr 13, 2018 at 14:50
  • Is the device and/or the sdcard section encrypted (should be enabled by default on current devices)?
    – Robert
    Apr 13, 2018 at 17:21
  • What about formatting from Settings? TWRP? A PC? A camera? Anything? You don't necessarily have to go so low level. Of course I'm assuming you don't have some data you wish to destroy, in which case one pass of shred should suffice (warning, this will wear your card a bit!). Or, if you just have to get rid of the data, you could destroy it
    – Manchineel
    Apr 13, 2018 at 21:47

1 Answer 1

0

!! WARNING !!

DO NOT RUN ANY OF THESE COMMANDS IF YOU DO NOT KNOW WHAT YOU ARE DOING. YOU COULD BRICK YOUR DEVICE. BE CAREFUL WITH THESE COMMANDS!!

!! WARNING !!

If you have access to rm:

cd to the drive and run rm -rf /path/to/files

WARNING! DO !!NOT!! USE rm - rf /!! I mean, unless you like having a bricked Android device, that is.

If you have access to dd:

dd if=/dev/null of=/dev/fuse

This overwrites everything with null data.

And if it doesn't work, try adding sudo in front of the commands. DO NOT USE SUDO CARELESSLY!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .