What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

X10/Voxel FW/HDD Enclosure Mounting Issues

RobHimself

New Around Here
Greetings, all.

Replaced my aging Nighthawk R7000 last week with the X10, and picked up a HDD enclosure (not a NAS; just a housing that puts four HDDs on a single power adapter/USB; a glorified powered USB hub that looks like a NAS) to house four 3.5" drives into a single unit. Intent was to plug this enclosure into one of the X10's USB ports, and the four drives house my media for Plex. For some reason, when plugging the enclosure into the X10, it results in a sort of race condition. All four drives are recognized, but they're all mounted to the same location (i.e., /dev/sda2, /dev/sdb2, /dev/sdc2, and /dev/sdd2 are all mounted to /tmp/mnt/sda2). At first, I was mucking around with a telnet-based console, but then switched my FW over to Voxel's excellent release (many thanks, and great install guide; very easy to follow) for proper SSH access.

Since then I've attempted to:
- Unmount and remount the drives manually, but found that it's a toss-up as to which drive initializes itself first, so sda2 isn't always the same drive.

- Installed entware per Voxel's instructions, and pulled down blkid in order to determine each drive's UUID in order to...

- Write a shell script to modify fstab to mount the drives by UUID on startup. The "mount" command included with this flavor of Busybox seems to include a diet version of mount which doesn't recognize the "-U" flag.

My next step is to just suck it up and buy a proper NAS, but before I throw my hands in the air in frustration I thought I might ask here. Any help would be appreciated. Can this be accomplished?
 
Hi RobHimself,

I do not quite understand what is your goal. To mount drives always identically? Please take into account that if your disk has a label, there will be corresponding symlink in /tmp/mnt. I.e disk with label "optware" could be mounted as /tmp/mnt/sda1 or /tmp/mnt/sdb1 or /tmp/mnt/sdc1 but there will be /tmp/mnt/optware symlink which points to /sda1 or sdb1 or sdc1.

If you want to nullify stored disk mount point for Plex, your should check /tmp/plexmediaserver/.usb_map_table file and check nvram values:

Code:
nvram show | grep plex_select_usb

and maybe modify it by "nvram set" and "nvram commit"

Voxel.
 
Hello, Voxel!

Thanks for the response! As far as my goal, you pretty much nailed it. If I happen to restart the router, I want those drives mounted identically each time. The disks do have a label, and they do appear in /tmp/mnt, but they all point to the same location. So, for example, let's say I have four disks labeled DOGS (/dev/sda2), CATS (/dev/sdb2), FISH (/dev/sdc2), and HAMSTERS (/dev/sdd2). After the drives are initialized and recognized by the router, I run "df -h" and get the following:

  • /dev/sda2 mounted on /tmp/mnt/sda2
  • /dev/sdb2 mounted on /tmp/mnt/sda2
  • /dev/sdc2 mounted on /tmp/mnt/sda2
  • /dev/sdd2 mounted on /tmp/mnt/sda2
Navigating to /tmp/mnt, I "ls" and get the following:
  • /CATS (symlinked folder; shows the contents of HAMSTERS)
  • /DOGS (symlinked folder; shows the contents of HAMSTERS)
  • /FISH (symlinked folder; shows the contents of HAMSTERS)
  • /HAMSTERS (symlinked folder; shows the contents of HAMSTERS)
  • /sda2 (regular folder; shows the contents of HAMSTERS)
It's very strange. As a side note, I should mention that all four of these drives are Windows NTFS. I'm not sure that it matters, but would it make a difference to reformat each drive as a format more friendly for the router environment?

Currently, I have all of the drives manually mounted correctly, and Plex is operating as expected. I can't access the drives via Readyshare; I think this is because the Netgear has a secondary process that keeps a manifest of available drives and mount points for use with Readyshare that I didn't update. But at least they're mounted, and Plex is usable.

Thank you for taking the time to help out a total newbie, Voxel. I know you're quite busy, and it's appreciated. Also thanks for the tip on the Plex usb_map_table. I suspect that'll come in handy once I figure out a permanent solution.
 
