A retaining apparatus for at least one data storage device includes a tray and a retaining device. The tray is used for receiving the at least one data storage device, and the retaining device is attached to the tray. The retaining device includes an elongated base member, an elongated arm member and a blocking member. The base member is attached to the front side of the tray. The arm member is pivotably attached to the base member about a pivot axis. The arm member has a retaining portion at the first distal end for retaining the retaining device at a retaining position. The blocking member is attached to the base member and slidable along a first direction that is substantially perpendicular to the pivot axis. The blocking member is capable of securing the arm member at a second distal end of the arm member opposite to the first distal end.