Mahmud Pasha was born in 1780 in Drama, from where he got his nickname. He came from a distinguished family of Albanian origin: His maternal grandfather was Sultan Ahmed III by his mother, Zeynep Sultan, and his paternal grandfather Husayn Agha was a Çorbaci of the Janissaries and governor of Kavala. His father Halil Mehmed Bey was the Silahdar Agha of Sultan Selim III, after having commanded an Albanian regiment in Egypt against Napoleon. Husayn Agha was also the paternal uncle of Muhammad Ali of Egypt, making Mahmud the latter's nephew, and also a second cousin of Ibrahim Pasha, who would also lead an expedition in Greece in 1825–1828.
Mahmud was raised and educated at the Topkapi Palace at Istanbul. He participated in various campaigns throughout the Empire, rising to the post of Vizier and acquiring significant military skills. Enjoying the patronage of the Valide Sultan, he was eventually posted in his home province of Drama, succeeding his father Halil as governor. In 1820 he was Pasha of Thessaly at Larissa and participated in the army of Hursid Pasha that was operating against the rebel Ali Pasha of Yannina.
In the summer 1821, as the Greek uprising began, he crushed the first rebellions by Greeks in the Agrafa and Mount Pelion regions, and after the disgrace and suicide of Hursid, took over as Mora Valisi, with the task of destroying the Greek revolt in its heart, the Morea. He assembled a well-equipped army of well over 20,000 men, a huge force by Balkan standards, and the largest Ottoman army to enter Greece since the Ottoman invasion of the Morea in 1715. These comprised among others ca. 8,000 cavalry, predominantly from Macedonia and Thrace, and several thousand veterans of the campaign against Ali Pasha.
At the head of his army, Dramali set off from Larissa in late June 1822, and swept practically unmolested through eastern Greece: his forces marched unopposed through Boeotia, where they razed Thebes, and Attica, where however he did not attempt to retake the Acropolis, which had only shortly before surrendered to the Greeks.
He passed through the defiles of the Megaris unmolested, and entered the Peloponnese. He arrived at Corinth in mid-July, and found the strong fort of Acrocorinth abandoned without a fight by its Greek garrison. He wed the widow of the fort's murdered former commander, Kiamil Bey, and was joined by Yusuf Pasha of Patras, who advised him to remain in Corinth, using it as a base, and to build up strong naval forces in the Corinthian Gulf and isolate the Morea, before advancing on Tripoli. But Dramali, by now utterly self-confident by the Greeks' apparent reluctance to oppose him, decided to march at once to the south, towards the Argolis.
His advance caused a panic among the Greeks: the siege of Nafplio was abandoned just as the garrison was preparing to surrender, and the provisional government fled Argos and embarked on ships for safety. However, on arriving at Argos on 11 July, Dramali made two critical mistakes: he did not secure his main supply and retreat route through the Dervenakia Pass, and ignored the fact that the absence of the Ottoman Navy meant that he could not be supplied by sea. Instead, he focused on taking the town's fort, stubbornly defended by a 700-strong Greek garrison under Demetrios Ypsilantis, which held out for twelve vital days, before breaking through the besiegers' lines and escaping. During that time, the Greeks, under Theodoros Kolokotronis, rallied their forces, and occupied the surrounding hills and defiles, including the Dervenakia. The Greeks systematically looted the villages of the Argolic plain, even setting fire to the crops and damaging the springs, so as to starve the Turkish army.
Trapped in the sweltering summer heat of the Argolic plain, without water and food, Dramali was forced to plan withdrawing back to Corinth. On 26 July he sent out his cavalry as an advance guard towards the Dervenakia pass. But the Greeks were expecting the move, and had taken up positions there. The resulting battle was a complete Greek victory, with few Ottomans managing to escape. Finally, two days later, Dramali set out with his main army. Although he and his bodyguard managed to pass, the majority of his army, as well as the treasury and most baggage and equipment, were trapped in the pass and massacred. The result of Dramali's campaign, which had started so well, was a complete disaster: out of more than 30,000 soldiers, only 6,000 returned to Corinth, where Dramali died of high fever.
Dramali's defeat saved the Greek uprising from an early failure. The extent of the defeat was such that it entered into the modern Greek language as a proverb: "η νίλα του Δράμαλη" (Dramali's fiasco), which is used to denote a complete disaster.