Originally Posted by
Texboy
Okay, mine is Trek Marlin 7. The rear derailleur is Shimano Deore M5120, long cage.
For what you need I would probably just replace with what you have but if you did want to upgrade or for some really dumb reason downgrade (which I never recommend unless you absolutely have to) you just need to make sure it is the same number of speeds, the correct length cage and the correct cable pull. After 9 speed Shimano road and mountain diverged so you want to stick with XTR, XT, SLX, DEORE... Just make sure you have the correct number of speeds. I am assuming you have a 10 speed looking at Trek's page for the bike so this Shimano XT RD-M786-SGS or Deore RD-M6000-SGS would work fine. The RD-T6000-SGS could probably work but it is designed for their trekking groupset rather than a mountain bike which you have (hence the "T" vs "M") so no clutch which is handy on a 1x MTB. According to Shimano the derailleur you currently have is also 11 speed compatible but I know cable pull is different for 10 and 11 but probably not nearly enough to cause issue if you did go 11 but if you go 11 you just need a shifter and cassette and you are at 11 speeds already.
There is a guy on Youtube that had issues with your bike and that derailleur because of the clutch but I refuse to link to that video because he links to and supports a known knockoff pedal in his video and I don't play that but is easily searched via the googles. However please for the love of Eddy Merckx and all that is Drillium (or holey) do not buy knockoff stuff.