Disk Management is a stock utility in Windows that can manage drives and create partitions of your hard drive. It's great with both hard drives and SSDs. It's not so great with a USB or a Micro SD card. In fact, up until the Windows 10 Anniversary update, you couldn't partition a USB or SD card with disk management. This is copying a disk image to an SD card, the OP wants to copy the SD card to a disk image. – Patrick Cook Jan 13 '16 at 5:15. Add a comment Your Answer. Can a Raspberry Pi be used to create a backup of itself? Corrupted SD Card - RPi does not boot. Win 32 Disk Imager is a well-known tool on Windows for Raspberry Pi And Linux users. It's often used to create SD cards (or USB disk) from an image of an operating system, downloaded on the Internet. You can download it here on SourceForge It looks like this. Look for your SD card by looking for a disk of the right size and name. In the above example, the SD Card is /dev/disk1. Next, in Terminal, enter the following command to create a disc image (.dmg) of your SD Card in your home directory. Sudo dd if=/dev/disk1 of=/SDCardBackup.dmg. Win32 Disk Imager is a Windows tool for reading data from an SD card and writing to a image file, also, it can be used to write a image file to a SD card. You may first use it to create a image file from a 'Master' SD card, then write the image back to a different SD card to complete the SD card clone.
#!/bin/bash |
### NOTE |
# Ideally, you should create an image from small partition (e.g., 4 GB) instead of the whole SD card (e.g., 32 GB). |
# For example, an image for Raspbian image should be created by the following procdure: |
# (1) Install the official Raspbian image (3.5 GB for Jessie) on an SD card |
# (2) Manually expand the partition to a modest size to accommodate your base software (e.g., 4 GB) |
# (3) Perform apt-get update and upgrade, install software and configuration that you want. |
# (4) Create an image from that (4 GB) partition |
# |
# The instruction for resizing partion and creating disk image with a specific size can be found in this link: |
# http://elinux.org/RPi_Resize_Flash_Partitions |
## Read SD card to disk image |
# STEP 1: insert the source SD card |
diskutil list |
# STEP 2: From the output, find the device number corresponding to your SD card |
# E.g., /dev/disk2 |
# In the code below, replace 'diskX' below with your disk number |
# STEP 3: copying (and compressing) |
sudo dd if=/dev/rdiskX of=~/Desktop/Chatberrypi.dmg bs=1m |
# OPTIONAL: |
# You can experiment with different block sizes (The 'bs' above; '1m' |
# means 1 MB.) Run dd for a few seconds and press Ctrl + C to see |
# the transfer rate. Adjust 'bs' and test again. |
# |
# In my MacBook Air, I found 1m yield an acceptable performance |
# STEP 3 (alternative): compress the image on-the-fly. (Note: Don't check the progress of dd with the command at the end of this page) |
sudo dd if=/dev/rdiskX conv=sync,noerror bs=1m | gzip -c >~/Desktop/Chatberrypi.img.gz |
# STEP 4: remove the source SD card |
## Write disk image to SD card |
# STEP 5: insert the destination SD card |
diskutil list |
# STEP 6: replace 'diskX' below with the device number of the SD card (see STEP 2) |
# STEP 7: unmount the SD card |
diskutil unmountDisk /dev/diskX |
# STEP 8: format the SD card |
sudo newfs_msdos -F 16 /dev/diskX |
# STEP 9: write the disk image |
sudo dd if=~/Desktop/Chatberrypi.dmg of=/dev/rdiskX bs=1m |
# STEP 9 (alternative): decompress the image on-the-fly and write image. (Note: Don't check the progress of dd with the command at the end of this page) |
sudo gunzip -c ~/Desktop/Chatberrypi.img.gz | sudo dd of=/dev/rdiskX conv=sync,noerror bs=1m |
# OPTIONAL: |
# To check progress of dd, open a separate terminal window and run |
# the following command to ask dd to print progress (in its terminal) |
# every 20 seconds. |
while sudo killall -INFO dd;do sleep 20;done |
# Sources: |
# SD card back up: https://smittytone.wordpress.com/2013/09/06/back-up-a-raspberry-pi-sd-card-using-a-mac/ |
# Status checking: http://www.commandlinefu.com/commands/view/5440/check-the-status-of-dd-in-progress-os-x |
In this post I'll explain how you can create a sector-by-sector disk image of a small USB flash drive or memory card using JpegDigger. This type if disk images are also referred to as dd or RAW image files. The disk image is an exact copy of each sector of the drive that was imaged.
Reasons and advantages of a disk image:
- Provides you with a safety net.
- Processing a disk image with file recover software is often faster than processing original media.
- It has diagnostic value (detection of bad sectors).
- In case of bad sectors, bad sector handling is isolated from file recovery process.
- Disk image can be shared with and processed by a 3rd party.
Specially in case of read errors a disk image is recommended. File recovery software typically reads areas multiple times, jumping back and forth between file system meta data and file data. It potentially ‘hits' bad sectors multiple times, each time resulting in slow downs and potential freezes of the file recovery software.
During the image process each sector is typically read one time. Depending on imaging strategy bad sector can be tried multiple times or skipped altogether. By dealing with bad sectors at this stage, we isolate this problem from the actual file recovery phase.
Special considerations when imaging SD and other memory cards or small USB flash drives
USB flash drives and often memory cards too are accessed over USB. USB does not handle drives with bad sectors particularly well. It's not uncommon for the USB device to be dropped if it does not respond quick enough. In many cases this means you have to deal with the dropped device and restart the imaging task.
Copy Sd Card To Image
JpegDigger's imaging module was designed with this problem in mind. If the device you're imaging is dropped it will prompt you to disconnect and reconnect the drive. In case of a USB thumb drive for example, you remove and re-insert the drive. In case of a USB memory cards reader, you remove and re-insert the reader from and into the USB port.
Once you have done that you click OK and JpegDigger will continue imaging.
Note: If you're frequently dealing with cases like these consider purchasing 3rd party hardware that allows JpegDigger to handle this task automatically and hands-free.
Ykush USB power controller allows JpegDigger to power cycle unstable memory cards and USB flash drives.
Creating a Flash Drive Disk Image using JpegDigger
Select the drive you will be imaging from the drop down list. Depending on the state of the file system JpegDigger may open the Override Window. If it does not click Override. Click the button next to ‘Open disk image' to open disk imaging module.
Check ‘Manual', set start sector to 0 (zero).
Now we need to decide on a block size. There's several consideration to be taken into account when selecting the block size:
- In general a larger block size results in faster imaging speeds.
- One block size is entirely ‘dropped' when a read error is encountered. This means, if we encounter ONE read error while blocksize 16 is chosen, 16 x 512 bytes will not be read and therefor not included in the disk image. Instead JpegDigger will insert a zero-padded(*) 16 x 512 byte block. So, to recover as much data as possible from bad spots the smallest possible block size is preferred. In case of many read errors though, this will slow down the imaging process tremendously.
(*) – JpegDigger uses zero-padding to fill dropped blocks. Many tools will also include a string or pattern that makes finding files affected by bad sectors easier. However, since JpegDigger is a photo recovery tool, I took into consideration that zeros have a far less disturbing influence on recovered photos than other options.
Windows Create Disk Image From Sd Card
Click Start. You'll be asked to select a location and image file name, for example ‘mysdcard.img'. JpegDigger does not assign an extension! To be compatible with other file recovery software I suggest to use .img or .dd extensions.
Sd Disk Card
Once the disk image is done it can be analyzed by JpegDigger or any other file recovery software.