Developers who are using SD Cards for booting the OS for your embedded boards needs to backup the SD Card with modifications done such as installing new programs for the future use or for cloning the OS for another board. These steps will help you for the purpose.
For this purpose we make use of ‘dd’ command which is a part of GNU Coreutils package. The method which is described below doesn’t require embedded boards in hand, instead user can use any desktop PC running Linux OS.
After inserting the prebuild SD Card into the card reader and connecting to your PC/Laptop, you need to unmount the volume pointed by the SD Card.
To find out the Volume name type the following in the terminal
Find entry similar to /dev/sdX, note that /dev/sda must be most probably your HardDrive.
unmount /dev/sdX to unmount the volume.
Note: GUI users can unmount the device by simply right clicking the device icon and select Unmount. However, don’t eject the volume by selecting eject option.
Backup the SD Card by typing the following command in the terminal.
Note: Replace X in sdX with the suitable entry found by the command `
dmesg | tail` previously.
Note: This may take minutes depending upon the amount of volume of your SD Card. Wait for terminal process to return and do not eject the SD Card in the meanwhile.
For cloning the image into the new SD Card use the following command.
User can compress the file to 7z format by running the command
7z a <file_name>.7z <path>/my_image.img // a-compress e-extract
Note: install 7z tools by sudo apt-get install p7zip-full
Put the new SD Card back to your embedded board and enjoy Linux!!