Author Topic: Automount microSD  (Read 1795 times)

rcolistete

  • Newbie
  • *
  • Posts: 12
    • View Profile
Automount microSD
« on: August 18, 2018, 03:30:12 pm »
I'm using Debian 9.4 on Gemini with triple boot (Android, Debian, Sailfish), firmware from July 2018.

As there is no auto mounting of microSD card, I've used the following steps to have 2 partitions (FAT32, Ext4) on microSD visible on Debian :

Just once :
Code: [Select]
$ sudo mkdir -p /media/sd
$ sudo chmod 777 /media/sd
$ sudo mkdir -p /media/sdext4
$ sudo chmod 777 /media/sdext4

Created "/etc/fstab" with the content :
Code: [Select]
/dev/mmcblk1p1    /media/sd            vfat    defaults,noatime,discard,user,umask=0000        0       0
/dev/mmcblk1p2    /media/sdext4        ext4    defaults,noatime,discard        0       0

I've realized that small errors on this fstab, or microSD nor inserted, make Debian to not boot ! The above one works (if there is a microSD inserted).

Any better way to auto mount microSD partitions on Debian ?

Da_Blitz

  • Hero Member
  • *****
  • Posts: 1579
    • View Profile
    • http://www.pocketnix.org
Automount microSD
« Reply #1 on: August 19, 2018, 04:18:47 am »
under systemd based distros i would recomend a mount unit and an automount unit (man systemd.mount and man system.automount) once set up, this will mount he directory of choice on demand without entering user details

as an alternative 'udisk2' can be used that consists of a daemon and cli util and has native support in gnome to allow you to mount and unmount partitions

both will avoid the boot issue you described. i would recommend the udisk method for removable devices such as usb sticks and the auto mount for builtin storage such as the micro sd card slot, i frequently use this for network filesystems when coupled with the auto unmount options
Personal Blog
Code
Twitter

Gemini Order: #95 (roughly)
Current Device: Samsung Chromebook Gen 3
Current Arm Devices Count: ~30
Looking to acquire: Cavium Thunder X2 Hardware