I have a bootable sd card with OSMC on for my raspberry. I want to buy another and better sd card and i dont want to write and configure the OS again. Is there a way to extract the image from the current sd card (and then write it to the new one)
You can clone the sd card with DD.
Make sure the target card is at least as big as the source card.
A command to watch the progress of the copy is:
$ dd if=[source drive or image] of=[destination drive or image] bs=4M status=progress
The source or destination drive or image can be replaced with one of the following examples:
The above are examples. To backup the whole disk if source drive were
/dev/sdb and the destination drive were
/dev/sdc the command would be:
$ dd if=/dev/sdb of=/dev/sdc bs=4M status=progress
If you backed up to an image, you could use the image as a permanent backup and eventually make multiple clones from the image.
$ dd if=/home/user/disk.img of=/dev/sdc bs=4M status=progress
The number after in the device is the partition, in case you are only concern with cloning a partition rather than the whole drive.
It's very important to be careful with this low level command... especially the
of (output part). Without checking it'll start to write to the destination device which could corrupt your system if you output to the wrong device, your main OS or Data drive for example.
What I do in an effort to be careful is create a script for the process. Then run the script when I have spent a lot of time studying it to be sure I'm accessing the correct devices.
cntrl-C will drop out of the command, but it will not stop the process. You have to specifically kill the
After the clone, if there is a discrepancy in size (for instance the destination disk or partition is bigger, you can fix this with gparted by resizing the partition on the new drive.