The stability of data bits in magnetic recording media(1,2) at ultrahigh de
nsities is compromised by the thermal 'flips'-magnetic spin reversals-of na
no-sized spin domains(3), which erase the stored information. Media that ar
e magnetized perpendicular to the plane of the film, such as ultrathin coba
lt films or multilayered structures(4,5), are more stable against thermal s
elf-erasure(2,6) than conventional memory devices. In this context, magneto
optical memories seem particularly promising for ultrahigh-density recordin
g on portable disks, and bit densities of similar to 100 Gbit inch(-2) (ref
. 7) have been demonstrated using recent advances in the bit writing and re
ading techniques(7-11). But the roughness and mobility of the magnetic doma
in walls(12,13) prevents closer packing of the magnetic bits, and therefore
presents a challenge to reaching even higher bit densities. Here we report
that the strain imposed by a linear defect in a magnetic thin film can smo
oth rough domain walls over regions hundreds of micrometres in size, and ha
lt their motion. A scaling analysis of this process, based on the generic p
hysics of disorder-controlled elastic lines(14-17), points to a simple way
by which magnetic media might be prepared that can store data at densities
in excess of 1 Tbit inch(-2).