How to check if SD card is Inserted/Removed

Recommended Posts

Hi , there

I am trying to write a program which will detect the presence of SD Card in Nano Pi M1 plus device. 

There are many ways to do this either by doing fdisk -l or looking into /dev/mmcblk* .

But I want to keep running it in a loop and doing fdisk -l and grep doesn't seems an appropriate way.


Can the insertion or removal of SD cards be checked via Hardware Interrupts? Plz. help me I am a newbie. 

Thank in advance.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now