I thought the high lift devices were linked mechanically
Not so at all on the 747, or any other Boeing airliners as far as I know.
The inboard trailing edge flaps are powered by No 1 hydraulic system, and the outboard trailing edge flaps are powered by the No 4 hydraulic system. If either of these hyd systems are lost then the corresponding inboard or outboard traling edge flaps on both sides of the aircraft will not operate unless the electrical alternate system is used. When the alternate electrical backup is used all flaps, inner and outer on both sides, operate electrically with bypass valves isolating the hydraulic systems from the flaps.
As for leading edge flaps and slats, they are also completely independent from each other and operated pneumatically - again with electrical back up.
Kind regards
Exeng