Forum Discussion
How can I retrieve or recover deleted photos from sd card with computer?
- Mar 02, 2026
I have recovered deleted photos from my camera sd card a couple of times by following this guide:
https://www.wizzgear.com/recover-deleted-photos-from-sd-card
You can go and try out by your self!
How to recover deleted photos from SD card? Yes, using foremost is an excellent choice for this task. It is a powerful, open-source command-line tool specifically designed for data recovery, and it meets your criteria perfectly: it's completely free, avoids third-party graphical software, and operates through a challenging Command Prompt (terminal) method.
Here is a step-by-step guide on how to use foremost to recover deleted photos from SD card.
Important: First Step is Crucial
1.Stop using the SD card immediately. Any new data written to it risks overwriting the deleted photos, making them unrecoverable.
2.Create a disk image (Highly Recommended). Before you run foremost on the SD card, it's safest to create a complete backup image of it. This way, you can work on the image file and preserve the original card.
bash
sudo dd if=/dev/sdX of=~/sdcard_backup.img bs=512 conv=noerror,sync
Step 1: Identify the SD Card's Device Name
First, you need to find the device name for your SD card. Plug it into your computer and run this command in your Linux terminal:
bash
sudo fdisk -l
Look for your device; it will likely be something like /dev/sdb or /dev/sdc. Do not use a partition name like /dev/sdb1; use the whole device.
Step 2: Install Foremost
Foremost is available in the default repositories of most Linux distributions. You can install it with a single command:
bash
sudo yum install foremost # For CentOS/RHEL
Step 3: Run the Recovery
The basic command is straightforward. For example, to recover only JPEG and PNG photos from your SD card (/dev/sdb) and save them to a directory called recovered_photos on your computer's hard drive, you would use:
bash
sudo foremost -t jpg,png -i /dev/sdb -o /path/to/recovered_photos/
- -t jpg,png: This tells foremost to only look for these file types. You can add others like gif, nef, etc..
- -i /dev/sdb: This is the input drive (your SD card or the disk image file you created).
- -o /path/to/recovered_photos/: This is the output directory where the recovered files will be saved.
- This must be on a different drive (like your computer's hard drive) to avoid overwriting data on the SD card.