In my opinion it should be linear. I guess if the simulation runs enough long the MSD curve linearly changes, whereas the graph does not show a complete linear trend.
For anomalous diffusion you can get something like that which is 'superdiffusive'. In that case you cannot use Einstein's equation to get the diffusion coefficient from it. There are references which discusses anomalous diffusion so I would just look it up.
you can just use a compute msd command and then use a compute style variable to get the msd data and write to a file. Run NVE dynamics to get the msd. But make sure your structure is equilibrated first. I have a paper recently published in JCP which discusses anomalous diffusion of Na and water molecules in geopolymers (see below).
Article A molecular dynamics study of the role of molecular water on...
I'm interested in calculating the diffusion coefficient of self interstitial atom in iron system at 800 K. I got a plot like (attached) this 'MSD vs time' using LAMMPS. The slope (diffusion coefficient) is changing with time. which part of the curve to be considered to calculate the slope (diffusion coefficient) ?