Automount SD card when logging on as non-root?

Please post all general support questions for LXDE here.
Locked
Winfried
Posts: 2
Joined: Sun Apr 09, 2017 8:32 pm

Automount SD card when logging on as non-root?

Post by Winfried »

Hello

I'm running LXDE Debian 8.7.

The SD card is displayed automatically on the desktop when logged on as root, and not when I log on as non-root, although the SD card is successfully detected by Linux:

Code: Select all

# fdisk -l

Disk /dev/sdb: 3.7 GiB, 3957325824 bytes, 7729152 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1        8192 7729151 7720960  3.7G  b W95 FAT32

Code: Select all

# lhw
…
*-usb:0
     description: Mass storage device
     product: Mass Storage Device
     vendor: Generic
     physical id: 5
     bus info: usb@4:5
     logical name: scsi6
     version: 1.00
     serial: 058F63666433
     capabilities: usb-2.00 scsi emulated
     configuration: driver=usb-storage maxpower=100mA speed=480Mbit/s
   *-disk
        description: SCSI Disk
        physical id: 0.0.0
        bus info: scsi@6:0.0.0
        logical name: /dev/sdb
        size: 3774MiB (3957MB)
        capabilities: partitioned partitioned:dos
        configuration: logicalsectorsize=512 sectorsize=512
      *-volume
           description: Windows FAT volume
           vendor: PWRSHOT
           physical id: 1
           bus info: scsi@6:0.0.0,1
           logical name: /dev/sdb1
           version: FAT32
           serial: 0101-0014
           size: 3762MiB
           capacity: 3770MiB
           capabilities: primary fat initialized
           configuration: FATs=2 filesystem=fat label=CANON_DC
I tried this, but it didn't work:
https://www.ab9il.net/linux/pcmanfm-usb-mount.html

What should I try to have the SD card show up on the desktop without doing anything?

Thank you.
Lew_Rockwell_fan
Posts: 45
Joined: Wed Aug 07, 2013 4:28 am
Location: Trantor

Re: Automount SD card when logging on as non-root?

Post by Lew_Rockwell_fan »

Did you try putting an appropriate line in /etc/fstab? I'm assuming it works like any other removable media and I might be wrong about that. But if it does, fstab would be the traditional way. For the exact syntax, study:
man fstab

You want it set to automount, and NOT to put booting on hold if it isn't there. Then it should mount at boot if it is connected. As for mounting later when you connect it, you can set it to require a password at that time or not. If it is in fstab correctly you can also mount it and all the other things similarly denoted in fstab at one time with:
mount -a

You can also mount it manually from a terminal. See:
man mount

You can also put the commands that work manually in a script with an easy to remember name and put it in your path if you want to do it that way.
drooly
Posts: 791
Joined: Mon Apr 08, 2013 6:45 am

Re: Automount SD card when logging on as non-root?

Post by drooly »

you're logging on as root???

that in itself can cause harm, maybe even to the very problem you're having.

if you HADN'T logged in as root, i'd say you need to fix policykit - often making sure that lxpolkit is autostarted is enough.
Locked