How to duplicate a SD card with 2 partitions under Debian
For my cell phone, I used an app named link2sd with a SD card. Because the current 8GB card is filled up, I got a 32GB card to take its place. For the link2sd app, the SD card is partitioned into 2 partitions. First partition is formatted to fat32 and the 2nd one is ext2 format. What is the proper way to copy content of these partitions to the new card? Thanks in advance.
|
Hi
Let's try to reorganize the informations you gave - shouldn't matter what the source of your data is. You've got a 8GB card which has 2 partitions: - part #1: fat32 - part #2: ext2 You want to have those 2 partitions and their data on your brand new sdcard? If it's like this then you fist copy everything from the old card.... Code:
dd if=/dev/<your_8gb_card> of=anyfilename.data Code:
dd if=anyfilename.data of=/dev/<your_32gb_card> |
You have a choice of bit by bit and file by file. The above example is bit by bit. I assume it may work if cards are identical.
One can use other types of file by file copy too for mismatched drive. |
Quote:
Used this often when transferring partition-sets 1:1 :) |
Thanks. Yes, I need to resize the 2 partitions. On the 8GB card, I have it divided into 4 and 4. For the new one, I want something like 16 & 16.
|
I would think using a "cp -ra src dest" would be the simplest - but it requires you to have both cards installed at the same time.
If you want to make a backup, then I would suggest using tar. Then you can unplug the source, and plug in the second and restore the tar file. |
Can I tar the fat32 partition?
|
It depends on the data. Most common users can use any number of file by file tools. tar is a way to move files and has an advantage in some ways. If you have programs that are tied to a very specific location then you may have trouble with any sort of copy.
I sometimes get lazy and use gparted. |
The utility tar just puts all files into a single archive (file), but if you use gzip you can compress the archive as well.
Then you just extract the archive (tar or tar.gz) onto your new disk. (Create your partitioning scheme first.) |
tar has access to many different inline compression tools that can be used while creating the backup. Your choice.
|
Thanks. I will look up how to tar a Fat32 partition.
|
Thanks for the update.
Just to be correct, you tar files not partitions but I assume you know that. :) |
Quote:
|
All times are GMT -5. The time now is 12:17 PM. |