Steam Link

Steam Link

da_norf Sep 29, 2016 @ 1:50pm
Using an USB mass media device with Steam Link
With the arrival of Native Apps like Kodi or MAME4ALL, some of us could want to plug an USB mass media device in the Link and use it to store data for these apps.
The benefits would be :
  • get rid of the 1G size limit of the apps partition
  • save some write cycles on the flash chips.
  • ...

But, there's a problem. By default, if you power on the Link with an usb mass media device plugged in, it will be unmounted after boot sequence and, so far, there's no clue of an automount that would bring your USB device to life if you plug it after boot.

Here is a trick that worked for me (and potentially should for you, or should destroy your Steam Link) :
  • On the usb device you want to use with your Link, create this path : '/steamlink/overlay/etc/init.d/startup'.
  • In the 'startup' folder create a file called 'S19mnt_usbdsk.sh'.
  • Edit this file with the following text :
    #!/bin/sh # MOUNT_DISK=/mnt/disk ERROR_MOUNTING_PARTITION_FILE=/tmp/error_mounting_partition.txt # Check if we have a Mass Media device on USB mass_media_class=$(find /sys/devices/soc.0/f7ee0000.usb/ -name bInterfaceClass | xargs grep 08) if [ -n "$mass_media_class" ]; then # Additional wait for the disk device to be created sleep 2 mkdir -p ${MOUNT_DISK} # Iterate over all partitions for device in $(blkid | awk -F ':' '{ print $1 }'); do case $device in /dev/loop*) ;; /dev/block/loop*) ;; *) echo "Found device $device" > /dev/console mount_status=$(grep "$MOUNT_DISK" /proc/mounts) if [ -z "$mount_status" ]; then mount $device ${MOUNT_DISK} ret=$? if [ $ret -ne 0 ]; then # Pass device name to application, it can indidate it to user echo "$device" >> $ERROR_MOUNTING_PARTITION_FILE fi fi esac done break fi
  • Power off your Link, plug the USB media and let's start it again.
  • In my case, I had to power cycle the Link a second time.

That's all, after the second power cycle, the USB media should become usable with the native apps installed on the Link as '/mnt/disk' folder.

Note : the above script is mainly a copy/paste of existing scripts found in the Steam Link SDK. Someone with more scripting knowledge than me could surely write something better.
Last edited by da_norf; Sep 29, 2016 @ 1:56pm
< >
Showing 1-15 of 17 comments
Malhavoc Dec 7, 2016 @ 5:28am 
Would it be possible to mount network folders in a similar way, like a network HD or NAS, or maybe even a Windows shared folder?
Malhavoc Dec 10, 2016 @ 6:58am 
...anyway, I can confirm that this worked for me too, using Mame4All app.

I built Mame4all, and modified the mame.cfg file, chaning the line "rompath=roms" to "rompath=/mnt/disk/mame4all/roms"

Flashed mame4all as described in the guide, then removed the USB, deleted all file, and followed your guide above, and also added in the root a "mame4all/roms" folder where I put all my roms.

Restarted the link with the usb plugged in, and mame4all could not see the roms yet, but started a second time (as you told!), and it worked perfectly! Now the only problem is that the Mame4all interface is terrible to browse 2000+ rom :D
da_norf Dec 10, 2016 @ 11:55am 
Originally posted by Malhavoc:
...anyway, I can confirm that this worked for me too, using Mame4All app.
Thank you for your positive feedback.

Originally posted by Malhavoc:
Now the only problem is that the Mame4all interface is terrible to browse 2000+ rom :D
Hey ! You must have a very large shelve to store all these arcade boards... :D

Originally posted by Malhavoc:
Would it be possible to mount network folders in a similar way, like a network HD or NAS, or maybe even a Windows shared folder?
If someone manage to complie the needed drivers for nfs, samba or any other net fs, it would be possible, for sure.
Flying Poo Dec 30, 2016 @ 12:18pm 
Confirmed working. Love it!
Great_Scottsman Jan 19, 2017 @ 7:58pm 
Can I run Kodi right off a usb stick instead of installing it as a Native app in the steam link?
leadbman Feb 15, 2017 @ 7:32pm 
Hi guys,

I tried that script in the folder suggested a few times but in '/mnt/disk' when I folder search in Retroarch and Kodi both show nothing in the folder. I found the created 'S19mnt_usbdsk.sh' file on the Steam Link and opened it via SCP to check it and it shows the code provided here so the file has been loaded onto the Link. So I'm not sure what I'm doing wrong.

