Some phones can tell if they been rooted by flags that are set deep in the firmware and or hardware. For instance there's a device called a hardware fuse that was used in Motorola phones to determine whether or not it has been rooted. I'm not sure if the fuse system is still being used or for that matter if it really matters at this point.
Being rooted any longer isn't really such a big stigma, and although it may technically void your warranty, carriers aren't looking at this point to see whether or not a phone has been rooted unless the phone suffers catastrophic failure and they feel like pushing the envelope. I wouldn't worry about it, and if you can root the phone and get the data off that you want, I would go ahead and do it.
There is always the argument that in order to get access to your data which you deserve the right to have access to your only option was to root the phone so in that situation if it ever came down to it you can put up a pretty good fight and I'm sure that at the end of the day the carriers would not press the issue further.
What's wrong with the device? If the problem is fairly normal (the G2 had screen issues and a couple other hardware issues) then they have no reason to look for root. If you fried the CPU by overclocking, which isn't really an option with the G2, then they may dig deep to find that out.
Part of the screen is unresponsive, the GPS is totally wacked, and it's extremely sluggish. That last one i assume will probably by fixed when I factory reset though. But still, if they check I'm screwed. They've never checked any other device I've rooted, and I've exchanged a lot of rooted phones. But I never rooted my G2, and like I said I'd heard they could track it now.
I wouldn't worry. I don't think the G2 has much in the way of root tracking ability. Last I saw the only check it had was in the bootloader showed "Rooted" and I think in the software information it had a status of either rooted or unrooted. Each of those are easily fixed by using either of the two factory restore methods.