 Following these failed assaults, both armies settled into trench warfare around Petersburg. There were numerous attempts, during the summer of 1864, on the part of the Union army, to dislodge the Confederates from their lines. One of the most disastrous for the Union army was the Battle of the Crater during which explosives were detonated in a large mine tunneled beneath the Confederate entrenchments, temporarily creating a gap in their lines. Elements of the IX Corps, under the command of Maj. Gen. Burnside, were to charge through the gap, but instead became trapped in the enormous crater. Brig. Gen. James Ledlie's division, of which the 21st was a part, led the attack. The division had been selected at the last minute over the United States Colored Troops who had actually trained for the operation. Unprepared, Ledlie's division delayed in their attack, allowing the Confederates time to regroup. The 21st managed to advance, mingled with other regiments, to the furthest point penetrated by Union troops but by the afternoon they made the retreat "pell mell" with the rest of Burnside's IX Corps.
