Mount and re-mount external drive on connection loss

If none of the more specific forums is the right place to ask

Mount and re-mount external drive on connection loss

Postby poisonborz » 2020-10-16 16:33

I'm using a Debian server, and for practical reasons I have a hosted data folder on an external USB drive. Like seemingly all external cases, sadly, this case sometimes also resets the connection to the PC.
- how can I safely remove all mounts on a connection loss (to prevent data corruption)? I tried to make a udev/rules.d entry for a script but it said "the directory is in use" and didn't allow to execute.
- how can I remount the drive once the drive is connected again? I also tried to add a rules.d script with mount -a in it, to seemingly no effect
poisonborz
 
Posts: 2
Joined: 2020-10-16 16:30

Re: Mount and re-mount external drive on connection loss

Postby LE_746F6D617A7A69 » 2020-10-16 17:20

poisonborz wrote:Like seemingly all external cases, sadly, this case sometimes also resets the connection to the PC.
Nope, "all external cases" normally are not disconnecting themselves from the host - Your hardware is simply faulty/damaged.

You didn't mentioned the type of that external USB HDD case, but if it's powered trough USB, then there are few typical reasons for such problems:
- USB socket can't deliver sufficient power to the drive -> You can try to use USB "Y" cable.
- Broken USB cable
- Badly designed USB<->SATA bridge PCB, which causes high voltage drops and resets itself/and or the HDD -> this can be solved by adding another USB cable, soldered directly to the HDD socket power pins (on the bridge PCB, and not on HDD ofc - but the second option would also work :mrgreen: )

This is what can happen after USB connection is interrupted during writing:
http://forums.debian.net/viewtopic.php?f=8&t=129954#p625978
I.e. each connection reset potentially can cause File System damage.

The solution is to fix the problem with hardware.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 395
Joined: 2020-05-03 14:16

Re: Mount and re-mount external drive on connection loss

Postby poisonborz » 2020-10-16 18:18

It's this: https://en.sharkoon.com/product/16310 . It has its own power adapter.
I've looked around before getting this, virtually for every such case they are mentioning similar issues. That's why I wanted a better brand, but here we are.
Regardless, I don't have too much issue with it, if the device swiftly reconnects.

The other reason is I'd also like to yank it out anytime (that's why it's on usb) without worrying too much about it.
poisonborz
 
Posts: 2
Joined: 2020-10-16 16:30

Re: Mount and re-mount external drive on connection loss

Postby LE_746F6D617A7A69 » 2020-10-16 18:38

I don't know that Sharkoon model, sorry.
However I have few ADATA HD710 drives (different capacities) - they are rock solid, no single issue after many hours of hard work ;)
(I'm not sure if such advertisements are OK here, but ftw :D )

Anyway, there are also 3 other possible causes of Your problem:
- Faulty/Overheating AC adapter - try different one (with higher output current)
- Overheating USB<->SATA bridge chip -> disassemble the case for better cooling (for test ofc)
- Broken USB cables which are connecting Motherboard and front-panel USB sockets - try the sockets on rear panel (if this is a PC and not a laptop ofc)
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed
LE_746F6D617A7A69
 
Posts: 395
Joined: 2020-05-03 14:16


Return to General Questions

Who is online

Users browsing this forum: No registered users and 17 guests

fashionable