It looks like I am not allowed to upload a .conf file here. Below is the section of my udisks-glue.conf file that contains the code to unmount those unwanted partitions. Please compare this section with your unmodified /etc/udisks-glue.conf to see where the hack begins and where it ends.
match other-partitions {
automount = true
post_mount_command = '
sudo chmod a+rwx "%mount_point" 2>/dev/null
if [ -f /usr/bin/net ] && /bin/systemctl is-enabled samba > /dev/null 2>&1; then
count=120
while [ $count -gt 0 ]; do
if sudo /usr/bin/net usershare add "$(basename "%mount_point")" "%mount_point" "Auto-mount Volume" "$(hostname)\osmc:f"
then break
fi
sleep 5; let count-=5
done
fi
for mpoint in /media/RECOVERY /media/SETTINGS /media/boot /media/root0
do
mount | grep -q $mpoint
if [ $? -eq 0 ]; then
umount $mpoint
fi
done'
post_unmount_command = '
if [ -f /usr/bin/net ]; then
sudo /usr/bin/net usershare delete "$(basename "%mount_point")"
fi'
}
I do hope that the OSMC developers will turn their attention to this matter at some point in the future and propose an elegant solution to replace this rather ugly band-aid solution.