1

I have non USB MMC/SD reader slot . If a user inserts SD card, I want to be able to disconnect the SD card, or Disable the reader. (in case I detect malicious card). How can I do this? With umount, I unmount it. Problem is it is very quick to return it to work. I just click on its Icon In Thunar file manager UI. So I need solution that it takes longer to reactivate. Probably disable the reader. I can see the storage sd card in /dev/mmcblk0p1. The sd reader in /dev/mmcblk0

4
  • Would it be enough to unmount the partition(s) on the card, or would you want to turn off the power supply for the card and/or the card reader? (I know how to unmount, but I don't know how to turn off the current for the card and/or the card reader. I know also how to remove all information on a card by overwriting it with zeros.)
    – sudodus
    Commented Dec 9, 2021 at 9:15
  • Remove information in card you mean to actually delete memory from the card? I dont want to touch memory in the card itself
    – jivangilad
    Commented Dec 9, 2021 at 11:15
  • I managed to do unmount. Problem is it is very quick to return it to action. I just click on its Icon In Thunar file manager UI. I also want to turn of reader.
    – jivangilad
    Commented Dec 9, 2021 at 12:11
  • Let us hope that someone who know how to turn off the card reader will see you question and answer.
    – sudodus
    Commented Dec 9, 2021 at 12:18

1 Answer 1

0

You can unmount each partition with a command like this,

sudo umount /dev/mmcblk0pn  # general command, where n = partition number

sudo umount /dev/mmcblk0p1  # specific command (matching the question)

sudo umount /dev/mmcblk0*   # umounting 'everything on the card' at once

You can check that it is no longer mounted with

df

or

lsblk

I do not mean to delete the memory, only delete the data which might be infected with malicious code from the memory, so that the memory is clean, only contains zero bytes. You can do that safely with mkusb.

After that you can create a fresh partition table and file systems with gparted in graphics mode or with more basic command line tools, fdisk and mkfs, in text mode. If you want a basic FAT32 file system, mkusb can do it directly (in graphic mode as well as in text mode).


You can turn off Thunar's automatic mounting according to the following link

You must log in to answer this question.

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