
In short, what happened:
- ADSL 2+ Internet connection
- Two home WiFi 802.11g / n networks - 2.4Ghz and 5Ghz with a speed of more than 100 megabits / s
- Gigabit cable connection
- Network storage on 6TB, in the form of four 2 x 2TB and 2 x 1TB drives with a standalone torrent client
- SMB / CIFS server with a stable write / read speed of 12-14 megabytes / s
- NFS server with write / read speed of 9-10 or 15-18 megabytes / s (TCP / Windows or UDP / Linux)
- UPNP / DLNA server with a reading speed of 8-10 megabytes / s
- 46-inch LED TV with built-in WiFi 802.11n, capable of working with network storage and itself capable of distributing content via SMB / CIFS from its USB drive
- Old 42-inch TV with a connected BD player with support for Ethernet and DLNA client working with network storage
- 4 home computers, including Mac and 4 mobile phones that work with all of the above, including mobile servers and DLNA clients
Who cares what rake I attacked, why there is a pillow and how it all works, please under the cat.
Prehistory
For many years in a row, I have never really thought about my home network. About eight years ago, a dude from an Internet provider came to me and stuck a modem with an integrated WiFi access point into an ADSL telephone jack. Then he wrote me a long WEP password and left to never remind myself again. And the
box remained:

So that she doesn’t get underfoot, I threw her on a cabinet in the hallway, threw the power cord from her to my workplace and safely forgot about it. After a while, devices began to appear that required WiFi. So I had to open the modem, change it to a new firmware, rename the network, change WEP to WPA and so on. However, nothing significant has changed topologically and technologically.
I must say that in a few years, like most, I have accumulated a bunch of all sorts of computer junk, including several external USB drives ranging in size from 160GB to 3TB, where I merged everything “acquired with overwork”. If you are not a pedant and not a complete orderly, then you will understand me. There were tons of family photos, videos, a bunch of movies and music downloaded from the Internet, software, databases, and the like. At some point, it became quite straining, because all this information was spread evenly between different carriers, computers, cameras, video cameras, phone memory cards, and it was quite difficult to say where and how it was located. For the same reason, it was very dumb to delete something from some carrier at some point in time, because without checking the other ten it was impossible to understand whether there is a backup or not. But it all began not even with this ...
It all started with the fact that my wife and child went on vacation and I dragged the old TV and a simple
BD player with a USB port to my bedroom to watch a movie in the evenings before bed, without getting out of bed. Out of habit, I dragged my 500-gig external USB disk with movies between a laptop, a new TV and a bedroom, until I found an Ethernet port in the player. And then I remembered my “home network”. But the network was mostly wireless and Ethernet was no good for this role, and I did not have the required length of network cable.
Therefore, I blew away the dust from a gift horse called
D-Link DIR-300 , flashed it with DD-WRT (a separate story as I did for HW revision A1), put it in the Client Bridge mode, connected it and after a while could already watch movies from your laptop via the network using the DLNA client built into the player.
As usual, several problems arose from one problem. Since network hardware was older than my child and the maximum could only work with 802.11g, they simply didn’t chew high-bitrate movies (let alone HD). Another problem was that using your laptop as a DLNA server was not the best idea for various reasons. Well, in addition, all this did not save me a dozen flash drives and external drives, with all the consequences.
So I was ripe for the purchase of a mega-device, which would improve everything at once - and the network speed, and connection to TVs, and decided there was a problem with a lot of different carriers.
')
Router
Reflections on the topic of mega-device brought me to the store, where I like a sheep stood in front of a long shelf with routers, access points, modems, etc. I needed something that could work as a modem, understand 802.11n and have a USB port. But most of everything that was present met my inconsequential requirements. Therefore, I sat on the Internet and after a while stopped at
Asus RT-N56U , for 90 euros. There were models and more powerful, and smarter, but more expensive. Maybe someone needs some kind of 802.11ac for 450 megabits with ten antennas, a built-in SATA 6Gb interface and a touch info panel (there were such), but from my budgetary point of view Asus for 90 euros was perfect.
Yes, I decided not to care about the built-in DSL modem. Common sense told me that using ADSL I would still not get more than 48 Mbit. And the Internet said that the DD-WRT or OpenWRT DSL-supported firmware community is almost unreal. And something there, called “intuition,” said that for my purposes, I would probably have to mess with WRT / Optware. In short, I spat and put the old Zyxel in bridge mode, cut off his WiFi and forgot about it, like a few years ago.
Regarding the drives, I stupidly took the two biggest ones I had - 3TB and 1TB. Then, on reflection, I bought another used 3 terabyte at a local auction for very funny money and stuck it in an old SATA <-> USB box. And put the whole thing together to see and think about what to do next:

