The "factory" used to add a small dab of hot-melt glue to hold the cables to the hard drives. One could attempt something similar at the other end of the cable, but only a very small dab of glue, and preferably not over too many surface-mounted components of the mainboard.