0

I am using a rooted Xperia Z5 Compact E5823 with the latest stock Android 6.0 ROM.
I am trying to use a 2nd partition with Link2SD but so far I always get the same "No such file or directory"-error:

Mount script error

Mount script cannot be created.

mount: mounting /dev/block/vold/179:66 on /data/sdext2 failed: No such file or directory

To format my microSD card I've used GParted under Debian with ext2, 3, and 4, always as primary partition. I've also used TWRP recovery to format this 2nd partition. With this I have only tried ext3, which my Debian recognizes as ext2 and there seems to be no way to choose which type of partition (I suppose they have primary as default). With TWRP I could also try ext4 but preferred to 1st post here.

I do see a /data/sdext2 folder with help of a root file browser. This folder is empty.

The "file" /proc/partitions does show a 179 66 2000000 mmcblk1p2 entrance, which correspond to the second partition of my external SD card.

Link2SD has superuser permissions and its mount script /data/data/com.buak.Link2SD/init-link2sd.sh looks like this:

set +e
echo "$(date) mounting..." > $LOG
sleep 2
mount -t ext2 -o rw /dev/block/vold/179:66 /data/sdext2 1>>$LOG 2>>$LOG

mount -t ext2 -o rw /dev/block/mmcblk1p2 /data/sdext2 1>>$LOG 2>>$LOG

mount >> $LOG
echo "$(date) mount finished" >> $LOG
chmod 773 /data/dalvik-cache

  • 1
    Did you try to comment the first instance of mount in the script, and see if it works? – Death Mask Salesman Apr 29 '16 at 10:16
  • do you meam to comment set +e out? – scjorge Apr 29 '16 at 10:19
  • No, to comment mount -t ext2 -o rw /dev/block/vold/179:66 /data/sdext2 1>>$LOG 2>>$LOG. – Death Mask Salesman Apr 29 '16 at 10:20
  • I'll try it out and let you know :) – scjorge Apr 29 '16 at 10:21
  • wow! that seems to almost completely do the trick! The only unsatisfying thing is that I get a mount warning in every boot, saying that the second partition was not.mounted on boot but after so my linked apps "are not recognized by the system yet". I have then the option to Quick Reboot, Cancel, or Recreate mount scripts... – scjorge Apr 29 '16 at 10:50
1

You can use application "Apps2SD" mount a 2nd partition (after remove it and use Link2SD). (Don't use it if you only use 1 partition is sdext2) If you use android 6.0 and use both 2nd partition and "Adoptable storage" use "Root Explorer" go to path "/etc/apps2sd-mountscript.sh" edit it. Because use 2 partition, so default it use if create is "dev/block/mmcblk1p1 /data/sdext2", you change it to "dev/block/mmcblk1p2 /data/sdext2" (I use Sony M4 aqua dual)

  • On Version new of Apps2SD you can remount ext2 by change mmcblk1p1 on dialog to mmcblk1p2 can't success so You don't edit by manual! – Nam Dec 13 '16 at 15:37
  • On Version new of Apps2SD you can remount ext2 by change mmcblk1p1 on dialog to mmcblk1p2 can success so You don't edit by manual! – Nam Dec 13 '16 at 15:41
0

This error was very tricky to track! It took me a while to re-address it and here is what I have found out and how to solve it.

A little on mmcblk_p_

  1. SD cards are special about their "block-partition"-suffix, i.e. the -blk*p* part.
  2. For the user, the numbers in the suffix -blk*p* are, on practical matters, determined by the system the card is mounted on.
  3. Link2SD's script is sensitive to the correspondance of the microSD card's "internal" partition-suffix (-p*) and its "external"/"mounted" under some system. (Thus, the No such file or directory).

Solution

For Link2SD's default mount script to succeed, you must delete and re-do the microSD card's partition table (with GParted or similar) and then do its two (or more) partitions, the second one being an ext2-filesystem. This will yield a correspondance on the suffix-numbers -p* of your "second ext2-partition" both in the card and under the system.

Background

Well, I noticed that each time an SDcad gets a new partition the last index in the suffix -blk*p_ "advances". The microSD card in question has been partitioned more that three times without resetting its partition table. That card has no "internal" -p2 eventhough Android's kernel addresses it as such! (Tricky, huh?!) It seams that Android's kernel only takes the number of existing partitions to create the /proc/partitions-addresses instead of the total count of partitions ever done under an existing partition-table.

Extra-Info

Link2SD guarantees that your second ext2-partition won't be shown on your PC when you plug your device to it via USB. This is true for Windows but unfortunately not true for GNU+Linux! Windows does not recognizes ext2-filesystems. GNU+Linux does. As a consequence some APPs might have trouble retrieving ingormation from /data/sdext2.

Finally

Link2SD latest version at the PlayStore is 4.3.4 from 21.06.2018 and it locates its mount-script at /data/data/com.buak.Link2SD/files.

Also, for more information, visit Link2SD's official site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.