Bootstrap FreeKB - Linux Commands - How to access an SD Card on a Samsung device using Linux
Linux Commands - How to access an SD Card on a Samsung device using Linux

Updated:   |  Linux Commands articles

Use apt-get or yum to instal MTP. MTP stands for Media Transfer Protocol, and MTPFS is Media Transfer Protocol File System.

[root@server1 ~]# apt-get install mtpfs
[root@server1 ~]# apt-get install mtp-tools
[root@server1 ~]# apt-get install libmtp-common
[root@server1 ~]# apt-get install libmtp-dev

 

Create a directory for the Samsung device, and give users and MTP permission to the directory.

[root@server1 ~]# mkdir /media/Samsung
[root@server1 ~]# chmod 777 /media/Samsung
[root@server1 ~]# mtpfs -0 allow_other /media/Samsung

 

In the /etc/fuse.conf file, remove the comment from user_allow_other.

Connect the Samsung Device to the Linux computer, and an icon should appear on the desktop for the Samsung Device. Open the icon, and in the folder should be an option for the SD card.

When listing USB devices, the Samsung device should be listed.

[root@server1 ~]# lsusb
Bus 002 Device 017: ID 04e8:6860 Samsung Electronics Co

 

Ensure MTP can detect the device.

[root@server1 ~]# mtp-detect
. . . 
  Found 1 device(s):
  Samsung: Galaxy models (MTP) (04e8:6860) @ bus 2, dev 17

 

Connect the device.

[root@server1 ~]# mtp-connect

 

In the /lib/udev/rules.d/69-libmtp.rules file, add the following to the area of the file that lists Samsung devices.  Replace "04e8" with the first 4 characters of the ID from the lsusb command. Replace "6860" with the last 4 characters of the ID from the lsusb command.

ATTR{idVendor}=="04e8", ATTR{idProduct}=="6860", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1"

 

Restart the UDEV service, and ensure the UDEV service is active and running.

[root@server1 ~]# service udev restart
[root@server1 ~]# service udev status

 

Use the ls (list) command to view the devices in the /dev directory, and use grep to only display the Samsung device.

[root@server1 ~]# ls /dev | grep "Samsung"

 


Troubleshooting:

  • Connect the USB cable to the Linux computer first, and then to the Samsung Device
  • Connect the USB cable to the Samsung Device first, and then the Linux computer
  • Ensure the Samsung Device screen is not in sleep mode
  • Ensure the Samsung Device shows charging when the USB cable is connected
  • Try a different USB connector on the Linux computer
  • Ensure the USB cable is securely connected to both the Samsung Device and the Linux computer
  • Try a different USB cable
  • On the Samsung device, tick or remote the tick at Settings > USB debugging

 

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 54eb4d in the box below so that we can be sure you are a human.