automount sd-card on Beaglebone Black with Ubuntu 16.04 never worked

I’m surprised to not see this addressed adequately anywhere, maybe it’s unique to me, but i have never seen my BBB (4.4.62-ti-r99) with Ubuntu 16.04 automount my sd-card. it mounts fine on boot when i execute.
mount -v /dev/mmcblk0p1 /media/sd-card
same FAT cards always work flawlessly on my notebook U16.04.

i’m using eMMC for booting.
and since this is a camera type product a UUID on the sd-card won’t work. any card could be plugged, and un-plugged at any time.

im reading about fstab and autofs but don’t see a clear path to dynamic plug and play sd-card mounting/unmounting.

thanks, i must be missing something, still looking.

michael

"auto-mounting" is normally done by the window gui (gnome/kde/lxqt).

Regards,

Right, thanks. Knowing that, I should have remembered to mention it’s on a headless embedded system. Personal camera type, where the card can be ripped in and out as people tend to do…
Right now I search for a device with a uuid looking like xxxx-xxxx, and then I can mount that I guess.
There can never be any other device getting connected.
But still concerned about detecting it’s removal before a failure reveals it.
Set up a periodic polling function to check on its existence?
Thanks,
Michael

udisks2 to the rescue.
basic usage i suppose.
here’s my rule
/etc/udev/rules.d/99-mount-sd-card.rules

SUBSYSTEM==“block”, ACTION==“remove”, RUN+="/bin/sh -c ‘/home/scripts/sdunmounted’"
SUBSYSTEM==“block”, ACTION==“add”, RUN+="/bin/sh -c ‘/home/scripts/sdmounted’"

/home/scripts/sdmounted

mount -v /dev/mmcblk0p1 /media/sd-card

it is a closed, headless, embedded system. i believe the card should always appear as mmcblk0p1

my software detects a functioning card on boot,
but i guess it will notice it’s not there during operation by failing.
or i could send a signal into my c code program that alerts it to it’s removal? or insertion?
not sure how that would work without the c code polling something.

Thanks!
ciao,

udisks2 to the rescue.
basic usage i suppose.
here's my rule
/etc/udev/rules.d/99-mount-sd-card.rules
SUBSYSTEM=="block", ACTION=="remove", RUN+="/bin/sh -c
'/home/scripts/sdunmounted'"
SUBSYSTEM=="block", ACTION=="add", RUN+="/bin/sh -c
'/home/scripts/sdmounted'"

/home/scripts/sdmounted
mount -v /dev/mmcblk0p1 /media/sd-card

it is a closed, headless, embedded system. i believe the card should always
appear as mmcblk0p1

Yeah, this fix was back-ported to v4.4.x, so as long as it's v4.4.x+
based system, that will be true..

my software detects a functioning card on boot,
but i guess it will notice it's not there during operation by failing.
or i could send a signal into my c code program that alerts it to it's
removal? or insertion?
not sure how that would work without the c code polling something.

idk, directly using the hot-swapping sd card is going to be risky..

I think it would be better to have a local cache, and just rsync it to
the card when it get plugged in. Then have some sort of active
sync/mirror operation..

Regards,

my software detects a functioning card on boot,
but i guess it will notice it’s not there during operation by failing.
or i could send a signal into my c code program that alerts it to it’s
removal? or insertion?
not sure how that would work without the c code polling something.

idk, directly using the hot-swapping sd card is going to be risky…

I think it would be better to have a local cache, and just rsync it to
the card when it get plugged in. Then have some sort of active
sync/mirror operation…

yes, very interesting. i’m not at all sure the AM335x has the horse power to be moving these files around in a convenient time scale though.
converting raw h264 to mp4 takes some time and ripping out a thumbnail more time.
interesting idea though. also need a lot of cache for potentially large 1080p video files.

ciao,
michael

>
> my software detects a functioning card on boot,
> but i guess it will notice it's not there during operation by failing.
> or i could send a signal into my c code program that alerts it to it's
> removal? or insertion?
> not sure how that would work without the c code polling something.

idk, directly using the hot-swapping sd card is going to be risky..

I think it would be better to have a local cache, and just rsync it to
the card when it get plugged in. Then have some sort of active
sync/mirror operation..

yes, very interesting. i'm not at all sure the AM335x has the horse power to
be moving these files around in a convenient time scale though.

moving between mmc devices will at-least utilize the dma.

converting raw h264 to mp4 takes some time and ripping out a thumbnail more
time.
interesting idea though. also need a lot of cache for potentially large
1080p video files.

Regards,

hum, make i can make some tests on that someday. but would need to revisit the ddr on the board, right now the 2gigs we have there is pretty full with video processing.
plus even just one video file can be 8 gigs.
put it on the list for v2.0

:slight_smile: