What's new

webgui - "Eject USB Disk" fails

  • 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!

In my view best to play it "safe" and close the swap wherever it may be found?

On second thoughts - there may be users with more than one USB's attached - the others perhaps having nothing to do with Diversion ... so killing all swaps may cause unintended consequences.

Not your job to solve all "Eject Disk" problems - just those associated with your product.
As I've said in an earlier post - any and all app providers should design their add-ons in a way which will not break the functionality of the Webgui which, despite the obvious presence of real fundi's in this forum, is relied heavily upon by I suspect the vast majority of the 150,000+ users of Merlin-Ware.[/QUOTE]
 
I don't create custom swap - and suspect most [if not all] AMTM / Diversion and/or Skynet users simply create their swaps via your supplied utilities ... which means they would reside in /opt/swap.
That's not correct. Swap files created with Skynet, amtm or Diversion reside in the root directory of the selected device.

Entware is installed into the /entware*/ folder on the selected device.
/opt/swap would physically be at /tmp/mnt/<device>/entware*/swap, which is two levels deeper than device root.
 
Are you planning in 4.0.7 to do the "disable once" script so that if USB is mounted again Diversion will autorun?
I am relaxed about that - quite happy to do a reboot after returning USB to ensure everything kick starts properly.
Everything will start up again when you plug the device back in. The post-mount script takes care of that and will re-enable Diversion along with it.
If it's indeed the device with Diversion installed on it.
 
That's not correct. Swap files created with Skynet, amtm or Diversion reside in the root directory of the selected device.

Entware is installed into the /entware*/ folder on the selected device.
/opt/swap would physically be at /tmp/mnt/<device>/entware*/swap, which is two levels deeper than device root.

Fully understood ... and correct - I was just using "symlink" ... "/opt/swap" does indeed take you to /tmp/mnt/<device>/entware/swap.
 
On second thoughts - there may be users with more than one USB's attached - the others perhaps having nothing to do with Diversion ... so killing all swaps may cause unintended consequences.
Already taken care of, it will only unmount if Diversion and/or the swap file resides on the to-be-ejected device.
 
Already taken care of, it will only unmount if Diversion and/or the swap file resides on the to-be-ejected device.

Awesome - Happy to test 4.0.7 on my AC5300 when ready :).
 
Once you start using something that was originally designed as an appliance as a server these sorts of problems are inevitable to some degree. In practice there's probably very few, if any, applications that can't cope with being unceremoniously killed (i.e. having the power removed).

The only problem I'm particularly aware of is the corruption of the filesystem on the USB device. So your biggest protection against that, and to save you having to repair it later, is to use a journaling filesystem.

I can't recommend that highly enough. So that means using something like ext4 instead of ext2. Some people recommend using ext2, or ext4 without its journal, for performance reasons. To that I would say; That's OK provided that there's nothing on your USB drive that you don't mind loosing.
I tend to believe if that if it's on a flash drive, it must be data you don't mind losing. :) The small cost difference between a 128GB flash and a 120GB SSD + USB enclosure makes it well worth it to me to just use an SSD.
 
I tend to believe if that if it's on a flash drive, it must be data you don't mind losing. :) The small cost difference between a 128GB flash and a 120GB SSD + USB enclosure makes it well worth it to me to just use an SSD.
Is the SSD technology considerably more reliable than that of flash drive? I can recall only one problem with a flash drive, but that’s one too many, and a poor sample size!
 
Is the SSD technology considerably more reliable than that of flash drive? I can recall only one problem with a flash drive, but that’s one too many, and a poor sample size!
I believe they are, yes. At a fundamental level, they both SSDs and thumb drives use NAND flash memory, but SSDs benefit from a number of factors, not the least of which is they are a larger form factor, which means the components aren't all jammed together, which means they dissipate heat better, and heat is the killer of electronics. Because of the larger form factor they also have better wear-leveling circuitry. SSDs use higher quality components as well, which is why they're a bit more expensive.
 
I believe they are, yes. At a fundamental level, they both SSDs and thumb drives use NAND flash memory, but SSDs benefit from a number of factors, not the least of which is they are a larger form factor, which means the components aren't all jammed together, which means they dissipate heat better, and heat is the killer of electronics. Because of the larger form factor they also have better wear-leveling circuitry. SSDs use higher quality components as well, which is why they're a bit more expensive.
Many thanks for such a good explanation. It makes perfect sense. The drive that I had fail was 32GB and the size of a finger nail. It was enclosed in metal and would get too hot to keep a finger in place on it.

Appreciate the food for thought.
 
Is the SSD technology considerably more reliable than that of flash drive? I can recall only one problem with a flash drive, but that’s one too many, and a poor sample size!

The key thing with USB thumb drives is that they're generally bottom grade quality flash parts, and not really intended to be run for a long time - think about the typical use cases...

SSD's tend to use better quality flash, and the controller is designed to do the appropriate wear leveling...

