Seagate Central NAS – Enable USB Over DLNA

Problem: When connecting a USB device to the Seagate Central the NAS will happily serve the contents as a standard SAMBA share, but when trying to stream media via DLNA only items located on the internal hard drive are available.

Solution: Gain root access to the Seagate Central to enable advanced Twonky DLNA server configuration and to remap USB mount points for DLNA accessibility.

Unlock the features that Seagate should have enabled from the factory!

Disclaimer: Although fairly detailed in its explanation, this guide assumes some level of proficiency with computers (including Linux) and networking (SAMBA and SSH specifically) as well as a degree of common sense. There are inherent risks in gaining root access to the Seagate Central as well as flashing custom firmware to any device. While this method has been tested to work, safe and expected results can not be guaranteed.

Firstly, an SSH client such as PuTTY is needed in order to run terminal commands on the NAS. Simply install PuTTY and start a new SSH connection using the IP address of the NAS.

Secondly, become familiar with the content of the three links below. Advanced users who already have root access and know how to configure Twonky can either skim or skip this extended reading. However, most users following this guide will need to follow these procedures step-by-step.

http://seagatecentralenhancementclub.blogspot.com.au/2015/08/revert-to-previous-firmware-on-seagate.html
http://seagatecentralenhancementclub.blogspot.com/2015/11/root-su-recovery-for-seagate-central.html
http://seagatetwnky.blogspot.com/

Thirdly, although strictly unrelated to this guide, it’s worth mentioning that once root access is obtained, it is possible to activate a boost in transfer speed by issuing the following commands via an SSH terminal:
su root
[enter root password]
ifconfig eth0 mtu 9000

This enables jumbo frames and will likely result in a significant throughput increase if the NAS is connected to a properly configured gigabit network. A common complaint about the Seagate Central is its apparent 10 MB/s limitation, but it is actually capable of outperforming USB 2.0 with transfer speeds of 25+ MB/s.

Once the Seagate Central has been “upgraded” with root access and a configurable Twonky server, the issue of USB over DLNA can finally be addressed.

When connecting a USB drive to the NAS, it will generally show up as an SMB (Windows Networking) share called “usb1-1shareX” with ‘X’ being a number (or occasionally another permutation “usb1.Y-1shareX” where ‘Y’ is 2, 3, etc.) Unfortunately, while the contents can be accessed through File Explorer or other means, the DLNA server (Twonky) will not automatically look for those contents and–more detrimentally–USB drives cannot be manually shared through the Twonky configuration interface. By default, only the “/Public” folder is available through DLNA, and even with advanced Twonky configuration only subfolders within the “/Data” directory can be added manually. Bypassing this factory limitation is possible and the method to do so is explained by the remainder of this guide.

By opening an SSH session with the Seagate Central, it can be discovered that the USB drive contents are located within “/shares” (example: /shares/usb1-1share1) while they need to be in “/Data” in order to be DLNA accessible. The “/Data” folder is also where the “/Public” folder is stored, along with any user folders–including, at minimum, the admin account which is created during the initial setup.

Clearly the USB contents cannot just be copied to the “/Data” folder as that would defeat the purpose of using an external drive, so the best practice is to simply change the Twonky DLNA content base directory by entering “http://xxx.xxx.xxx.xxx:9000/rpc/set_option?contentbase=/shares” (substituting the NAS IP, of course) [ex: 192.168.1.12] in a web browser. This changes the DNLA root directory from “/Data” to “/shares”, so now Twonky can be manually configured to scan “/shares/Public” as well as any desired USB mount points such as “/shares/usb1-1share2” and so forth. The “/shares” directory as a whole could be DNLA scanned but it may contain subfolders or USB drives that would be undesirable to share. Cuing Twonky to automatically DLNA share any subfolder within “/shares” would include both “/Public” and every mounted USB drive, even as they are dynamically changed. Beneficially, this would eliminate manually sharing each USB mount name, although with the possibly adverse side effect of not being able to omit select USB drives from being DLNA shared. Manually adding each USB subfolder to Twonky’s share list as the need arises is recommended, but all likely USB directory name permutations can simply be added to the list beforehand.

In a web browser, go to “http://xxx.xxx.xxx.xxx:9000/” (again, substituting the NAS IP) and then select the Sharing tab. Click the “Add a New Folder” button, “Browse” button, and select the “usb1-1share1” (or the appropriate USB share) folder. Now select the already configured “/Public” share and browse to “/shares/Public” to remap that directory. Save the changes.

It will take a few minutes for Twonky to scan all the content again, but it should automatically index everything properly.

Addendum

