Flux dynamics of an MgB2 bulk sample have been studied by systematic measurements of the fundamental and third harmonic ac susceptibility. The irreversibility line Tirr(B) has been obtained by fitting the onset temperature Ton (I,B) of the third harmonics at different frequencies to Ton (f, B) = C(2~f)1/[(Z-1)V] +Jirr(B). The flux creep activation energy U(j, B,T) has been derived as U0[l- (T /TirrY]2(B / B0)-n (j / j0)-u, with n =1.33 and f1 =0.2. The steep decline of the activation energy as a function of the magnetic field U(B) oc B-1.33 leads to the steep drop in the critical current density with magnetic field. The relaxation of the current density j(t) of the sample has been detected ill atime window of 10-4~10-1s, as the frequency is in the range of 10Hz-10kHz, which extends the time window 1~104s of the conventional dc magnetic relaxation to a much smaller one. The obtained activation energy and the irreversibility line indicate that the pinning properties of the MgB2 sample will need to be improved for practical applications.