HDD image
-
Hi, Just needed a little guidance. Am creating a drive imaging utility mostly to understand the working. Can anyone guide me to a tutorial/example to make images of HDD on windows/linux using C/C++. Just the right direction will suffice. I tried googling it but all i get are the softwares to create the images not the actually approach to the problems. thanks.
-
Hi, Just needed a little guidance. Am creating a drive imaging utility mostly to understand the working. Can anyone guide me to a tutorial/example to make images of HDD on windows/linux using C/C++. Just the right direction will suffice. I tried googling it but all i get are the softwares to create the images not the actually approach to the problems. thanks.
In linux, it is easy, just open the proper device. A raw harddisk is represented by say /dev/hda where as the partitions are represented by /dev/hda1, /dev/hda2, etc. Just open the file with fopen and use fread to read the data. In WinNT (to include subsequent versions such as XP, etc) you can actually open device files the same way, but it is a lot messier. The NT kernel creates pseudo files like linux, but they are not as neatly grouped. They look like \\.\Volume{46b98f60-4a74-11dc-9364-806d6172696f}\ but have simpler aliases like \\?\Device\HarddiskVolume2 There is a open source program called rawwrite dd for windows that does just what you require and maybe you can glean some information from the authors homepage or from the source code: http://uranus.it.swin.edu.au/~jn/linux/rawwrite-old.htm[^]
-
In linux, it is easy, just open the proper device. A raw harddisk is represented by say /dev/hda where as the partitions are represented by /dev/hda1, /dev/hda2, etc. Just open the file with fopen and use fread to read the data. In WinNT (to include subsequent versions such as XP, etc) you can actually open device files the same way, but it is a lot messier. The NT kernel creates pseudo files like linux, but they are not as neatly grouped. They look like \\.\Volume{46b98f60-4a74-11dc-9364-806d6172696f}\ but have simpler aliases like \\?\Device\HarddiskVolume2 There is a open source program called rawwrite dd for windows that does just what you require and maybe you can glean some information from the authors homepage or from the source code: http://uranus.it.swin.edu.au/~jn/linux/rawwrite-old.htm[^]