The influence of end walls on segregation of bidisperse granular beds in a short rotating horizontal drum is studied by a discrete element method. Whereas non-closed periodically continued drums segregate radially, all simulations of drums with end walls resulted in axial segregation with two bands at low friction between the particles and the end-wall, and three bands at high friction. Various simulations show irregular transitions between two approximately equally stable states, with rapid oscillations preceding the conversions. The formation of two axial bands decreases the energy dissipation by the bed, whereas neither radial segregation nor axial segregation into three bands reduced the power absorption at constant angular velocity. Roughening up the end-walls also increased the rate of axial segregation.