Tiny Core Extensions > TCE Tips & Tricks

Creating a partition image with dd / ddrescue

(1/3) > >>

Fakir:
Hey folks!

I'd like to create a partiton image of my win partition via TC 7.2 in order to mount in a VM. Although it's written on many websites that this should work with dd / ddrescue, I cannot finish the execution:

1. First problem seems to be that the partitions are not handled by TC in the /dev folder but in the /mnt folder whereas dd / ddrescue expect a /dev folder

2. dd doesn't know the "conv=sparse" operator (and without this, the img file would be as big as the whole partition to clone)

3. By using ddrescue (syntax: ddrescue -S /dev/sda1 /dev/scc1/partition.img) the program tells me that this is not a directory. Indeed, this is a file but as mentioned: there are lots of pages telling that this operation can be done.

Can you see what seems to be the trouble?

Two additional questions:

a) Would partimage be the better alternative? - It's not listed in the repo, though.
b) Is Virtualbox able to read gz-data? If yes, I could do the operation without sparse operator by just simply compressing the img file..

Julian

Misalf:
Every mounted partition you see in  /mnt  has its counter part in  /dev .
I.e.  /mnt/sda1  and  /dev/sda1 .
If you want to  dd  the contents of a device into a file on a filesystem, you'd do something like

--- Code: ---dd if=/dev/sda1 of=/mnt/sdc1/partition.img

--- End code ---

patrikg:
The dd within busybox is very light.

You could just add coreutils if you need the dd version with more options.

You could easy check what dd you running like this:

Before install of coreutils.

--- Code: (bash) ---tc@box:~$ la $(which dd)
lrwxrwxrwx    1 root     root             7 Jan  1  1970 /bin/dd -> busybox
--- End code ---

After install coreutils.

--- Code: (bash) ---tc@box:~$ la $(which dd)
lrwxrwxrwx    1 root     root            38 Jan 22 17:03 /usr/local/bin/dd -> /tmp/tcloop/coreutils/usr/local/bin/dd
--- End code ---


Fakir:
Ok, hint 1 (misalf) already helped (at least a little bit ;) ): the program started but canceled execution after 4.3 GB.

Perhaps this is due to the fact that it's a Fat partition to where I write the img file..? - At least this would explain why partimage did the same and aborted after that amount of size, too.

I'll try it with dd (coreutils) but I have to be sure that the file does not contain zero bits (sparse file). For testing partimage I took my usb stick and the result exactly had the size of the files written on it. When I tested the same with ddrescue, the file size corresponded to the whole size of the stick. Luckily it was an old stick with only 512 MB.. ;)

How can I be sure that the img file will only contain 'real' data and no zero bits? And: how can I 'unblock' that 4.3 GB limit?

Fakir:
I just tested the procedure by using dd (coreutils). Although using the conv=sparse operator the resulting img file was at the same size as the whole partition (approx. only half of the partition is used by data).

Navigation

[0] Message Index

[#] Next page

Go to full version