Active Topics

 


Reply
Thread Tools
Posts: 167 | Thanked: 204 times | Joined on Jul 2010
#11
Originally Posted by GigaByte View Post
This also worked great, huge thanks man.

p.s. You forgot a ] but never mind, got everything sorted now thanks
Well caught. I've corrected the post for anyone who stumbles on it later. :-)
 

The Following User Says Thank You to magick777 For This Useful Post:
Posts: 167 | Thanked: 204 times | Joined on Jul 2010
#12
It occurs to me that you can save yourself the grep and just check for the readability of a specific path that won't exist unless the SD card is mounted.

Code:
if [ -r "/media/mmc1/systemBackups" ]; then
It may make more sense to check for the path you want to operate on than to check for the mere existence of a microSD. Oh, and if you ever need to know what you've physically got on the system BEFORE it gets mounted, you could try /proc/partitions.
 

The Following User Says Thank You to magick777 For This Useful Post:
Posts: 28 | Thanked: 10 times | Joined on Dec 2010 @ near Paris
#13
sure,
cat /proc/partitions | grep mmcblk1 | wc -l
u r done too, and you know how much partitions u have ;-) on the SD card :-p
 
Posts: 20 | Thanked: 17 times | Joined on Jan 2011 @ Antarctica
#14
or just "df" and see if /dev/mmcblk1p1 is mounted anywhere. It should be /media/mmc1/
 
Reply


 
Forum Jump


All times are GMT. The time now is 02:59.