Hello, Voxel!

Thanks for the response! As far as my goal, you pretty much nailed it. If I happen to restart the router, I want those drives mounted identically each time. The disks do have a label, and they do appear in /tmp/mnt, but they all point to the same location. So, for example, let's say I have four disks labeled DOGS (/dev/sda2), CATS (/dev/sdb2), FISH (/dev/sdc2), and HAMSTERS (/dev/sdd2). After the drives are initialized and recognized by the router, I run "df -h" and get the following:

  • /dev/sda2 mounted on /tmp/mnt/sda2
  • /dev/sdb2 mounted on /tmp/mnt/sda2
  • /dev/sdc2 mounted on /tmp/mnt/sda2
  • /dev/sdd2 mounted on /tmp/mnt/sda2
Navigating to /tmp/mnt, I "ls" and get the following:
  • /CATS (symlinked folder; shows the contents of HAMSTERS)
  • /DOGS (symlinked folder; shows the contents of HAMSTERS)
  • /FISH (symlinked folder; shows the contents of HAMSTERS)
  • /HAMSTERS (symlinked folder; shows the contents of HAMSTERS)
  • /sda2 (regular folder; shows the contents of HAMSTERS)
It's very strange. As a side note, I should mention that all four of these drives are Windows NTFS. I'm not sure that it matters, but would it make a difference to reformat each drive as a format more friendly for the router environment?

Currently, I have all of the drives manually mounted correctly, and Plex is operating as expected. I can't access the drives via Readyshare; I think this is because the Netgear has a secondary process that keeps a manifest of available drives and mount points for use with Readyshare that I didn't update. But at least they're mounted, and Plex is usable.

Thank you for taking the time to help out a total newbie, Voxel. I know you're quite busy, and it's appreciated. Also thanks for the tip on the Plex usb_map_table. I suspect that'll come in handy once I figure out a permanent solution.

It is strange, because your disks are /dev/sd*2 but where is /dev/sd*1? Router recognizes them as second partition, but did not recognize first partition. Maybe first is something specific on your disks (not NTFS/FAT32/HFS etc)? I am not sure, and maybe there is a bug in /sbin/hotplug2.mount script. It is executed when you attach your USB disk (or after reboot). I've modified this script (taken from stock fw) to add own features, but I did not check its correctness with enough attention.

I am sorry, I intend to be absent during two weeks. Most probably I'll not answer any question during this period. But if you have a time and wishes (and possibility) I would suggest to experiment with at least one of disk. E.g. install Entware to one of disk and then using fdisk utility from Entware check how it is partitioned, what is a first partition if any and maybe re-initialize this disk by the same fdisk leaving only single partiton and format it as say EXT4.

Voxel.
 
Just wanted to post an update, in case anyone else finds themselves with this dilemma. I ended up resolving my issue by simply purchasing a NAS device (Netgear ReadyNAS 214; might as well keep it in the Netgear family), but for those who may not have the inclination to drop a few hundred extra dollars I want to share some of my findings.

Using a JBOD enclosure - in my case, the 4-bay Mediasonic Probox HFR2 - isn't going to work for you if the drives in the enclosure are setup as four distinct volumes. Why? A couple of guesses:
  1. The Mediasonic enclosure itself poses some sort of issue in the way it communicates via USB. In the hours I spent researching a solution I stumbled across a few folks with similar issues on the Mediasonic support forums, and in my limited understanding of this particular type of hardware it seems that I made a faulty assumption: that the enclosure was basically just a nifty USB hub for hard drives. It's not. I don't know what the underlying core issue is, but I do know that pretty much every answer given on those forums was a variation of, "You can't use the enclosure this way." I wish I could give a more definitive explanation on this point, but I'd rather give incomplete information than incorrect information.
  2. It's possible that the router expects a one-to-one relationship between a USB port and file system volume; by that I mean Netgear didn't want or didn't anticipate the possibility of multiple volumes being plugged into a single USB port. This is completely conjecture on my part, as I found a couple of support posts on Netgear's community site where folks with various routers (including the R9000) posted that they were able to get it to recognize multiple hard drives on one USB port via a powered hub. There's no consensus over which USB hubs work and which don't; it seems that support is spotty at best, which leads me to believe that it wasn't really intended. My own personal experience (and again, I only tried with the Probox enclosure, so your results may vary) was that it created a race condition for drive mounting. In a 4-bay enclosure the drive that "won" was the drive that identified itself last. This was almost never the same drive.
