This tutorial is only for arm routers like RT-AC56U, RT-AC68U, RT-AC87U, RT-AC3200, RT-AC5300...
useful for PlexMediaServer, MiniDlna, Transmission...
1 - Setup Debian Jessie from here
2 - Enter chrooted debian with:
debian enter
3 - Update Debian
apt update && apt upgrade -y
4 - Install cifs-utils
apt install cifs-utils
5 - Create mount directory
mkdir -p /mnt/samba
6 - Add ip address of samba share, user and password to /etc/fstab (change values in red)
cat >> /etc/fstab << 'EOF'
//192.168.1.100/shared_folder /mnt/samba cifs user=share_username,password=share_password,uid=1000,umask=000 0 0
EOF
//192.168.1.100/shared_folder /mnt/samba cifs user=share_username,password=share_password,uid=1000,umask=000 0 0
EOF
Press ENTER
7 - Create /etc/init.d/samba-mount startup script
cat >> /etc/init.d/samba-mount << 'EOF'
#! /bin/sh
### BEGIN INIT INFO
# Provides: mount
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop: 6
# Short-Description: Mount Samba Shares
# Description:
# Author: TeHashX / [email protected]
# Version: 1.1
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/lsb/init-functions
do_stop () {
log_action_msg "Umounting shares"
umount -a
}
case "$1" in
start)
log_action_msg "Mounting shares"
mount -a
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
do_stop
;;
status)
exit 0
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
EOF
#! /bin/sh
### BEGIN INIT INFO
# Provides: mount
# Required-Start:
# Required-Stop:
# Default-Start:
# Default-Stop: 6
# Short-Description: Mount Samba Shares
# Description:
# Author: TeHashX / [email protected]
# Version: 1.1
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
. /lib/lsb/init-functions
do_stop () {
log_action_msg "Umounting shares"
umount -a
}
case "$1" in
start)
log_action_msg "Mounting shares"
mount -a
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop)
do_stop
;;
status)
exit 0
;;
*)
echo "Usage: $0 start|stop" >&2
exit 3
;;
esac
EOF
Press ENTER
8 - Set permissions
chmod +x /etc/init.d/samba-mount
9 - Exit Debian
exit
10 - Add samba-mount to chrooted services list
echo "" >>/opt/etc/chroot-services.list
echo "samba-mount" >>/opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list
echo "samba-mount" >>/opt/etc/chroot-services.list
chmod 755 /opt/etc/chroot-services.list
Press ENTER
11 - Restart Debian
debian restart
Now your shared folder should be mounted under /mnt/samba inside debian, verify with
ls /opt/debian/mnt/samba
Should see files and directories list :)
Enjoy...
REVIEW (CLICK ON THE STARS TO RATE!)
4