Common sense again prompted me that it would be better to buy a separate NAS and I agreed with him. But there was no money and no desire to go to the store again, so I postponed the purchase of NAS indefinitely. Yes, yes, I completely agree that separately Modem + Router + NAS is always better than all in one, and three heads are better than one (or two). However, my legs were itching to walk around the rake and I went.
3TB rake disc
First of all, I changed the firmware on the router. I took the newgui
firmware from Padavan and easily and simply flashed it. NEWGUI it just means that there is an old and new web interface. Since I have never seen the old, I did not bother.
Then I connected via wire to the router and stuck a 3TB disk into it. And the disc was found! And it all worked. I tried to drive files back and forth and what I saw did not please me. The
first rake happened. The speed was no more than 2 megabytes per second. Therefore it was necessary to climb into the logs of the router. In the logs I was told that:
a) Although the total disk space is 2794.517 GB, but as much as -416.321GB is free (just so, with a minus sign)
b) Some software in the router periodically could not read the blocks with an index higher than some value
The above led me to the idea of ​​a limit of 2 TB. Therefore, I sat down to break the disk into two sections. Since the disk already had information, I decided not to change the NTFS file system on it. There was a
second rake .
After I changed the size of the partition to the minimum possible, while preserving the data, Windows 7 painted an oil painting for me:

I hardly imagined how to work with two Unallocated partitions, so having unsuccessfully tormented with the Diskpart utility and attempts to degenerate something in GPT (which as it turned out in Diskpart does not work with external disks), I gave up. And then I went to dig in the direction of converting the disk to Ext3, which turned out to be completely wrong.
In order to dot, I will indent and write this. Despite the opinion of the majority of advisers from the forum on iXBT, I didn’t try to install Ext3. I don’t have a single computer with Linux at home, and the likelihood that external drives at some point will have to be disconnected from the router and connected to the computer is very high (yes, I know about the Ext2FS driver, but ...). Therefore, in the end I returned to NTFS and did not see any difference, to be honest, on the contrary. The speed of writing and reading in NTFS for some reason is even slightly higher than Ext3, I don’t know what this is about.
The rake with partitions was fixed with the help of
Paragon Hard Disk Manager 11 , which without problems I created two partitions on 2TB and 1TB, and in my opinion, even without GPT. Be that as it may, a
third rake happened here.
Both Windows and MacOS perfectly saw both sections, but not the router. Therefore, I again began to smoke Ext3 in different combinations, until I saw that both sections are Primary. Remembering youth and MS-DOS, I created the second partition as Extended and already made a second disk in it, like in the good old days. Paragon HDM allowed both that and it all worked!
In the web interface of the router, it all looks like this:

In this example, a 3Tb disk with two partitions and a 1Tb disk was used, but I assure you that 2 3Tb disks work absolutely adequately.
Intermediate conclusions:
- In the case of
Asus RT-N56U with
Padavan firmware 1.1.2.2-006 , the largest partition size on the attached USB drive is 2TB.
- If the disk is larger than 2 TB, then it should be split into two using Primary and Extended partitions.
UPD: I don’t know what the rake was, but the two Primary partitions on the external drive eventually worked, so Extended is not necessary.
- Standard utilities in Windows 7 carry a lot of hemorrhoids for USB drives larger than 2 TB, so it's better to use
Paragon Hard Disk ManagerMiniDLNA rake
Since I needed DLNA to watch movies on TVs and a player, the Padavan firmware seemed like a kind of miracle that had it all at once. It is worth noting that I turned on DLNA support right after the firmware and as long as I was busy with other rakes, I did not touch it. It looked like this:

