Short version of the question
If USB ports are malfunctioning, for example they periodically disconnect the device (every 10-20 minutes), is it safe, to protect the filesystem in an external hard disk from being corrupted, to mount it read-only? Or may it still get corrupted because of electrical/power issues with the malfunctioning port?
Long version (if you are interested)
the integrated USB ports in an old laptop of mine started to be malfunctioning a couple of months ago.
In particular, every time I mount a device connected to these ports, this device randomly gets disconnected, usually after 10/20 minutes, and I have to mount it again.
Since I was using the USB ports to run Ubuntu from an external hard disk, that USB disconnection tilted the whole OS and at some point it corrupted the file system and I had to restore a previous backup of my hard disk because all the data were lost.
Then I duplicated the Ubuntu system from my external HD in the internal hard disk, in order to avoid this problem. But sometimes I still want to access the data in the external hard disk to read some data files, since I use the external hard disk at my work place.
If I mount it just as an external device and read-only does it still risk to be damaged?
Well if it's a power issue, and it's an old fashion hard disk, interrupting power could theoretically damage the disk physically since the head falls on the disk... I would recommend powering the hard drive externally, then you should be safe mounting it read only...
If it's SSD, then it probably won't be damaged by interrupting power if it's mounted read only...
In any case it should not be mounted r/w if it tends to interrupt.
If it's a hard disk with USB2 interface that's only connected with a USB cable, without external power source, you can do one of the following two things.
1) Powering it externally using an externally powered USB hub.
2) You can power it externally by cutting the red wire, and connecting an external REGULATED power supply, to the red(+), and black(-) wires. You should connect the power supply to the external HDD side of red wire(so that you feed power to the drive, but not to the laptop), and the black wire should not be cut, it is also a refference for the signal(green and white) wires...) If it's a drive that is only powered via USB cable, then it shouldn't consume much power, thus a REGULATED!!! 5v@1A power supply should be fine... Do not use unregulated PS, get a multimeter, and measure it, it should give you 5V (+/-0.25v) if it's regulated. if it's unregulated, it will be far more then that when there is no load applied, therefore it should not be used for this purpose...