There is second approach that can be used, albeit comparatively impractical. It is included below for the sake of academics and to prove there are multiple ways to skin Seagate’s overly restrictive cat.

Linux’s mount command is another means to sidestep this issue, as the bind argument can function much like a symbolic link, alias, or shortcut would, and anything accessing the mount point will thereby see the root directory of the USB drive instead.

Note: Remember that Linux is a case-sensitive operating system when entering these commands!

1) Create a new directory in “/Data” called “USB”:
cd /Data
sudo mkdir USB

2) Bind mount the old USB drive folder to the newly created “/Data/USB” folder (where X is the number assigned to the USB drive):
sudo mount --bind /shares/usb1-1shareX /Data/USB

3) Configure Twonky to share the newly created “USB” folder.

4) Bind mounting will not survive a NAS reboot, unless it is scripted be persistent. It would be a reasonable guess to edit /etc/rc.local or /etc/fstab, but this method will not work in MontaVista Linux, so another scheme is utilized which automatically calls a user-created script:
cd /etc/rc5.d/
touch S99usbdlna
sudo nano /etc/rc5.d/S99usbdlna

Add the following lines into nano:
mount --bind /shares/usb1-1share1 /Data/USB
mount --bind /shares/usb1-1share2 /Data/USB
mount --bind /shares/usb1.2-1share1 /Data/USB
mount --bind /shares/usb1.2-1share2 /Data/USB
mount --bind /shares/usb1.3-1share1 /Data/USB
mount --bind /shares/usb1.3-1share2 /Data/USB
mount --bind /shares/usb1.4-1share1 /Data/USB
mount --bind /shares/usb1.4-1share2 /Data/USB
exit 0

Hit Control-X then ‘Y’ to commit changes.

Note: This is a bit of a quick-and-dirty kludge as it tries to mount multiple USB drive names to the same directory, anticipating only 1 or 0 will be found. There is surely a more elegant way of doing it, if someone clever wants to suggest a modified script.

Additional Note: Seagate Central will work with a USB hub, so it is entirely possible to have more than one drive connected at once. In order for this to work with DLNA, more than one bind mount must be done so USB2, USB3, USB4, etc. would also need to be created, bind mounted, and DLNA shared in a similar fashion. The directory names and number of directories can be tailored to taste depending on the individual setup, or a more advanced and adaptable script could be written to automate the procedure.

As an example of the above concept:
cd /Data
sudo mkdir USB2
sudo mkdir USB3
sudo mkdir USB4
sudo mkdir USB5
sudo mkdir USB6
sudo mkdir USB7
sudo mkdir USB8
sudo nano /etc/rc5.d/S99usbdlna

Next, alter the S99usbdlna script to look like the following (simply change all references to the USB folder to USB-USB8 incrementally):
mount --bind /shares/usb1-1share1 /Data/USB
mount --bind /shares/usb1-1share2 /Data/USB2
mount --bind /shares/usb1.2-1share1 /Data/USB3
mount --bind /shares/usb1.2-1share2 /Data/USB4
mount --bind /shares/usb1.3-1share1 /Data/USB5
mount --bind /shares/usb1.3-1share2 /Data/USB6
mount --bind /shares/usb1.4-1share1 /Data/USB7
mount --bind /shares/usb1.4-1share2 /Data/USB8
exit 0

Hit Control-X then ‘Y’ to commit changes.

If additional bind mounts are created in such a way, remember to also add USB2-USB8 as folder shares through Twonky’s configuration interface.

Lastly–in either case–the script needs to be made executable, so change its permissions:
sudo chmod 755 /etc/rc5.d/S99usbdlna

Now the bind mount will attempt to run automatically during every boot. However, this method does not work well with on-the-fly disk swapping as the mount is maintained even when the drive is ejected. Although it should be generally harmless, installing the script is only recommended when piggybacking a USB drive onto the NAS in a semi-permanent fashion as any USB disk swapping may or may not require a full reboot to be properly recognized through DLNA. Also, the script has not been extensively tested, so unforeseen consequences may arise.

Extra Bonus Trick

It would be logical to think that connecting a USB device to the Seagate Central would be a quicker, more efficient means of copying files to the NAS, but attempting to do so only results in the file being read from the USB drive, passed through the network, and finally being written back to the internal storage of the NAS rather than reading/writing directly between the USB/internal storage. This scheme not only ties up the network, but the computer used to initiate the file transfer. By using SSH, this can be done the intended way. Here’s an example of copying all the MKV files from a USB drive into a DLNA video share folder:

cd /shares/usb1-1share2
cp *.mkv /Data/Public/Videos

Bookmark the permalink.