Remember about the
first rake ? So, when I turned off the UPnP Media Server, the speed of writing and reading instantly jumped from 2 to 12-13 megabytes / s! However, the prospect did not please me. Either I have SMB with more or less normal speed, or support DLNA.
Experts from the iXBT forum again said their “phi” about NTFS and the fact that now it definitely needs to be Ext3. And I even believed them at some point. Because the pristine blank disk with Ext3 really worked without problems with the included miniDLNA. But as soon as I rolled my honestly dirty films from the Internet, at some point he dropped the speed to 2 megabytes / sec. And I started to smoke the terminal.
Honestly, I'm not very friendly with Linux, but some basic knowledge remained from the time when I ported the XML library to QNX embedded. On the router is
miniDLNA , which is developed by NetGear under the name ReadyNAS. It was found out by some simple way that the speed of file transfer over the network drops only at the moment when miniDLNA parses metadata from video / audio / pictures. It is also easy to see in the web interface, because The processor is 100% loaded.
It also turned out that miniDLNA keeps all its parsed data in the file /.dms/files.db, which is nothing more than a SQLite database. Again, it was established experimentally that miniDLNA parses less than half of the files and then goes to the astral, forever loading the processor up to 100%. Through the database viewer, I found the last parsed file, after which the process hung up and I deleted the next file after it. And it all worked!
The case turned out to be in a specific AVI file, which apparently hangs the miniDLNA parser. Well, nothing concrete can be advised here except that if suddenly the time of parsing metadata is approaching infinity, then you need to look inside /.dms/files.db for the subject "hanging". What kind of file hangs miniDLNA? And the next one in the file system, after the last entry in the “PATH” column, of the “OBJECTS” table. In addition, the parsing process can be viewed from a web browser by going to:
http: //my.router: 8200 . In this case, the following information is issued:
MiniDLNA statusAudio files: 329
Video files: 781
Image files: 17221
If miniDLNA does not hang, then the digits will change when the page is updated at a speed of about once every 3-5 seconds (depending on the size of the file that is being parsed), and if it is suspended, it will not.
Well, the gadsky file is fixed, and everything seems to be going. But here we are acquainted with the
fourth rake . These rakes are called - why the heck am I so much garbage in DLNA?
The point is this. By default, the point at which the search for files for miniDLNA begins is / media. All disks in the form of AiDisk_xY are mounted there, where x is the number of the physical disk and Y is a logical one. Accordingly, the “Media File Source Path” initially forces miniDLNA to parse all your disks. As you might guess, in the end everything falls there that I would not want to share the whole apartment. For example, covers from audiobooks, audiobooks themselves, unpacked graphic resources from programs, porn, photos from pianok and all other garbage that is recognized by the parser as audio / video.
To fix this rake, I personally made one folder on the very first disk and changed the default path, in my case to / media / AiDisk_a1 / Media. There are more advanced ways, such as fixing the miniDLNA configuration file in /etc/minidlna.conf, but frankly I was reluctant to mess around, so all I wanted to do was search DLNA for me in the same folder as the root of the disk. Matters two questions:
And if several folders on different disks? Then you have a direct road to minidlna.conf.
And why / AiDisk_a1? Because the first disk connected to the first USB port will always receive such a name and index. The second partition on the same physical disk, for example, receives an identifier / AiDisk_a5 from me. Why this happens, I do not know, maybe there are more intelligent people who can explain it. Again, the first disk in the second USB port will receive the identifier / AiDisk_b1, so options are possible.
UPD: Smart people were found. Quote from
un_def :
"The first four digits are reserved for the main sections, and the numbering of the logical begins always with five." .
Intermediate conclusions:
- If the data transfer rate of the files has sharply decreased when the UPnP Media Server is on, the router's processor is constantly loaded at 100% and media parsing is standing still (see the progress at
http: // my.router: 8200 ), then this is suspended by miniDLNA. It is necessary to turn off the UPnP server, throw out the file on which the parser hangs and start the server again.
- By default, miniDLNA will parse all files on all available disks and partitions. This is quite a long process. Therefore, if you want to limit it to one folder, change the “Media Files Source Path” in the UPnP Media Server settings.
Rake with Samba
While I was struggling with the
first rake , I managed to reconsider my approach to watching movies on TV. The first thing I thought was this. DLNA loads the router 100% with all the consequences. But without DLNA, SMB remains and if you want NFS. Is it possible to somehow connect your drives over the network, exactly the same external USB drive? It turned out possible. It is no secret that most modern TVs are spinning under Linux. And it's no secret that enthusiasts have found a way to some of them prokhakat, twist and put there what they like. Fortunately for me, I had a TV set of exactly that brand over which the community called
SamyGO is working hard. So, I sat down to pick my
Samsung UE46D7000 .
Omitting unnecessary details, it turned out that my TV has the latest firmware, in which the local exploit is not working, which is necessary for the operation of the SamyGO package. In Samsung, too, no fools work, and they track the ways of unauthorized changes and interference with the work of their official firmware. In addition, as in most consumer devices, the ability to roll back to the old firmware version in the CE (Customer Edition) versions of these devices is disabled. You’ll have to give up, but the guys from SamyGO have found a way to roll back by spoofing and emulating the official Samsung firmware server.
Following the
instructions, I rolled back to the old version and following
other instructions put SamyGO. It seems not okorpichil. Breathed out.
Briefly about how the SMB and NFS client work in Samsung TVs (more precisely in SamyGO). SamyGO installs a virtual USB disk driver, and below it emulates a file system using network resources. Therefore, from the user's point of view, everything looks exactly the same as if you connected a regular USB flash drive or external drive. From the point of view of customization, everything is more complicated, but not so completely. You just need to substitute your parameters into the scripts from init.d /, here we smoothly drove into the
fifth rake . But all in order.
So, we installed SamyGO, activated it and we can safely log in via FTP to our TV. Depending on the model, init.d / scripts are located in different directories. In my case, they are located at
ftp: //192.168.Moy.TV/mtd_rwcommon/widgets/user/SamyGO/SamyGO/etc/init.d/.Three files are of the greatest interest to us:
03_03_djmount.init
03_03_nfsmount.init
04_04_samba.init.dis
The first is a UPnP / DLNA file system emulator. By default it is enabled. But my TV already has a built-in DLNA client that does not require SamyGO to dance with a tambourine, so we turn it off by renaming it to 03_03_djmount.init.dis.
The second is an NFS based emulator. We will return to him later.
Well, finally, here it is, the fish of my dreams. A disk emulator based on SMB / CIFS or further for simplicity, Samba. First you need to make the script executable by renaming it from 04_04_samba.init.dis to 04_04_samba.init.
In theory, this is enough for the emulator to show us all the nodes and balls,