One possible solution to try - which I didn't try myself because I didn't have the extra hard drives needed to temporarily store the data - is to create a Raid-0 array out of the four disks, so that they identify themselves as a single volume to the router. Short of buying either a NAS device - which is a guaranteed "fix" for the R9000 - or finding a USB hub/HDD enclosure that works, this is likely your only "guaranteed" solution. Again, I didn't attempt this myself as doing so requires completely wiping the disks, and I had nowhere to put the data that was already on those drives.

Other things that I tried - and failed (for me at least):
  1. Modify the fstab. The default Busybox implementation that ships with the R9000 doesn't give access to fdisk or any utility that would enable you to discover the GUID of the drives, and because of the race condition that I mentioned before, it's not possible to modify fstab to force /dev/sda1 (a hard drive labeled "dog", for example) to mount on /mnt/dog. If one of the other drives (a hard drive labeled "cat", for example) identifies itself to the OS after "dog," then /dev/sda1 will be "cat". So the simple, generic mount method in fstab won't work.
  2. I have zero experience with opkg, and the R9000 default firmware points at a package repo that simply doesn't exist. I thought I might try a utility called "block-mount" that seemed like it might do the trick, but I couldn't find an opkg repo endpoint that would work with the default R9000 implementation. As a side note, this is really frustrating to me. I'm sure that Netgear did this intentionally in order to protect their own proprietary intellectual property (custom drivers, packages, etc.), but it seems really disingenuous for them to go down this route when they also claim to embrace the open source community, and use open source software in their products. Not a good look, Netgear.
  3. Installed Voxel's excellent FW, which gave me an easy implementation of Entware, which then gave me access to tools for a more concrete way to use fstab. Installing "blkid" gave me the GUIDs of each of the drives. After manually modifying fstab to make use of the GUID mounting method, I discovered that the "mount" library in Busybox is a watered down version that doesn't support GUID mounting. I tried manually mounting the drives by GUID outside of the fstab using the mount command from shell, and it simply doesn't recognize the GUID flag. Running "mount" by itself gives the usage manual, which includes only the most basic of mount functionalities.
  4. Staggered mounting. This was my last attempt, just to see if it could work at all with the hardware that I had on-hand. I left the door to the enclosure open, with only the first drive securely inserted; the rest were in their respective bays, but not actually connected. I waited for the router to recognize the first drive, then pushed the next drive all the way in. Then the third, then the fourth. The idea being that the router would recognize the drives as intended without the possibility of the "race" condition when they were all present at the same time. The Mediasonic enclosure only occasionally recognized the new drives if they were plugged in while powered on. I knew this was an unlikely idea from the start, as the Mediasonic user manual mentions that it should be powered down when adding/removing/swapping drives, but it was worth a shot.
@Voxel, you mentioned that maybe something was amiss with the way that you modified hotplug2.mount ("I've modified this script (taken from stock fw) to add own features, but I did not check its correctness with enough attention."). I don't think that's the case. I think that this particular set of variables (the enclosure itself, the incomplete toolset present in Netgear's Busybox implementation, etc.) is just too many obstacles to overcome for what I was attempting. I just wanted to mention that so you didn't waste any personal time tracking this down. And many thanks to you for your ideas and assistance. I'm a software engineer by trade, and I despise giving up on an idea until I've exhausted every reasonable option. Your responses to my questions helped me satisfy that, so I didn't feel that purchasing the NAS was an unnecessary waste.

Perhaps someone with more knowledge and experience will find these details useful, or can point out where I went wrong, but for now my issues are resolved. :)
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top