Hope someone can help!
m1sc Feb 18, 2017 @ 6:05am 
leadbman's issue has been fixed.

Issue: init.d startup script was in init.d folder on system drive.
Solution: ran
mkdir -p ./steamlink/overlay/etc/init.d/startup
on the usb, fixed up script formatting in vim (copy and paste killed formatting - i like my scripts to look nice :rbiggrin:), moved script to usb, power cycled twice and worked as advertised.

If I ever get a link i'll be running this myself. thanks for sharing :like:
leadbman Feb 18, 2017 @ 6:44am 
Originally posted by misc.:
leadbman's issue has been fixed.

Issue: init.d startup script was in init.d folder on system drive.
Solution: ran
mkdir -p ./steamlink/overlay/etc/init.d/startup
on the usb, fixed up script formatting in vim (copy and paste killed formatting - i like my scripts to look nice :rbiggrin:), moved script to usb, power cycled twice and worked as advertised.

If I ever get a link i'll be running this myself. thanks for sharing :like:

Turns out because I tried copy and pasting the code via Notepad in Windows then copying it over via SCP it had hidden extra characters that I didn't see on the Windows side. We noticed them after checking the file in Linux.

Glad I'm able to utilise my external storage now.

Thanks for the help misc!
Ember Mar 16, 2017 @ 8:07pm 
Can someone please help, I don't know what I'm doing wrong.

I've made the file "steamlink/overlay/etc/init.d/startup/S19mnt_usbdsk.sh" with that content and put it on the USB I want to use as mass media storage (along with some videos I wanted to test it with).

"/mnt/disk" exists after the first time I power cycled, but I can't find any of the videos I put on the USB for testing, nor can I SFTP any large files across to the folder (which should be able to fit onto the USB).

(I did try power cycling multiple times)

Can I leave the "S19mnt_usbdsk.sh" file on the USB when I'm done or must I remove it?
SpooFie Apr 10, 2017 @ 2:14am 
could some one share this file somewhere?
i have tried creating it, but not working for me , i even went as far as retyping the code line for line
PS: I am not a coder or a linux user, or a programmer
i used ubuntu 14.4 create new file etc and then saved it as S19mnt_usbdsk.sh

I dont know it thats how its supposed to me done :steamfacepalm:
SpooFie Apr 10, 2017 @ 2:19am 
I managed to get m4a installed on my Slink (thanks to folks on the forum) , and SSH working
put some games on ... but after a few days my link just stops working, well it gives me a black screen on start up,
and if i pull the power , it just stays on the loadup screen forever.
so hoping doing it this way it might stay alive.
and the reason for the native install is so my GF can play on the link while im jamming games on the pc.
:steammocking:
thanks
SpooFie Apr 10, 2017 @ 2:57am 
sorry again guys one last thing, do i have to do each step individually?
I cant put it all on the flash drive in on go
ie.
'/steamlink/overlay/etc/init.d/startup'
'/steamlink/apps/
'/steamlink/config/system/
?
ruvelro May 1, 2017 @ 2:42am 
It does'n work... i cant read my USB on Kodi or RetroArch... I even create the file from Linux... Any idea?
Sneider Nov 4, 2017 @ 5:54am 
Please can somebody upload the script file somewhere? It seems that it is not working for me currently.
Thank you.
Giorgsen Mar 14, 2018 @ 7:43am 
Originally posted by leadbman:
Originally posted by misc.:
leadbman's issue has been fixed.

Issue: init.d startup script was in init.d folder on system drive.
Solution: ran
mkdir -p ./steamlink/overlay/etc/init.d/startup
on the usb, fixed up script formatting in vim (copy and paste killed formatting - i like my scripts to look nice :rbiggrin:), moved script to usb, power cycled twice and worked as advertised.

If I ever get a link i'll be running this myself. thanks for sharing :like:

Turns out because I tried copy and pasting the code via Notepad in Windows then copying it over via SCP it had hidden extra characters that I didn't see on the Windows side. We noticed them after checking the file in Linux.

Glad I'm able to utilise my external storage now.

Thanks for the help misc!
Heia, Could you elaborate on what you meant by this? what does run on usb mean exactly?
< >
Showing 1-15 of 17 comments
Per page: 1530 50