But I knowingly wrote about a
rake - does not show neither the server, nor spheres. We ask the question - why? We smoke inside the script 04_04_samba.init:
...
##### CHANGE MEEEEE !!! ######
USER = ""
PASSWD = ""
PERM = "rw" # can be ro or rw
##### CHANGE MEEEEE END ######
SERVER = ""
# SERVER = "10.0.0.1" # if you want a fixed server
SHARES = ""
FR_NAME = "Samba Server"
...
Obviously, it would be necessary to fill in the fields USER, PASSWD and SERVER / SHARES not bad, so as not to be confused in all kinds of Windows NETBIOS and HomeGroup resources, which are usually in home computers (I have 4 of them). However, this is the ambush. There is nothing to fill in USER / PASSWD. I do not have a password on Samba on the router, well, I did not set it up, nafig. Without a password does not work, with an empty password too.
In the end, I could not get Samba SamyGO client to work in the absence of USER / PASSWD. Can someone tell me how to do this?
UPD : Said, see below in the intermediate conclusions, you must specify USER = "guest", the password is empty.
Well, let's try with a password. Asus RT-N56U offers the following interface for controlling Samba balls:

By default, I set full access without an account. In a Windows network client, it looks like this:

Now try to go to your account with a password. We get the user and see something like this:

With the naked eye it is clear that there is an account and there is an opportunity to assign any read-write rights to directories of the first level. And what happens in our Windows? Here's what:

