How do I make an image of my entire USB flash drive?
/dev/sdb is the entire USB disk, and
/dev/sdb1 is a partition on the disk. If you want to image the entire disk, you want
That said, mounting as read-only isn't going to help you any in this case. You're bypassing the filesystem (which is where the read-only effect is) and working directly with the block device. So if you mix up
o, you'll trash the disk anyway.
There isn't much benefit to
dd here, you might just as well use
sudo cat /dev/sdb > /somelargedisk/rawusbdrive
pv for a nice progress display.)
The best way to back up a whole drive is via
dd because you can control buffer size for block devices better than with
cat. While the USB drive is not mounted, please run, as
dd if=/dev/sdb bs=16M of=/somelargedisk/rawusbdrive
/dev/sdb is your USB drive (check which one by using
/somelargedisk/rawusbdrive is a path and filename you choose on a disk/partition with lots of space.
You can restore that backup by exchanging
of arguments to
dd can easily overwrite all your data beyond repair (with reasonable effort) if you get the parameters wrong!
This was first mentioned in my comment to your other question Best linux recovery tool for deleted files from USB flash drive?