Ask / Submit

SDcard symlink is incorrect

asked 2018-06-03 15:57:38 +0300

TMavica gravatar image

updated 2018-06-05 16:05:13 +0300

rozgwi gravatar image

My sdcard symlink is /media/sdcard/nemo/uuid/, I need change the symlink to /media/sdcard/uuid/ myself

edit retag flag offensive close delete



Hmmmm, someone else was asking a similar question on Openrepos.

It is my understanding that we cannot change the path/symlink for the sdcard and it certainly should not or never have been "/media/sdcard/nemo/uuid/" purely as nemo is home (/home/nemo/). Perhaps I misunderstand you and the other user, in which case, I am at a loss for answers.

Is your sdcard formatted as something other than FAT32?

Edz ( 2018-06-03 17:38:23 +0300 )edit

it is ext4

TMavica ( 2018-06-03 18:02:07 +0300 )edit

I just changed my symlink to /media/sdcard/uuid, it worked fine

TMavica ( 2018-06-03 18:02:54 +0300 )edit

Interesting, care to share what you did?

Edz ( 2018-06-03 18:06:02 +0300 )edit

after update to of OS, the link /sdcard -> /storage/self/primary was broken, fixed by linking to the actual volume: ln -s /opt/alien/run/media/nemo/1fe6f857-d298-49d8-ab46-66528fc3f7a9 sdcard S.

nemirova ( 2018-06-03 23:13:29 +0300 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-11-03 04:13:11 +0300

olf gravatar image

updated 2018-11-03 04:56:05 +0300

Jolla's script for creating the compatibility symlink currently (in SFOS 2.2.x and supposedly 3.0.0, too) expects solely empty directories (as mount points) in /media/sdcard.
If anything else is there (e.g. files, symlinks or non-empty directories) that script errroneously creates a symlink /media/sdcard/nemo -> /run/media/nemo (instead of /media/sdcard -> /run/media/nemo as intended).

This issue is also mentioned in a slightly more technical discussion thread here on TJC "[Improvement] Enhanced mounting scripts for SD-cards", and meanwhile a technical analysis including a PR with a bugfix and an issue report were filed for this issue.
Please join in to these discussions or provide support by voting, as the PR fixing this (or any other solution) is not merged yet (that does not come easy, apparently) and AFAICS that erroneous symlink will be recreated by each SailfishOS upgrade, which provides an updated udisks2 RPM.

In order to prevent this from happening again and again, one has to (as root, after having upgraded to SFOS 2.2.0 or later) unmount all mounts on SD-card manually (not absolutely necessary, but far less dangerous, if symlinks exist; these can be deleted by an rm, but an rm -r can be fatal for some data) and then move away or delete all files, directories and symlinks in /media/sdcard, so nothing remains in there. Finally issue an rmdir /media/sdcard && ln -s /run/media/nemo /media/sdcard or install mount-sdcard (which replays an improved version of Jolla's script and deletes symlinks there, but no data) to establish what was intended by Jolla.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools



Asked: 2018-06-03 15:57:38 +0300

Seen: 632 times

Last updated: Nov 03 '18