Booted my PC up with a Linux CD yesterday afternoon to do a ‘dd’ image of the hard disk so that I have a checkpoint in time to image my machine back to. Only thing is, it was still only halfway through making the 300GB image by 9am this morning after running all night. 😦
The command I issued was “dd if=/dev/sda of=/media/Iomega\ HDD/laptop-image-30th-july-2011.img” – which by default will take 512Kb blocks at a time and write them to the image file.
Instead, I stuck the options “bs=100M conv=notrunc” on the end of it and the process has speeded up massively. This tells dd to copy 100MB blocks instead. After about 20 minutes, I’m already 10% of the way through making the image.
Another helpful thing I discovered this morning is the -h switch on the ls command. -h makes the output ‘human-readable’ – i.e. it uses K, M and G to indicate kilobytes, megabytes and gigabytes. See below:
ubuntu@ubuntu:/media/Iomega HDD$ ls -lh total 29G drwx------ 1 ubuntu ubuntu 0 2011-03-26 21:03 Old drive images drwx------ 1 ubuntu ubuntu 4.0K 2011-02-20 15:15 Study resources -rw------- 1 ubuntu ubuntu 29G 2011-07-31 11:37 laptop-image-30th-jul-2011.img drwx------ 1 ubuntu ubuntu 0 2008-06-11 14:19 System Volume Information ubuntu@ubuntu:/media/Iomega HDD$
All this is probably no news to some people, but I’ve been using Linux for about 10 years and didn’t know all this stuff for some reason. You learn something new every day…