I have a Samsung 850 120GB mSATA in my pfSense box, and it'll probably outlive the unit it's installed in...

Many thanks for such a good explanation. It makes perfect sense. The drive that I had fail was 32GB and the size of a finger nail. It was enclosed in metal and would get too hot to keep a finger in place on it.

Heat probably killed it... again, consider the typical use case...
 
...
Heat probably killed it... again, consider the typical use case...

I’m sure you’re right. I wasn’t surprised when it failed; I was more surprised it lasted as long as it did ie years instead of minutes.

A welcome wake-up call. Thanks.
 
I fully agree with the SSD drive advice - way better for anyone using the NAS functionality of the router - but serious over-kill for anyone simply using attached storage for apps like Entware / Diversion / Pixelserv-tls / Skynet etc.

My 8Gb Sandisk Cruiser Blade used for the latter purposes and attached with a 15cm extension cable to the USB2 port never gets more than mildly warm in my RT-AC5300. I did find that the USB3 port on this router generates a lot of heat and in my view is not suitable for a directly attached USB flash drive which, with the heat it also generates could fry the router port never mind the flash drive. That USB3 port works fine for external SSD attached with a short cable.

The main point of this thread was to solve the problem of gracefully unmounting any attached storage devices - whether USB Flash or SSD external ... and both of these can suffer data corruption if summarily removed from the router - or suffer sudden power loss.

Thankfully solutions have been found and will shortly be implemented - so thanks again to all who have contributed to the debate.
 
I've ordered a couple of 90 degree male-to-female usb connectors to try to reduce heat on the flash drives, as I don't really have room for an SSD and it would be difficult to relocate the router. (Possibly should have read the reviews first as there seems to be some doubt as to how well they're shielded, but they were cheap so worth a try.) There's no data on the flash drives I couldn't recreate though.

Just an observation on the discussion about swap files etc. - when I got the router I created a swap partition on a flash drive and also manually installed entware. After reading through the various threads here and seeing the level of coordination and cooperation between the script authors, I started again from scratch, using amtm to create a swap file and Diversion to install Entware, just to ensure the various scripts would all play nicely with each other.

It's all worked like a charm, and I can only appreciate and applaud the collaboration and mutual support that goes in these forums, not to mention the courtesy, respect and help offered to newbies. It's all actually quite inspiring...
 
Last edited:
Is the SSD technology considerably more reliable than that of flash drive? I can recall only one problem with a flash drive, but that’s one too many, and a poor sample size!

This is a swap file so who cares if it gets lost, but yes SSD's are leaps and bounds more reliable than thumb drives.

Here are the stats of my SSD

ssd.png


If you divide total writes by capacity you get ~260 cycles but realistically since my drive is 70% full of static data the freespace has on this SSD has endured 890 write cycles.

Most SSD's are designed for ~500 cycles before failing but this particular one is a trooper.
Thumb drives and SSD's were designed for different use cases.
 
Last edited:
I fully agree with the SSD drive advice - way better for anyone using the NAS functionality of the router - but serious over-kill for anyone simply using attached storage for apps like Entware / Diversion / Pixelserv-tls / Skynet etc.
Not sure I agree ... I don't use the SSD attached to my router for NAS, I have a separate NAS for that. But for the small price difference I don't worry about having to re-create everything from scratch, or the network going down because the thumb drive died and having an annoyed wife while I get the network working again.

The more I learn about thumb drives, they more I believe they shouldn't be left attached to anything semi-permanently, they're not designed for that. Yes, using higher-quality thumb drives you can get away with it (I did for some years), but if you have to go out and buy one or the other for the router, just get an SSD and be done with it. Or keep regular backups of your thumb drive.
 
I think this is just one of those personal preferences things. For me it's more about size and convenience.

I've had this
Untitled.png
stuck in the back of my router continuously for almost 5 years now without any problems. I'd rather have that than this
Untitled2.png
hanging off the back.
 
But for the small price difference I don't worry about having to re-create everything from scratch, or the network going down because the thumb drive died and having an annoyed wife while I get the network working again.

Creating an image from the initial flash drive then reimaging the next flash drive would take a few seconds at most.

If internet goes down you hit it with the go-to plug/unplug routine and the router would boot into a mode without your additional features enabled.

Flash drives don't fail thhaaaat often. +1 to small/compact club
 
Creating an image from the initial flash drive then reimaging the next flash drive would take a few seconds at most.

If internet goes down you hit it with the go-to plug/unplug routine and the router would boot into a mode without your additional features enabled.

Flash drives don't fail thhaaaat often. +1 to small/compact club
I dunno. The startup scripts are in jffs, so those would try to run. None of them (I think) are blocking so it wouldn't keep it from booting, but I've lost track of what requires what.

I make changes often enough it would require creating images pretty regularly. :)
 

Similar threads

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!
Top