Oppa! The discs are gone, in their place were the first level catalogs, and collected from all discs at once. Note that folders with the same names on different disks are supplemented with a number in brackets. This is fully justified if we take into account the above logic of the router for access rights, but for me personally this is inconvenient. However, there is one plus - SamyGO now works!
Since it is easier for me to work with the entire network drive from under Windows at once, rather than with a dozen individual folders, the only option for me in this configuration is to transfer all root folders into one that will be shared with the password for the accounts. Maybe I'll do it later, but for now I don’t really want to mess around with it. We smoke further towards NFS:
And with NFS, everything is even very simple, take the script 03_03_nfsmount.init:
...
##### YOU CAN CHANGE ME HERE ######
SERVER = ""
# SERVER = "10.0.0.1" # if you want a fixed server
SHARES = ""
# SHARES = "Video Music Photo" # if you won’t be your shares, but then set SERVER too !!!
##### CHANGE ME END ######
...
Register in the SERVER IP address of our router. You can stop at this, but as I mentioned, I don’t really like the idea of ​​making all the disks from the TV available, so I limit SHARES to one folder: SHARES = "/ media / AiDisk_a1 / Media". One more thing. Since NFS can work not only via TCP but also via UDP, but for reading the video stream that we are going to watch on the TV, retransmission is not as relevant as, say, during recording (that is, if some packet disappears during transmission, then FIG ), then we will add the following options:
M_OPTS = "soft, udp, async, nolock, rsize = 32768, wsize = 8192"
In other words, we will work on UDP, with an asynchronous cache and make the buffer read more. Not exactly measured yet, there is no machine with Linux, but approximately with such parameters the read speed approaches 15-18 megabytes / s, which allows us to play HD 1080p over the network without problems. We start, everything works:

Rake like no. Samba on the telly off as unnecessary. On the router, we return back access without a password and account.
Intermediate conclusions:
- Asus RT-N56U with firmware 1.1.2.2-006 from Padavan by default rassharivaet whole drives without a password and account. At the same time, it is not very clear how to configure the SMB / CIFS client in SamyGO so that it works with such balls. An empty username and password in the configuration file, as well as the absence of these parameters do not help.
- Samsung TV works great with miniDLNA on the router through the built-in client called AllShare.
- If miniDLNA / AllShare does not suit you, or there is no built-in DLNA client and there is a desire to dig deeper into the gut of the TV, then put SamyGO and connect the network drives through the USB emulator.
- Scripts SamyGo UPnP (djmount) and NFS (nfsmount) with the router work without any visible problems.
- SamyGO SMB client works without problems only if access to the router under the account and password is set.
UPD: Answer from the author of the firmware:
"... Immediately answer him on the Samba access problem without a password from Linux devices (eg from a TV with SamyGO firmware). On the client, you must specify the username guest, the password is empty ..." Thanks again Padavan!
Rake with noise
As already mentioned, setting up NFS on the TV, I later repaired miniDLNA on the router. Therefore, I don’t know yet why I need SamyGO and NFS, but maybe I haven’t stepped on a rake like the incompatibility of codecs that are very often found in DLNA, judging by the noise.
Yes, about the noise. So the moment has come when everything works wonderfully for me, two 3TB disks are connected and the whole thing is pushed back into a large and tall cabinet in the corridor:

Remember the pillow mentioned at the very beginning of the post?
So both external disks, being placed on a hard wooden surface, emit such an unpleasant hum because of the natural vibration. I do not know how anyone, but I am very annoyed. Since my daughter has grown up and is using quite an older size bedding, I adapted her “Lyala” pillow as a vibration damper. Stupidly put the wheels on it and the rumble was gone. The aesthetic aspect worries me a little, because the cabinet is more than two meters high and there is nothing visible from below.Rake with built-in torrent client
And they are not. Transmission daemon is used as an embedded client . Again, the community strongly advises using Ext3 as the file system for it. I can not say anything, but everything works fine for me on NTFS.In order to configure Transmission, you need to create on the first disk in the root an empty directory called "transmission" and enable the client on the router:
And that's all.
Well, for the feeling of completeness, you must of course deliver what it will control, I mean the Transmission Remote application:
Look for all that it downloads on the drive in the / transmission / downloads directory. Since the client works autonomously and does not go away after downloading from the distribution, do not forget to set speed limits, because without restrictions the router can easily block all traffic in both directions.Conclusion
In the end a couple of screenshots with numbers:Writing on Samba:
Reading on Samba:
Asus RT-N56U is quite a popular and revered piece of iron and anyone who wants can find a lot of information on it on the iXBT forum . Information on the SamyGO project for the expansion of the mind of Samsung TVs is on the site of the community .Special thanks to Padavan for the cool firmware and for the fact that with it I didn’t have to poke around with Optware and thanks to juriz28 for the huge work on SamyGO.PS About the recording of TV programs from the TV to network drives and about rassharivanie disks of the TV I will write something later. This has little to do with the router and network drives ...