This paper illustrates the mechanism of the U-shaped vortex formation, which has been found by both experiments and DNS in boundary-layer transition. The main goal of this paper is to find how the U-shaped vortex is formed and further developed. According to the results obtained by our direct numerical simulation (DNS) with high order accuracy, the U-shaped vortex is part of the large coherent vortex structure. This new finding is quite different from existing theories which describe that the U-shaped vortex is a secondary vortex induced by second sweeps, and it is newly formed as the head of young turbulence spot and finally breaks down to small pieces. However, it is found that the U-shaped vortex is neither generated by the second sweeps nor the consequent positive spikes. Actually, the U-shaped vortex is induced by the secondary vortices and the solid wall. The new finding also shows the U-shaped vortex is a vortex tube but not the heading wave. In addition, it is found that the U-shaped vortex has the same vorticity sign as the original Λ-shaped vortex legs, which means the U-shaped vortex is not secondary but tertiary. It serves as an additional channel to provide vorticity to support the multiple ring-like vortices when the original vortex tube is stretched and multiple rings are generated.