Why must partition be unmounted before using dd? For example, for copying an iso to a flash drive, we have to unmount the drive before we use dd
. I've seen many places tell me to do this but never understood why?
Asked
Active
Viewed 2,257 times
7

John Robins
- 191
1 Answers
9
If you write data to the 'raw' block device while a filesystem on this device is still mounted then the kernel will have problems when updating the trashed file system. For example, the kernel will periodically flush dirty data back to the mounted device, or may do file lookups. If the underlying block device has been fundamentally changed then the kernel will find issues this can lead too kernel OOPs messages or even halt on BUG_ON() checks. So always unmount the filesystem before changing the underlying data on the block device.

Colin Ian King
- 18,820
dd
ing it? The image will inconsistent. – muru Feb 25 '16 at 03:01