JyCet
Member
Hi all,
Does someone know under linux how to check if a sd is inserted or not ?
Thanks
Does someone know under linux how to check if a sd is inserted or not ?
Thanks
if mount | grep -q disc0; then
# SD is mounted
else
# Not mounted
fi
That means some process is using the SD, e.g. you are in a directory under /mnt/sd in the shell. If so just "cd /" before you unmount it.JyCet posted on Sep 13 2006 at 08:09 PM said:Edit: j'ai testé at "device busy"
// all files already closed
//change dir to the root
chdir("/");
// umount the sd
umount ("/mnt/sd");
// CHANGE SD HERE
// mount the new sd
mount ("/dev/mmcsd/disc0/part1","/mnt/sd",...),
// return to the sd
chdir("/mnt/sd/");
// now DO MY STUFF
...
Copy your 'SD switcher' to /tmp (which is tmpfs), run it from there, then you can unmount /mnt/sd. Without hurting the NANDJyCet posted on Sep 16 2006 at 01:02 AM said:Test complete but always impossible
If I launch any program from SD, it's impossible to umount /mnt/sd
If I add chdir("/"); in a program without any sd call inside this program, it's always impossible to umount /mnt/sd
Now if I copy a program in the NAND, this program do some call to the SD (like opendir() ) and close these call (closedir() ), I can umount /mnt/sd
Daid posted on Sep 16 2006 at 11:28 AM said:Copy your 'SD switcher' to /tmp (which is tmpfs), run it from there, then you can unmount /mnt/sd. Without hurting the NAND
JyCet posted on Sep 13 2006 at 07:18 PM said:Hi all,
Does someone know under linux how to check if a sd is inserted or not ?
Thanks
none /tmp /tmpfs Size=5M 0 0