I need to get a copy of an HDD that is a real 1:1, I mean not just the filesystem but also the geometry and the partition table and everything in between.
if I'll just use
dd if=/dev/sdb of=/tmp/file
this will generate what I'm looking for ?
Yes, this should be fine. Be sure to unmount your disk first and make sure there is enough space in the target directory.
/tmp is a
tmpfs in memory and not on disk on some systems, look at the output of
mount to check.
On a root shell you can also simply do:
cat /dev/sdb >/tmp/file
Alternatively, just copy it:
cp /dev/sdb /tmp/sdb.img
Please note Stephane's comment below for a potential benefit of using
There is an informative article on the Arch distro wiki here