Quote:
Originally Posted by Ether
What happens if the sdb1 target partition is accidentally not mounted? Will I just get an error message and no damage done? Or are all bets off, and no telling what dd might do?
dd if=/dev/sda of=/mnt/sdb1/MBR.img bs=512 count=1
|
There are two possible scenarios, depending on how you have /mnt set up -- either /mnt/sdb1 exists as a regular directory when you don't have anything mounted to it, or /mnt/sdb1 doesn't exist when nothing is mounted to it. In the first scenario, dd will create the file MBR.img in /mnt/sdb1/, but this will be on the root filesystem, not the ntfs filesystem. If /mnt/sdb1 doesn't exist, dd will complain with a message like this:
Code:
dd: opening `/mnt/sdb1/MBR.img': No such file or directory
The only times you have to worry about corrupting a filesystem are a) when you have faulty drivers (if you install them from an official repository they're pretty well tested) or b) when you're writing directly to the drive itself (eg. /dev/sdb or /dev/sdb1). If you successfully mount a filesystem, you are no longer accessing the raw drive, but instead accessing the actual files of the filesystem, as though the root of the drive were simply a subdirectory of /mnt/.