What happens when one is affected by something such as energy drain, and permanently loses levels when one only has racial HD? Does the victim of the spell die? Or do they permanently lose racial HD?
Level loss through energy drain may reduce a creature's Hit Dice
Although the loss of actual, for-reals Hit Dice (as opposed to levels) from energy drain goes unmentioned in the Dungeon Master's Guide, Monster Manual, Libris Mortis, and both the pre- and post-revision FAQs, the Monster Manual II on Special Attacks in its description of energy drain says
On a failure [i.e. a failed saving throw to remove the negative level], the negative level goes away, but the opponent’s level (or HD) is also reduced by one. (14)
Similarly, the Monster Manual IV in its Glossary's energy drain entry says
On a failure [i.e. a failed saving throw to remove the negative level], the negative level goes away, but the creature’s level (or HD) is also reduced by one. (209)
Both the Monster Manual III and V change their energy drain entries so as to no longer mention Hit Dice. Were there any more information about this, I'd include it, but—so far as I'm aware—there isn't, so ask the DM if the Monster Manual V is the final word on the subject because it was published last or if the Monster Manual is the final word on the subject because it's a primary source or if the Monster Manuals II and IV are the final word on the subject because they expand rather than contradict the existing rules. Since the alternative is silence, this DM would gravitate toward the II and IV's take on the subject. However, what this means exactly to, for example, an ogre PC that has no class levels that's just lost a Hit Die is something on which the DM must rule.
The section on Improving Monsters->Monsters and Class Levels says
The creature’s Hit Dice equal the number of class levels it has plus its racial Hit Dice,
demonstrating how level and hit dice are used interchangeably as opposed to the distinction between racial hit dice and class level.
Since the number of negative levels must equal total HD (racial hit dice pluce clasto kill the victim, that does not happen. As
The victim’s experience point total is immediately set to the midpoint of the previous level. For example, a character drained from 2nd to 1st level would drop to 500 experience points.
this could be applied, since racial hit dice impact ECL, you could simply use the same logic (deduct a racial hit die, lower xp by 1/2 the last ECL and allow it to be regained on earning back that xp).
To elaborate, take for example, a satyr wizard. A satyr has 5 racial hit dice and a +2 level adjustment (without pipes). Assuming the satyr has 1 level in wizard, then the satyr's ECL is 8 (5 racial hd + 2 LA + 1 class level). If this character was subject to energy drain for two levels (one class level and one racial hit die), and the drain remained for 24 hours and the character failed it's save; then the effects of those two negative levels would be dropped and the satyr would lose it's wizard level and one racial hit die. At this point, the satyr has 4 racial hit die and 0 class levels and is ECL 6. XP would get set to 1/2 between ECL 6 and ECL 7. On obtaining enough XP to gain ECL 7, one racial hit die would be returned, and on obtaining enough XP to gain ECL 8 (again), the wizard level would be restored.