Automount SD card
#1
I boot ubports from the eMMC (preinstalled) and added a micro-sd to the system. If I mount the card manually, I get at least "read" access to the card. But there is no auto-mount happening of the sd-card. Does anyone have any suggestions to automatically mount the card and be able to write to it?
#2
(06-19-2020, 06:45 PM)MasterGreenbolt Wrote: I boot ubports from the eMMC (preinstalled) and added a micro-sd to the system. If I mount the card manually, I get at least "read" access to the card. But there is no auto-mount happening of the sd-card. Does anyone have any suggestions to automatically mount the card and be able to write to it?

I am trying to figure that out now too.

https://forums.ubports.com/topic/4457/pi...mounting/6

It appears to be a known issue.
#3
I just wrote a bash script to mount my sdcard to ~/sdcard. it's a slight nuisance, but at least it's very simple
#4
(07-06-2020, 06:12 PM)hiimtye Wrote: I just wrote a bash script to mount my sdcard to ~/sdcard. it's a slight nuisance, but at least it's very simple

How did you mount it as writeable?
#5
you mount it with the user as the owner.

echo $UID

will give you the user's ID. for me it was 32011

sudo umount /media/sdcard
sudo mkdir /media/sdcard
sudo mount -U 1A11-CBE8 /media/sdcard -o uid=32011

to get the UUID of the sdcard, check /dev/disk/by-uuid/ and it should be an identifier in the form of ####-####
#6
To automount the SD card you will have to edit /lib/init/fstab since /etc/fstab is regenerated at every boot.

Step by step:

1) Create a new directory for mounting the SD card. I've put it in my home directory:
mkdir SD

2) get the device name of your SD card by calling:
lsblk
It will be something like mmcblk0

3) check the file system of the SD card:
grep "^device /dev/" /proc/self/mountstats
If formated by ubuntu touch it should be VFAT.

4) make the system writable:
sudo mount -o rw,remount /

5) get root privileges:
sudo su

6) edit /lib/init/fstab by calling:
nano /etc/fstab

7) You'll have to set the keyboard to nano's hotkeys using the menu on the left.
Otherwise you won't be able to save and exit. Add the following line right at the end:
/dev/mmcblk0 /home/phablet/SD vfat rw,auto,user,umask=0000 0 0
You will have to change the mount-directory, device name and filesystem according to what you found out in steps 1), 2) and 3)!

8) Restart your phone.

Please remember: When your phone is updated to a new release, you will have to apply this change again!
#7
this is the method that I used:

1. install udiskie
sudo pacman -Syu udiskie

2. add udiskie to autorun
<varies by choice of desktop>

3. create a symlink to /run/media/yourUsername as a quick shortcut in your home folder to any inserted sdcards
ln -s /run/media/yourUsername $HOME/sdcard

et voila! no matter what sd card you insert, and no matter what updates you perform, it will still mount your sdcards to the sdcards folder in your home folder.
#8
There is a new Ubuntu touch image ( Aug 13, 2020 #73) that was released did this fix the problem? What file systems does it not work with at the moment?


Possibly Related Threads…
Thread Author Replies Views Last Post
  file manager vs. SD card laserpyramid 6 5,500 10-18-2021, 03:10 AM
Last Post: acrux
  Copy To SD Card, All I get Is Red Light & Black Screen . . . . NobodyNew1 9 11,007 09-13-2020, 08:59 PM
Last Post: NobodyNew1
  Is bluetooth lag for A/V playback due to SD card? Cree 1 2,682 08-02-2020, 06:30 PM
Last Post: hiimtye
  Booting from SD card bingo600 1 2,670 06-20-2020, 02:33 AM
Last Post: bingo600
  SIM card not detected AddieDirects 5 7,433 06-12-2020, 04:06 PM
Last Post: Momomentum
  accessing sd card from terminal / file manager pepo 2 3,755 03-17-2020, 07:24 AM
Last Post: pepo

Forum Jump:


Users browsing this thread: 1 Guest(s)