{"id":6902,"date":"2025-02-07T12:59:56","date_gmt":"2025-02-07T07:29:56","guid":{"rendered":"https:\/\/www.veeble.com\/kb\/?p=6902"},"modified":"2025-03-28T10:50:03","modified_gmt":"2025-03-28T05:20:03","slug":"recover-deleted-files-linux-and-linux-partitions","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/recover-deleted-files-linux-and-linux-partitions\/","title":{"rendered":"How to Recover Deleted Files and Partitions in Linux?"},"content":{"rendered":"\n<p><strong><span style=\"text-decoration: underline\">Recover deleted files Linux and partitions easily \u2013 Here&#8217;s How!<\/span><\/strong><br>Have you lost your partitions or deleted any files in Linux accidentally by chance? \ud83e\udd28 <br>Linux provides effective tools to recover deleted files and Linux partitions. This guide will introduce you to two key utilities: <strong><mark style=\"background-color:#f8ecaa\" class=\"has-inline-color\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/TestDisk\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/TestDisk\" target=\"_blank\" rel=\"noreferrer noopener\">TestDisk<\/a><\/mark><\/strong>, which helps recover partitions and the files contained in them, and <strong><mark style=\"background-color:#f8ecaa\" class=\"has-inline-color\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/PhotoRec\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/PhotoRec\" target=\"_blank\" rel=\"noreferrer noopener\">PhotoRec<\/a><\/mark><\/strong>, designed for file recovery. These tools are commonly used together since losing a partition often results in losing the files it contains.<\/p>\n\n\n\n<pre class=\"wp-block-verse has-vivid-red-color has-text-color has-link-color wp-elements-346ca76a4fceb9bebbaa147b048b3e93\"><strong>Warning:<\/strong> Before taking any action, refrain from copying or saving new files to the affected storage drive. Doing so could permanently overwrite the lost files.<\/pre>\n\n\n\n<p><strong>Before diving into recovering, here\u2019s a simple flowchart to help you decide the best Tool for your needs or which Tool you must consider using first:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1819\" height=\"410\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/flowchart-for-recover-deleted-files-in-linux-2.png\" alt=\"This flowchart describes which tool to consider before recover the deleted files or partitions in linux. the tools in this blog we using are photorec and testdisk. inorder to avoid confusion we are using this flowchart to understand our tool.\" class=\"wp-image-6916\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/flowchart-for-recover-deleted-files-in-linux-2.png 1819w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/flowchart-for-recover-deleted-files-in-linux-2-300x68.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/flowchart-for-recover-deleted-files-in-linux-2-1024x231.png 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/flowchart-for-recover-deleted-files-in-linux-2-768x173.png 768w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/flowchart-for-recover-deleted-files-in-linux-2-1536x346.png 1536w\" sizes=\"auto, (max-width: 1819px) 100vw, 1819px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" style=\"margin-top:0;margin-bottom:0\" id=\"rank-math-toc\"><h4>Table of Contents<\/h4><nav><div><div><a href=\"#part-1-recovering-deleted-files-with-photo-rec\">Part 1: Recover Deleted Files Linux with PhotoRec<\/a><\/div><div><a href=\"#part-2-recovering-lost-partitions-with-test-disk\">Part 2: Recover Lost Partitions and Files Using TestDisk<\/a><\/div><\/div><\/nav><\/div>\n\n\n\n<p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"part-1-recovering-deleted-files-with-photo-rec\">Part 1: Recover Deleted Files Linux with PhotoRec<\/h2>\n\n<h5 class=\"wp-block-heading\" id=\"how-photo-rec-work-to-recover-deleted-files-in-linux\"><strong>How PhotoRec work to recover deleted files in Linux?<\/strong><\/h5>\n\n\n<p>When you delete a file, it&#8217;s often not immediately erased from your storage device. Instead, the system may simply remove the reference to the file, making it appear deleted. PhotoRec is a powerful tool that can recover these deleted files. It works by directly scanning the raw data on your storage device, and searching for file headers to identify and reconstruct files, even if the file system is damaged or the file&#8217;s metadata has been partially overwritten. PhotoRec then copies the recovered files to a location you specify. This allows you to restore your lost data.<\/p>\n\n\n<h5 class=\"wp-block-heading\" id=\"how-to-install-test-disk-to-recover-deleted-files-in-linux\">How to install PhotoRec in Linux?<\/h5>\n\n\n<p>PhotoRec is bundled with TestDisk, and therefore to install PhotoRec, execute the below command to install PhotoRec on Debian-based distributions like Ubuntu:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update -y\nsudo apt install testdisk<\/code><\/pre>\n\n\n\n<p>Alternatively, if you&#8217;re using RedHat-based distros like CentOS or AlmaLinux, run this command instead:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm<br>yum update -y<br>yum install testdisk -y<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n<h5 class=\"wp-block-heading\" id=\"how-to-recover-deleted-files-step-by-step-using-photo-rec\">How to recover deleted files step-by-step using PhotoRec?<\/h5>\n\n\n<ol class=\"wp-block-list\">\n<li>Once installed, open the PhotoRec via the terminal by executing the command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>photorec<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A6C37E12-68CD-4D41-BE2A-30453146BC51.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1281\" height=\"730\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A6C37E12-68CD-4D41-BE2A-30453146BC51.jpg\" alt=\"Execute the command: photorec in terminal to open the data recovery utility to recover deleted files in Linux\" class=\"wp-image-6931\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A6C37E12-68CD-4D41-BE2A-30453146BC51.jpg 1281w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A6C37E12-68CD-4D41-BE2A-30453146BC51-300x171.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A6C37E12-68CD-4D41-BE2A-30453146BC51-1024x584.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A6C37E12-68CD-4D41-BE2A-30453146BC51-768x438.jpg 768w\" sizes=\"auto, (max-width: 1281px) 100vw, 1281px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Use the arrow keys to navigate and select the storage device from which files were lost and press <strong>Enter<\/strong> to proceed.<\/li>\n<\/ol>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li>Select the partition where the files were deleted and press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/BFE97661-6BA3-44F2-9F62-4E9807D3275A.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1296\" height=\"882\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/BFE97661-6BA3-44F2-9F62-4E9807D3275A.jpg\" alt=\"Select the partition where the files were deleted and press Enter in the next screen.\" class=\"wp-image-6932\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/BFE97661-6BA3-44F2-9F62-4E9807D3275A.jpg 1296w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/BFE97661-6BA3-44F2-9F62-4E9807D3275A-300x204.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/BFE97661-6BA3-44F2-9F62-4E9807D3275A-1024x697.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/BFE97661-6BA3-44F2-9F62-4E9807D3275A-768x523.jpg 768w\" sizes=\"auto, (max-width: 1296px) 100vw, 1296px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>Navigate to the <strong>File Options<\/strong> and press Enter key.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/select-file-options-1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1292\" height=\"887\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/select-file-options-1.jpg\" alt=\"Navigate to the File Options and Press Enter\" class=\"wp-image-6934\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/select-file-options-1.jpg 1292w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/select-file-options-1-300x206.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/select-file-options-1-1024x703.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/select-file-options-1-768x527.jpg 768w\" sizes=\"auto, (max-width: 1292px) 100vw, 1292px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Select specific file types you want to recover (e.g., JPEG, PDF, DOCX, etc.).<\/li>\n\n\n\n<li>Press <strong>B<\/strong> to save the selection and then go <strong>Quit<\/strong> and press Enter.<\/li>\n<\/ol>\n\n\n\n<ol start=\"8\" class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/specify-the-file-type-and-save.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"1278\" height=\"862\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/specify-the-file-type-and-save.gif\" alt=\"Select specific file types you want to recover and press B to save the settings.\" class=\"wp-image-6935\"\/><\/a><\/figure>\n\n\n\n<ol start=\"8\" class=\"wp-block-list\">\n<li>Choose a different drive to store the recovered files (do not save them on the same drive).<\/li>\n\n\n\n<li>Press <strong>C<\/strong> to confirm after selecting a destination directory to save.<\/li>\n\n\n\n<li>Press <strong>Enter<\/strong> to begin recovery.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A85D71CE-8D3C-403A-8FAC-787E88C8E784.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"389\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A85D71CE-8D3C-403A-8FAC-787E88C8E784.jpg\" alt=\"recovering files deleted in Linux using PhotoRec tool\" class=\"wp-image-6937\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A85D71CE-8D3C-403A-8FAC-787E88C8E784.jpg 798w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A85D71CE-8D3C-403A-8FAC-787E88C8E784-300x146.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/A85D71CE-8D3C-403A-8FAC-787E88C8E784-768x374.jpg 768w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"12\" class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<ol start=\"11\" class=\"wp-block-list\">\n<li>Wait for the process to complete.<\/li>\n\n\n\n<li>Once the recovery is done, go to the destination folder you selected and check if your files are restored.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"part-2-recovering-lost-partitions-with-test-disk\">Part 2: Recover Lost Partitions and Files Using TestDisk<\/h2>\n\n<h5 class=\"wp-block-heading\" id=\"how-test-disk-works-to-recover-lost-partitions-in-linux\"><strong>How TestDisk works to recover lost partitions in Linux?<\/strong><\/h5>\n\n\n<p>When a partition is lost or becomes inaccessible, the problem often lies in the partition table or boot sector, which tells the system how the storage device is organized. TestDisk works by analyzing the drive&#8217;s structure, searching for backup partition tables, and identifying existing partitions even if their entries are corrupted or missing. TestDisk can also attempt to repair damaged boot sectors. Once it locates a lost partition, TestDisk allows you to rewrite the partition table, making the partition accessible again. It&#8217;s important to note that TestDisk primarily focuses on restoring the structure of the drive; it doesn&#8217;t directly recover individual files (though it can list files within a recovered partition to help you verify it&#8217;s the correct one).<\/p>\n\n\n<h5 class=\"wp-block-heading\" id=\"how-to-install-test-disk-to-recover-deleted-partitions-in-linux\">How to install TestDisk in Linux?<\/h5>\n\n\n<p>If you are using Debian-based distros such as Ubuntu, open the terminal and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update -y\nsudo apt -y install testdisk<\/code><\/pre>\n\n\n\n<p>Alternatively, if you&#8217;re using RedHat-based distros like CentOS or AlmaLinux, run this command instead:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm\nyum update -y\nyum install testdisk -y<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n<h5 class=\"wp-block-heading\" id=\"how-to-recover-deleted-partitions-step-by-step-using-test-disk\">How to recover deleted partitions step-by-step using TestDisk?<\/h5>\n\n\n<ol class=\"wp-block-list\">\n<li>Once installed, open the TestDisk via the terminal by executing the command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>testdisk<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Press <strong>Enter<\/strong> to start the program.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/image-1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1295\" height=\"753\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/image-1.jpg\" alt=\"Open the TestDisk via the terminal by executing the command. This will open the testdisk utility which can be used for recover deleted files and partitions in Linux.\" class=\"wp-image-6952\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/image-1.jpg 1295w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/image-1-300x174.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/image-1-1024x595.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/image-1-768x447.jpg 768w\" sizes=\"auto, (max-width: 1295px) 100vw, 1295px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>To create a log, select the default option &#8220;Create&#8221;; if you don&#8217;t need a log, use the arrow keys to choose &#8220;No Log&#8221; and press Enter to proceed to the next screen.<\/li>\n\n\n\n<li>The data recovery tool TestDisk will now display a list of all connected storage devices. Use the arrow keys to select the device where your partition was deleted and press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/43B17A39-9AB0-4919-9CFD-72211E7EAAB8.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1300\" height=\"373\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/43B17A39-9AB0-4919-9CFD-72211E7EAAB8.jpg\" alt=\"The data recovery tool TestDisk will now display a list of all connected storage devices. Use the arrow keys to select the device where your partition was deleted and then press Enter.\" class=\"wp-image-6953\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/43B17A39-9AB0-4919-9CFD-72211E7EAAB8.jpg 1300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/43B17A39-9AB0-4919-9CFD-72211E7EAAB8-300x86.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/43B17A39-9AB0-4919-9CFD-72211E7EAAB8-1024x294.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/43B17A39-9AB0-4919-9CFD-72211E7EAAB8-768x220.jpg 768w\" sizes=\"auto, (max-width: 1300px) 100vw, 1300px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li>TestDisk will automatically detect the partition table type (e.g., Intel\/MBR or GPT). If the default selection is correct, press <strong>Enter<\/strong>.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/C53ACBAE-F362-44CF-BFB8-2924719F3212.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1293\" height=\"555\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/C53ACBAE-F362-44CF-BFB8-2924719F3212.jpg\" alt=\"TestDisk will automatically detect the partition table type (e.g., Intel\/MBR or GPT). If the default selection is correct, press Enter.\" class=\"wp-image-6954\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/C53ACBAE-F362-44CF-BFB8-2924719F3212.jpg 1293w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/C53ACBAE-F362-44CF-BFB8-2924719F3212-300x129.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/C53ACBAE-F362-44CF-BFB8-2924719F3212-1024x440.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/C53ACBAE-F362-44CF-BFB8-2924719F3212-768x330.jpg 768w\" sizes=\"auto, (max-width: 1293px) 100vw, 1293px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li>Navigate to the <strong>Analyze<\/strong> option and press <strong>Enter<\/strong> to scan the disk for lost partitions.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/9EC48BAE-B172-4689-ABC3-5A2DA4D7F5A9.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1294\" height=\"310\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/9EC48BAE-B172-4689-ABC3-5A2DA4D7F5A9.jpg\" alt=\"Navigate to the Analyze option and press Enter to scan the disk for lost partitions.\" class=\"wp-image-6956\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/9EC48BAE-B172-4689-ABC3-5A2DA4D7F5A9.jpg 1294w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/9EC48BAE-B172-4689-ABC3-5A2DA4D7F5A9-300x72.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/9EC48BAE-B172-4689-ABC3-5A2DA4D7F5A9-1024x245.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/9EC48BAE-B172-4689-ABC3-5A2DA4D7F5A9-768x184.jpg 768w\" sizes=\"auto, (max-width: 1294px) 100vw, 1294px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"7\" class=\"wp-block-list\">\n<li>Select <strong>Quick Search<\/strong> to let TestDisk find missing partitions. This process may take some time.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/quick-search-1.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1280\" height=\"572\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/quick-search-1.jpg\" alt=\"Select Quick Search to let TestDisk find missing partitions. This process may take some time.\" class=\"wp-image-6960\" style=\"width:780px;height:auto\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/quick-search-1.jpg 1280w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/quick-search-1-300x134.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/quick-search-1-1024x458.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/quick-search-1-768x343.jpg 768w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"8\" class=\"wp-block-list\">\n<li>TestDisk will display the detected partitions. Select the missing partition using the arrow keys and press <strong>P<\/strong> to list its files.\n<ul class=\"wp-block-list\">\n<li>If the files appear correctly, you can proceed with recovery.<\/li>\n\n\n\n<li>To restore the partition, press <strong>Enter<\/strong> and select <strong>Write<\/strong> to save changes.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/missing-partitions.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1266\" height=\"733\" src=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/missing-partitions.jpg\" alt=\"Recovered missing partitions in Linux\" class=\"wp-image-6962\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/missing-partitions.jpg 1266w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/missing-partitions-300x174.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/missing-partitions-1024x593.jpg 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/missing-partitions-768x445.jpg 768w\" sizes=\"auto, (max-width: 1266px) 100vw, 1266px\" \/><\/a><\/figure>\n\n\n\n<ol start=\"9\" class=\"wp-block-list\">\n<li>If you want to recover specific files instead of restoring the whole partition, you can copy them:\n<ul class=\"wp-block-list\">\n<li>Select the partition.<\/li>\n\n\n\n<li>Press <strong>P<\/strong> to list files.<\/li>\n\n\n\n<li>Highlight the files you want to recover and press <strong>C<\/strong> to copy them.<\/li>\n\n\n\n<li>Choose a destination folder and confirm.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<ol start=\"10\" class=\"wp-block-list\">\n<li>After restoring the partition, restart your computer and check if the partition appears in your file manager. If everything looks good, your data is successfully recovered!<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-uagb-separator uagb-block-7482a1bd\"><div class=\"wp-block-uagb-separator__inner\" style=\"--my-background-image:\"><\/div><\/div>\n\n\n\n<p>PhotoRec and TestDisk effectively recover deleted files Linux as well as lost partitions. Following this guide, you can easily recover lost partitions or deleted files without much doubt if the data was lost sometime before. These tools have limitations; if disk sectors are overwritten, recovering deleted files or partitions becomes impossible. If your data is crucial, a robust backup plan is essential. For those looking to recover deleted files Linux effectively, these tools offer a strong starting point. Consider setting up a Linux VPS backup server using rsync (see our guide: <a href=\"https:\/\/www.veeble.com\/kb\/setup-linux-vps-backup-server-using-rsync\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.veeble.com\/kb\/setup-linux-vps-backup-server-using-rsync\/<\/a>) or exploring an unmetered VPS for ample storage (<a href=\"https:\/\/www.veeble.com\/in\/vps-hosting\/\">https:\/\/www.veeble.com\/in\/vps-hosting\/<\/a>) to protect your valuable data from such situations.<\/p>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-16afde26 wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Powerful VPS Hosting, Without the Premium Price<\/h3><p class=\"uagb-cta__desc\">Get the performance you need at a price you&#8217;ll love. Explore our affordable VPS plans.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/vps-hosting\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">See Pricing<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Have you lost your files or deleted any partitions accidentally by any chance? This guide will help you to recover them easily without much efforts.<\/p>\n","protected":false},"author":7,"featured_media":8372,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5],"tags":[],"class_list":["post-6902","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/How-to-Recover-Deleted-Files-and-Partitions-in-Linux.jpg",1366,768,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/How-to-Recover-Deleted-Files-and-Partitions-in-Linux-150x150.jpg",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/How-to-Recover-Deleted-Files-and-Partitions-in-Linux-300x169.jpg",300,169,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/How-to-Recover-Deleted-Files-and-Partitions-in-Linux-768x432.jpg",768,432,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/How-to-Recover-Deleted-Files-and-Partitions-in-Linux-1024x576.jpg",1024,576,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/How-to-Recover-Deleted-Files-and-Partitions-in-Linux.jpg",1366,768,false],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2025\/02\/How-to-Recover-Deleted-Files-and-Partitions-in-Linux.jpg",1366,768,false]},"uagb_author_info":{"display_name":"Adrian Antony","author_link":"https:\/\/www.veeble.com\/kb\/author\/adrian\/"},"uagb_comment_info":0,"uagb_excerpt":"Have you lost your files or deleted any partitions accidentally by any chance? This guide will help you to recover them easily without much efforts.","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/6902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=6902"}],"version-history":[{"count":38,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/6902\/revisions"}],"predecessor-version":[{"id":8373,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/6902\/revisions\/8373"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/8372"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=6902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=6902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=6902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}