We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2014-03-01 15:20:18 +0200

[Bug] mount-sd.sh is executed too early at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed 1. after /run/user/100000 exists 2. after /home is mounted 3. before ambience resouces are checked

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

[Bug] mount-sd.sh is executed too early at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed 1.

  1. after /run/user/100000 exists 2. exists

  2. after /home is mounted 3. mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

[Bug] mount-sd.sh is executed too early at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

[Bug] mount-sd.sh is executed too early at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

Edit update SailfishOS 1.0.4.20 (I did a factory reset before update): We have a new mount-sd.sh script. It is better than the previous one and handles fat, exfat, ntfs and other filesystems. The developer (no name in script) added ntfs support untested. The script is called only once at startup. But the mystery goes on, may be there are other problems - I don't know after short time of tests.

first some facts

I have a btrfs sdcard with hidden subvolumens and sourced a debug script at the end of mount-sd.sh that mounts the root of sdcard additionaly to /media/work (just to copy old data) and my personal .android subvol to /data/sdcard. No problems with the android disk space - I do not use much android apps! Native SailfishOS is more welcome.

Debug results:

cat /tmp/mount-sd.debug 
PID=1250, ACTION=add, DEVNAME=/dev/mmcblk1
mount -o subvol=/,dirsync,noatime,users /dev/mmcblk1 /media/work, rc=0
mount -o subvol=.android,dirsync,noatime,users /dev/mmcblk1 /data/sdcard/, rc=0
---callstack---
root         1     0  6 23:13 ?        Ss     0:01 /sbin/init --unit=default.target
root      1250     1  0 23:14 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh add mmcblk1
---end---

Do you want to see my debug script here too?

second some mysteries:

  1. The sdcard mount point changed to /media/sdcard/<uuid>/, result: programs have problems to address that path (filemanger, ownkeepass, cargodock). Users like me could never remember the <uuid> part to input it to a path in any program. What is the reason select such a comlex path name?

It would be fine to have a environment variable like MYSDCARD="/media/sdcard/<uuid>/" or some other reference to the sdcard. Or where can we find a reference to the path of the sdcard?

  1. I have two pictures for ambience at /media/sdcard/<uuid>/Data/ambience/ (remember I can't remember <uuid>). I can see the pics in the gallery. The pics are in ambience format. I can create an ambience and tag it as favorite. After that I can select the ambiences as expected. After shutdown the ambiences are lost. Only the 9 standard ambiences and the "snow white" and " the first one" are persistent. I have to do all steps from gallery pictures again after every reboot. Ambiences from pictures on the sdcard are lost after shutdown.

  2. This is version should be the 1. non beta! Do you think that this is a "non beta" sdcard use case for smartphone users?

more questions:

Is it possible to expand the memory more flexible with a btrfs formated sdcard?

Can users use the sdcard to save content from SaifishOS apps (for example pictures direct from the camera program) direct to the sdcard?

Is there a concept for sdcard usage?

I would like to help Jolla working on a concept or with my scripting skills.

[Bug] mount-sd.sh is executed too early at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

Edit update SailfishOS 1.0.4.20 (I did a factory reset before update): We have a new mount-sd.sh script. It is better than the previous one and handles fat, exfat, ntfs and other filesystems. The developer (no name in script) added ntfs support untested. The script is called only once at startup. But the mystery goes on, may be there are other problems - I don't know after short time of tests.

first some facts

I have a btrfs sdcard with hidden subvolumens and sourced a debug script at the end of mount-sd.sh that mounts the root of sdcard additionaly to /media/work (just to copy old data) and my personal .android subvol to /data/sdcard. No problems with the android disk space - I do not use much android apps! Native SailfishOS is more welcome.

Debug results:

cat /tmp/mount-sd.debug 
PID=1250, ACTION=add, DEVNAME=/dev/mmcblk1
mount -o subvol=/,dirsync,noatime,users /dev/mmcblk1 /media/work, rc=0
mount -o subvol=.android,dirsync,noatime,users /dev/mmcblk1 /data/sdcard/, rc=0
---callstack---
root         1     0  6 23:13 ?        Ss     0:01 /sbin/init --unit=default.target
root      1250     1  0 23:14 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh add mmcblk1
---end---

Do you want to see my debug script here too?

second some mysteries:

  1. The sdcard mount point changed to /media/sdcard/<uuid>/, /media/sdcard/<UUID>/, result: programs have problems to address that path (filemanger, ownkeepass, cargodock). Users like me could never remember the <uuid> the<UUID> part to input it to a path in any program. What is the reason select such a comlex path name?

It would be fine to have a environment variable like MYSDCARD="/media/sdcard/<uuid>/" MYSDCARD="/media/sdcard/<UUID>/" or some other reference to the sdcard. Or where can we find a reference to the path of the sdcard?

  1. I have two pictures for ambience at /media/sdcard/<uuid>/Data/ambience/ /media/sdcard<UUID>/Data/ambience/ (remember I can't remember <uuid>). <UUID>). I can see the pics in the gallery. The pics are in ambience format. I can create an ambience and tag it as favorite. After that I can select the ambiences as expected. After shutdown the ambiences are lost. Only the 9 standard ambiences and the "snow white" and " the first one" are persistent. I have to do all steps from gallery pictures again after every reboot. Ambiences from pictures on the sdcard are lost after shutdown.

  2. This is version should be the 1. non beta! Do you think that this is a "non beta" sdcard use case for smartphone users?

more questions:

Is it possible to expand the memory more flexible with a btrfs formated sdcard?

Can users use the sdcard to save content from SaifishOS apps (for example pictures direct from the camera program) direct to the sdcard?

Is there a concept for sdcard usage?

I would like to help Jolla working on a concept or with my scripting skills.

[Bug] mount-sd.sh is executed too early at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

Edit update SailfishOS 1.0.4.20 (I did a factory reset before update): We have a new mount-sd.sh script. It is better than the previous one and handles fat, exfat, ntfs and other filesystems. The developer (no name in script) added ntfs support untested. The script is called only once at startup. But the mystery goes on, may be there are other problems - I don't know after short time of tests.

first some facts

I have a btrfs sdcard with hidden subvolumens and sourced a debug script at the end of mount-sd.sh that mounts the root of sdcard additionaly to /media/work (just to copy old data) and my personal .android subvol to /data/sdcard. No problems with the android disk space - I do not use much android apps! Native SailfishOS is more welcome.

Debug results:

cat /tmp/mount-sd.debug 
PID=1250, ACTION=add, DEVNAME=/dev/mmcblk1
mount -o subvol=/,dirsync,noatime,users /dev/mmcblk1 /media/work, rc=0
mount -o subvol=.android,dirsync,noatime,users /dev/mmcblk1 /data/sdcard/, rc=0
---callstack---
root         1     0  6 23:13 ?        Ss     0:01 /sbin/init --unit=default.target
root      1250     1  0 23:14 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh add mmcblk1
---end---

Do you want to see my debug script here too?

second some mysteries:

  1. The sdcard mount point changed to /media/sdcard/<UUID>/, result: programs have problems to address that path (filemanger, ownkeepass, cargodock). Users like me could never remember the<UUID> part to input it to a path in any program. What is the reason select such a comlex path name?

It would be fine to have a environment variable like MYSDCARD="/media/sdcard/<UUID>/" or some other reference to the sdcard. Or where can we find a reference to the path of the sdcard?

  1. I have two pictures for ambience at /media/sdcard<UUID>/Data/ambience/ (remember I can't remember <UUID>). I can see the pics in the gallery. The pics are in ambience format. I can create an ambience and tag it as favorite. After that I can select the ambiences as expected. After shutdown the ambiences are lost. Only the 9 standard ambiences and the "snow white" and " the first one" are persistent. I have to do all steps from gallery pictures again after every reboot. Ambiences from pictures on the sdcard are lost after shutdown.

  2. This is version should be the 1. non beta! Do you think that this is a "non beta" sdcard use case for smartphone users?

more questions:

Is it possible to expand the memory more flexible with a btrfs formated sdcard?

Can users use the sdcard to save content from SaifishOS apps (for example pictures direct from the camera program) direct to the sdcard?

Is there a concept for sdcard usage?

I would like to help Jolla working on a concept or with my scripting skills.

Edit 20140323: since 1.0.4.20 the mount is to late for pictures on the sdcard for ambiences Take a look at my posting for a custom mount script (based on my debugs) on TMO: http://talk.maemo.org/showpost.php?p=1418001&postcount=5

[Bug] mount-sd.sh is executed too to early (1.0.4.20 to late) at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

Edit update SailfishOS 1.0.4.20 (I did a factory reset before update): We have a new mount-sd.sh script. It is better than the previous one and handles fat, exfat, ntfs and other filesystems. The developer (no name in script) added ntfs support untested. The script is called only once at startup. But the mystery goes on, may be there are other problems - I don't know after short time of tests.

first some facts

I have a btrfs sdcard with hidden subvolumens and sourced a debug script at the end of mount-sd.sh that mounts the root of sdcard additionaly to /media/work (just to copy old data) and my personal .android subvol to /data/sdcard. No problems with the android disk space - I do not use much android apps! Native SailfishOS is more welcome.

Debug results:

cat /tmp/mount-sd.debug 
PID=1250, ACTION=add, DEVNAME=/dev/mmcblk1
mount -o subvol=/,dirsync,noatime,users /dev/mmcblk1 /media/work, rc=0
mount -o subvol=.android,dirsync,noatime,users /dev/mmcblk1 /data/sdcard/, rc=0
---callstack---
root         1     0  6 23:13 ?        Ss     0:01 /sbin/init --unit=default.target
root      1250     1  0 23:14 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh add mmcblk1
---end---

Do you want to see my debug script here too?

second some mysteries:

  1. The sdcard mount point changed to /media/sdcard/<UUID>/, result: programs have problems to address that path (filemanger, ownkeepass, cargodock). Users like me could never remember the<UUID> part to input it to a path in any program. What is the reason select such a comlex path name?

It would be fine to have a environment variable like MYSDCARD="/media/sdcard/<UUID>/" or some other reference to the sdcard. Or where can we find a reference to the path of the sdcard?

  1. I have two pictures for ambience at /media/sdcard<UUID>/Data/ambience/ (remember I can't remember <UUID>). I can see the pics in the gallery. The pics are in ambience format. I can create an ambience and tag it as favorite. After that I can select the ambiences as expected. After shutdown the ambiences are lost. Only the 9 standard ambiences and the "snow white" and " the first one" are persistent. I have to do all steps from gallery pictures again after every reboot. Ambiences from pictures on the sdcard are lost after shutdown.

  2. This is version should be the 1. non beta! Do you think that this is a "non beta" sdcard use case for smartphone users?

more questions:

Is it possible to expand the memory more flexible with a btrfs formated sdcard?

Can users use the sdcard to save content from SaifishOS apps (for example pictures direct from the camera program) direct to the sdcard?

Is there a concept for sdcard usage?

I would like to help Jolla working on a concept or with my scripting skills.

Edit 20140323: since 1.0.4.20 the mount is to late for pictures on the sdcard for ambiences Take a look at my posting for a custom mount script (based on my debugs) on TMO: http://talk.maemo.org/showpost.php?p=1418001&postcount=5

[Bug] mount-sd.sh is executed to early (1.0.4.20 to late) at startup

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

Edit update SailfishOS 1.0.4.20 (I did a factory reset before update): We have a new mount-sd.sh script. It is better than the previous one and handles fat, exfat, ntfs and other filesystems. The developer (no name in script) added ntfs support untested. The script is called only once at startup. But the mystery goes on, may be there are other problems - I don't know after short time of tests.

first some facts

I have a btrfs sdcard with hidden subvolumens and sourced a debug script at the end of mount-sd.sh that mounts the root of sdcard additionaly to /media/work (just to copy old data) and my personal .android subvol to /data/sdcard. No problems with the android disk space - I do not use much android apps! Native SailfishOS is more welcome.

Debug results:

cat /tmp/mount-sd.debug 
PID=1250, ACTION=add, DEVNAME=/dev/mmcblk1
mount -o subvol=/,dirsync,noatime,users /dev/mmcblk1 /media/work, rc=0
mount -o subvol=.android,dirsync,noatime,users /dev/mmcblk1 /data/sdcard/, rc=0
---callstack---
root         1     0  6 23:13 ?        Ss     0:01 /sbin/init --unit=default.target
root      1250     1  0 23:14 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh add mmcblk1
---end---

Do you want to see my debug script here too?

second some mysteries:

  1. The sdcard mount point changed to /media/sdcard/<UUID>/, result: programs have problems to address that path (filemanger, ownkeepass, cargodock). Users like me could never remember the<UUID> part to input it to a path in any program. What is the reason select such a comlex path name?

It would be fine to have a environment variable like MYSDCARD="/media/sdcard/<UUID>/" or some other reference to the sdcard. Or where can we find a reference to the path of the sdcard?

  1. I have two pictures for ambience at /media/sdcard<UUID>/Data/ambience/ (remember I can't remember <UUID>). I can see the pics in the gallery. The pics are in ambience format. I can create an ambience and tag it as favorite. After that I can select the ambiences as expected. After shutdown the ambiences are lost. Only the 9 standard ambiences and the "snow white" and " the first one" are persistent. I have to do all steps from gallery pictures again after every reboot. Ambiences from pictures on the sdcard are lost after shutdown.

  2. This is version should be the 1. non beta! Do you think that this is a "non beta" sdcard use case for smartphone users?

more questions:

Is it possible to expand the memory more flexible with a btrfs formated sdcard?

Can users use the sdcard to save content from SaifishOS apps (for example pictures direct from the camera program) direct to the sdcard?

Is there a concept for sdcard usage?

I would like to help Jolla working on a concept or with my scripting skills.

Edit 20140323: since 1.0.4.20 the mount is to late for pictures on the sdcard for ambiences. Take a look at my posting for a custom mount script (based on my debugs) on TMO: http://talk.maemo.org/showpost.php?p=1418001&postcount=5

[Bug] mount-sd.sh is executed to early (1.0.4.20 to late) at startup

150301: I decide to close this, because it is historic.

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

Edit update SailfishOS 1.0.4.20 (I did a factory reset before update): We have a new mount-sd.sh script. It is better than the previous one and handles fat, exfat, ntfs and other filesystems. The developer (no name in script) added ntfs support untested. The script is called only once at startup. But the mystery goes on, may be there are other problems - I don't know after short time of tests.

first some facts

I have a btrfs sdcard with hidden subvolumens and sourced a debug script at the end of mount-sd.sh that mounts the root of sdcard additionaly to /media/work (just to copy old data) and my personal .android subvol to /data/sdcard. No problems with the android disk space - I do not use much android apps! Native SailfishOS is more welcome.

Debug results:

cat /tmp/mount-sd.debug 
PID=1250, ACTION=add, DEVNAME=/dev/mmcblk1
mount -o subvol=/,dirsync,noatime,users /dev/mmcblk1 /media/work, rc=0
mount -o subvol=.android,dirsync,noatime,users /dev/mmcblk1 /data/sdcard/, rc=0
---callstack---
root         1     0  6 23:13 ?        Ss     0:01 /sbin/init --unit=default.target
root      1250     1  0 23:14 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh add mmcblk1
---end---

Do you want to see my debug script here too?

second some mysteries:

  1. The sdcard mount point changed to /media/sdcard/<UUID>/, result: programs have problems to address that path (filemanger, ownkeepass, cargodock). Users like me could never remember the<UUID> part to input it to a path in any program. What is the reason select such a comlex path name?

It would be fine to have a environment variable like MYSDCARD="/media/sdcard/<UUID>/" or some other reference to the sdcard. Or where can we find a reference to the path of the sdcard?

  1. I have two pictures for ambience at /media/sdcard<UUID>/Data/ambience/ (remember I can't remember <UUID>). I can see the pics in the gallery. The pics are in ambience format. I can create an ambience and tag it as favorite. After that I can select the ambiences as expected. After shutdown the ambiences are lost. Only the 9 standard ambiences and the "snow white" and " the first one" are persistent. I have to do all steps from gallery pictures again after every reboot. Ambiences from pictures on the sdcard are lost after shutdown.

  2. This is version should be the 1. non beta! Do you think that this is a "non beta" sdcard use case for smartphone users?

more questions:

Is it possible to expand the memory more flexible with a btrfs formated sdcard?

Can users use the sdcard to save content from SaifishOS apps (for example pictures direct from the camera program) direct to the sdcard?

Is there a concept for sdcard usage?

I would like to help Jolla working on a concept or with my scripting skills.

Edit 20140323: since 1.0.4.20 the mount is to late for pictures on the sdcard for ambiences. Take a look at my posting for a custom mount script (based on my debugs) on TMO: http://talk.maemo.org/showpost.php?p=1418001&postcount=5

[Bug] mount-sd.sh is executed to early (1.0.4.20 to late) at startup

150301: I decide to close this, because it is historic.

HI,

After some tests with mount-sd.sh I can confirm a speculation, that this script is called twice at startup.

In an early stage (processid round about 200) and later again (processid >1300).

Thats what it says in early stage: mkdir: cannot create directory `/run/user': Permission denied

It comes from here: su $DEVICEUSER -c "mkdir -p $MNT" #(where: MNT=/run/user/$DEF_UID/media/sdcard)

The folder /run/user does not exist at the early stage. Sometimes the /home folder is also mounted later, than mount-sd.sh is executed the first time.

Ambiences created from pictures on the sdcard will be lost at reboot.

mount-sd.sh should be executed

  1. after /run/user/100000 exists

  2. after /home is mounted

  3. before ambience resouces are checked

  4. before tracker starts (added 20140302)

Hope this is possible.

see also my post in a thread at maemo: http://talk.maemo.org/showthread.php?p=1414837#post1414837

Edit: made a debug script yesterday, here a short output what happens. I am using btrfs filesystem with subvolumes, a subvolume for ther android data path and a symbolic link /home/nemo/MyDocs (N9 retro feeling).

PID=224, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir: cannot create directory `/run/user/100000': Permission denied
mkdir -p /run/user/100000/media/sdcard, rc=1
 home is mounted.
mount -o subvol=.android /dev/sdcard /data/sdcard/, rc=0
---callstack---
UID        PID  PPID  C STIME TTY          TIME CMD
root       158     1 16 15:44 ?        00:00:00 /lib/systemd/systemd-udevd
root       163   158  4 15:44 ?        S      0:00 /lib/systemd/systemd-udevd
root       224   163  2 15:44 ?        S      0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---
PID=1318, ACTION=add
ln -sf /dev/mmcblk1 /dev/sdcard
ID_FS_TYPE=btrfs
mkdir -p /run/user/100000/media/sdcard, rc=0
mount -o compress /dev/sdcard /run/user/100000/media/sdcard, rc=0
 home is mounted.
su nemo -c "ln -sf /run/user/100000/media/sdcard /home/nemo/MyDocs"
---callstack---
root         1     0  6 15:43 ?        Ss     0:01 /sbin/init --unit=default.target
root      1318     1  1 15:44 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh
---end---

Edit update SailfishOS 1.0.4.20 (I did a factory reset before update): We have a new mount-sd.sh script. It is better than the previous one and handles fat, exfat, ntfs and other filesystems. The developer (no name in script) added ntfs support untested. The script is called only once at startup. But the mystery goes on, may be there are other problems - I don't know after short time of tests.

first some facts

I have a btrfs sdcard with hidden subvolumens and sourced a debug script at the end of mount-sd.sh that mounts the root of sdcard additionaly to /media/work (just to copy old data) and my personal .android subvol to /data/sdcard. No problems with the android disk space - I do not use much android apps! Native SailfishOS is more welcome.

Debug results:

cat /tmp/mount-sd.debug 
PID=1250, ACTION=add, DEVNAME=/dev/mmcblk1
mount -o subvol=/,dirsync,noatime,users /dev/mmcblk1 /media/work, rc=0
mount -o subvol=.android,dirsync,noatime,users /dev/mmcblk1 /data/sdcard/, rc=0
---callstack---
root         1     0  6 23:13 ?        Ss     0:01 /sbin/init --unit=default.target
root      1250     1  0 23:14 ?        Ss     0:00 /bin/bash /usr/sbin/mount-sd.sh add mmcblk1
---end---

Do you want to see my debug script here too?

second some mysteries:

  1. The sdcard mount point changed to /media/sdcard/<UUID>/, result: programs have problems to address that path (filemanger, ownkeepass, cargodock). Users like me could never remember the<UUID> part to input it to a path in any program. What is the reason select such a comlex path name?

It would be fine to have a environment variable like MYSDCARD="/media/sdcard/<UUID>/" or some other reference to the sdcard. Or where can we find a reference to the path of the sdcard?

  1. I have two pictures for ambience at /media/sdcard<UUID>/Data/ambience/ (remember I can't remember <UUID>). I can see the pics in the gallery. The pics are in ambience format. I can create an ambience and tag it as favorite. After that I can select the ambiences as expected. After shutdown the ambiences are lost. Only the 9 standard ambiences and the "snow white" and " the first one" are persistent. I have to do all steps from gallery pictures again after every reboot. Ambiences from pictures on the sdcard are lost after shutdown.

  2. This is version should be the 1. non beta! Do you think that this is a "non beta" sdcard use case for smartphone users?

more questions:

Is it possible to expand the memory more flexible with a btrfs formated sdcard?

Can users use the sdcard to save content from SaifishOS apps (for example pictures direct from the camera program) direct to the sdcard?

Is there a concept for sdcard usage?

I would like to help Jolla working on a concept or with my scripting skills.

Edit 20140323: since 1.0.4.20 the mount is to late for pictures on the sdcard for ambiences. Take a look at my posting for a custom mount script (based on my debugs) on TMO: http://talk.maemo.org/showpost.php?p=1418001&postcount=5