{"id":772,"date":"2014-11-27T20:13:29","date_gmt":"2014-11-27T20:13:29","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=772"},"modified":"2025-07-03T17:30:11","modified_gmt":"2025-07-03T16:30:11","slug":"file-recovery-with-testdisk-photorec","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/file-recovery-with-testdisk-photorec\/","title":{"rendered":"File Recovery with TestDisk + Photorec"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_772\" class=\"pvc_stats all  \" data-element-id=\"772\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p style=\"margin-left: 7pt;\"><span style=\"font-size: 12pt;\"><span style=\"color: black;\"><br \/>\nExample using a phone SIM card. In Windows, a deleted file from such flash type media does not go into the Recycle Bin so is \"lost\" immediately no?\u00a0<\/span><\/span><\/p>\n<p>The card is \/dev\/sdf1 in this case.<\/p>\n<p>Let's look at it with some Linux tools...<\/p>\n<p><span style=\"color: #0070c0;\"># cfdisk \/dev\/sdf<\/span><span style=\"color: red;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">cfdisk (util-linux-ng 2.13.1.1)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Disk Drive: \/dev\/sdf\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Size: 249823232 bytes, 249 MB\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Heads: 16 Sectors per Track: 32 Cylinders: 953\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Name Flags Part Type FS Type [Label] Size (MB)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Pri\/Log Free Space 0.09 *\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">sdf1 Boot Primary FAT16 [ ] 249.48 *\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Pri\/Log Free Space 0.27\u00a0<\/span><\/p>\n<p>So it is formatted with FAT16 file system.<\/p>\n<p>Lets look at the boot sector with fdisk...<br \/>\n<span style=\"color: black;\"><br \/>\n<\/span><span style=\"color: #0070c0;\"># fdisk \/dev\/sdf<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command (m for help): m\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command action\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">a toggle a bootable flag\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">b edit bsd disklabel\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">c toggle the dos compatibility flag\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">d delete a partition\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">l list known partition types\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">m print this menu\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">n add a new partition\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">o create a new empty DOS partition table\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">p print the partition table\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">q quit without saving changes\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">s create a new empty Sun disklabel\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">t change a partition's system id\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">u change display\/entry units\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">v verify the partition table\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">w write table to disk and exit\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">x extra functionality (experts only)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command (m for help):\u00a0<\/span><br \/>\n<span style=\"color: black;\"><br \/>\nType p for partition info...\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">Disk \/dev\/sdf: 249 MB, 249823232 bytes\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">16 heads, 32 sectors\/track, 953 cylinders\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Units = cylinders of 512 * 512 = 262144 bytes\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Disk identifier: 0x00000000\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Device Boot Start End Blocks Id System\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">\/dev\/sdf1 * 1 952 243630+ 6 FAT16\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command (m for help):\u00a0<\/span><br \/>\n<span style=\"color: black;\"><br \/>\nNow type x, then d to show hex info:\u00a0<\/span><\/p>\n<p>The last 55 AA shows a FAT file system:<\/p>\n<p><span style=\"color: red;\">0x1A0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br \/>\n0x1B0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 05<br \/>\n0x1C0: 04 00 06 0F E0 B7 A3 00 00 00 5D 6F 07 00 00 00<br \/>\n0x1D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br \/>\n0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00<br \/>\n0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <strong>*55 AA*<\/strong><\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p>Type Q to quit.<\/p>\n<p>Install TestDisk and DDrescue<\/p>\n<p><span style=\"color: #0070c0;\"># apt-get install testdisk ddrescue<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p>I will zero the whole card so we know it is totally blank to start...<\/p>\n<p><span style=\"color: #0070c0;\">#\u00a0dd_rescue \/dev\/zero \/dev\/sdf\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">dd_rescue \/dev\/zero \/dev\/sdf\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">dd_rescue: (info): ipos: 31744.0k, opos: 31744.0k, xferd: 31744.0k\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">errs: 0, errxfer: 0.0k, succxfer: 31744.0k\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">+curr.rate: 319778kB\/s, avg.rate: 319778kB\/s, avg.load: 80.6%<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p>Once you see repeated info, Ctrl C to Quit...<\/p>\n<p><span style=\"color: red;\">dd_rescue: (warning): \/dev\/sdf1 (92920448.0k): No space left on device\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">dd_rescue: (warning): assumption rd(65536) == wr(^Cvice!\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">dd_rescue: (fatal): Caught signal 2 \"Interrupt\". Exiting!\u00a0<\/span><\/p>\n<p>Now the partition should be blank...check what cfdisk says...<\/p>\n<p><span style=\"color: #0070c0;\"># cfdisk \/dev\/sdf<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">cfdisk (util-linux-ng 2.13.1.1)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Disk Drive: \/dev\/sdf\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Size: 249823232 bytes, 249 MB\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Heads: 8 Sectors per Track: 60 Cylinders: 1016\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Name Flags Part Type FS Type [Label] Size (MB)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">---------\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Pri\/Log Free Space 249.70\u00a0<\/span><\/p>\n<p>YEP! It is blank...<\/p>\n<p>OK, let's create a partition and give it FAT file system...<\/p>\n<p><span style=\"color: #0070c0;\"># fdisk \/dev\/sdf<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">n add a new partition\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">o create a new empty DOS partition table\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">p print the partition table\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">q quit without saving changes\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">s create a new empty Sun disklabel\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">t change a partition's system id\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">u change display\/entry units\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">v verify the partition table\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">w write table to disk and exit\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">x extra functionality (experts only)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command (m for help): n\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command action\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">e extended\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">p primary partition (1-4)\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command action\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">e extended\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">p primary partition (1-4)\u00a0<\/span><\/p>\n<p><span style=\"color: #0070c0;\">p\u00a0<\/span><\/p>\n<p>Partition number (1-4): <span style=\"color: #0070c0;\">1<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">First cylinder (1-1016, default 1):\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Using default value 1\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Last cylinder or +size or +sizeM or +sizeK (1-1016, default 1016):\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Using default value 1016\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Command (m for help):<\/span><span style=\"color: black;\"><br \/>\n<\/span><span style=\"color: #0070c0;\">p<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">Disk \/dev\/sdf: 249 MB, 249823232 bytes\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">8 heads, 60 sectors\/track, 1016 cylinders\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Units = cylinders of 480 * 512 = 245760 bytes\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Disk identifier: 0x1d3b765e\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Device Boot Start End Blocks Id System\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">\/dev\/sdf1 1 1016 243810 83 Linux\u00a0<\/span><\/p>\n<p><span style=\"color: #0070c0;\"># mkfs.vfat \/dev\/sdf1\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">mkfs.vfat 3.0.1 (23 Nov 2008)\u00a0<\/span><\/p>\n<p>Looking at the card with Hexedit...<\/p>\n<p><span style=\"color: #0000ff;\"># apt-get install hexedit\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;\"># hexedit \/dev\/sdf1\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">00000000 EB 3C 90 6D 6B 64 6F 73 66 73 00 00 02 08 01 00 .&lt;.mkdosfs......<br \/>\n00000010 02 00 02 00 00 F8 EE 00 20 00 10 00 00 00 00 00 ........ .......<br \/>\n00000020 5C 6F 07 00 00 00 29 D8 29 DF AF 20 20 20 20 20 \\o....).)..<br \/>\n00000030 20 20 20 20 20 20 46 41 54 31 36 20 20 20 0E 1F FAT16 ..<br \/>\n00000040 BE 5B 7C AC 22 C0 74 0B 56 B4 0E BB 07 00 CD 10 .[|.\".t.V.......<br \/>\n00000050 5E EB F0 32 E4 CD 16 CD 19 EB FE 54 68 69 73 20 ^..2.......This<br \/>\n00000060 69 73 20 6E 6F 74 20 61 20 62 6F 6F 74 61 62 6C is not a bootabl<br \/>\n00000070 65 20 64 69 73 6B 2E 20 20 50 6C 65 61 73 65 20 e disk. Please<br \/>\n00000080 69 6E 73 65 72 74 20 61 20 62 6F 6F 74 61 62 6C insert a bootabl<br \/>\n00000090 65 20 66 6C 6F 70 70 79 20 61 6E 64 0D 0A 70 72 e floppy and..pr<br \/>\n000000A0 65 73 73 20 61 6E 79 20 6B 65 79 20 74 6F 20 74 ess any key to t<br \/>\n000000B0 72 79 20 61 67 61 69 6E 20 2E 2E 2E 20 0D 0A 00 ry again ... ...<br \/>\n000000C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p>CtrlC to quit prog...<\/p>\n<p>Mount the card in a test directory and put some test files on it....<\/p>\n<p><span style=\"color: #0070c0;\"># mount \/dev\/sdf1 \/mstest<\/span><span style=\"color: black;\"><br \/>\n<\/span><\/p>\n<p style=\"margin-left: 7pt;\"><span style=\"font-size: 12pt;\"><span style=\"color: black;\">I have already used these cmds so can call the cmd history to save re-typing them...<\/span><\/span><\/p>\n<p><span style=\"color: #0070c0;\"># history | grep cp<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">581 cp -vr\u00a0<em>\/College\/ReportWriting\/front\\ cover.doc \/mstest\/<\/em>\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">582 cp -vr\u00a0<em>\/College\/ReportWriting\/ReportTemplate.doc \/mstest\/<\/em>\u00a0<\/span><\/p>\n<p><span style=\"color: #0070c0;\"># !581; !582<\/span><span style=\"color: red;\">\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">cp -vr\u00a0<em>\/College\/ReportWriting\/front\\ cover.doc \/mstest\/<\/em>; cp -vr\u00a0<em>\/College\/ReportWriting\/ReportTemplate.doc \/mstest\/<\/em>\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">`\/College\/ReportWriting\/front cover.doc' -&gt; `\/mstest\/front cover.doc'\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">`\/College\/ReportWriting\/ReportTemplate.doc' -&gt; `\/mstest\/ReportTemplate.doc'\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;\"># ls \/mstest\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">front cover.doc ReportTemplate.doc\u00a0<\/span><\/p>\n<p>To see if file recovered is identical...<\/p>\n<p><span style=\"color: #0000ff;\"># shasum\u00a0<em>\/mstest\/<\/em>* &gt; \/mstest\/hashes.txt\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;\"># ls\u00a0<em>\/mstest\/<\/em>\u00a0<\/span><br \/>\n<span style=\"color: black;\"><br \/>\n<\/span><span style=\"color: red;\">front cover.doc hashes.txt ReportTemplate.doc\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;\"># cat \/mstest\/hashes.txt\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">3846af692dfbdee3dbc88f7a6b78c6d79cde07c7 \/mstest\/front cover.doc\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">5ccd582e7ec047b0f79aa7efc864dc09b4a31089 \/mstest\/ReportTemplate.doc\u00a0<\/span><\/p>\n<p>Now to \"accidently\" delete a file...<\/p>\n<p><span style=\"color: #0000ff;\"># rm -v \/mstest\/front\\ cover.doc\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">removed `\/mstest\/front cover.doc'<\/span><span style=\"color: black;\"><br \/>\n<\/span><span style=\"color: #0070c0;\"># ls\u00a0<em>\/mstest\/<\/em><\/span><span style=\"color: black;\"><br \/>\n<\/span><\/p>\n<p style=\"margin-left: 7pt;\"><span style=\"font-size: 12pt;\"><span style=\"color: red;\">hashes.txt ReportTemplate.doc\u00a0<\/span><span style=\"color: black;\"><br \/>\n<\/span><\/span><\/p>\n<p><span style=\"font-size: 12pt; color: #ffffff;\">Now, front\\ cover.doc\u00a0is missing.<br \/>\n<\/span><\/p>\n<p><span style=\"color: #ffffff; font-size: 12pt;\">Now to recover the lost file using TestDisk....<br \/>\n<\/span><\/p>\n<p><span style=\"font-size: 12pt; color: #ffffff;\">NOTE! Choose the whole disk NOT the partition...\u00a0<\/span><\/p>\n<p><span style=\"color: #ffffff;\">Unmount the card first else TD won't find the partition!!!\u00a0<\/span><\/p>\n<p><span style=\"color: #0070c0;\"># umount \/mstest\u00a0<\/span><\/p>\n<p><span style=\"color: #0000ff;\"># testdisk \/dev\/sdf\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">TestDisk 6.11, Data Recovery Utility, April 2009\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Christophe GRENIER<\/span><span style=\"color: black;\">\u00a0<\/span><span style=\"color: #00b050;\"><span style=\"text-decoration: underline;\">&lt;grenier@cgsecurity.org&gt;<\/span>\u00a0<\/span><\/p>\n<p><a href=\"https:\/\/www.cgsecurity.org\"><span style=\"text-decoration: underline;\">https:\/\/www.cgsecurity.org<\/span><\/a><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">TestDisk is free software, and\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">comes with ABSOLUTELY NO WARRANTY.\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Select a media (use Arrow keys, then press Enter):\u00a0<\/span><\/p>\n<p><span style=\"color: red;\"><strong>*Disk \/dev\/sdf - 249 MB \/ 238 MiB - Generic USB MS Reader*<\/strong>\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><strong>[Proceed ]<\/strong>\u00a0[ Quit ]\u00a0<\/span><br \/>\n<span style=\"color: #ff0000;\"><br \/>\nDisk \/dev\/sdf - 249 MB \/ 238 MiB - CHS 1016 8 60\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Partition Start End Size in sectors\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><strong>*1 P FAT16 &gt;32M 0 1 1 1015 7 60 487620*<\/strong>\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">[ Type ] [ Boot ] [Image Creation]\u00a0<strong>*[Undelete] *<\/strong>\u00a0[ Quit ]\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">*1 P FAT16 &gt;32M 0 1 1 1015 7 60 487620*<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Directory \/\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">*-rwxr-xr-x 0 0 19456 14-May-2012 00:23 front cover.doc*\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">-rwxr-xr-x 0 0 36352 14-May-2012 00:23 ReportTemplate.doc<\/span><span style=\"color: black;\"><span style=\"color: #ff0000;\">\u00a0<\/span><br \/>\n<\/span><span style=\"color: red;\">-rwxr-xr-x 0 0 135 14-May-2012 00:24 hashes.txt\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Use Right arrow to change directory, *c *to copy,\u00a0h to hide deleted files, q to quit\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Are you sure you want to copy\u00a0<em>\/front cover.doc to the directory \/ ? [Y<strong>\/<\/strong><\/em>*<strong>N<\/strong>]*\u00a0<\/span><\/p>\n<p>To select another directory, use the arrow keys.<\/p>\n<p><span style=\"color: red;\">drwxr-xr-x 0 0 4096 14-May-2012 00:19 .\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">drwxr-xr-x 0 0 4096 14-May-2012 00:19 ..\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">drwx------ 1000 0 4096 26-Jun-2010 14:39 College\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">drwxr-xr-x 0 0 4096 5-Oct-2009 20:41 Files\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">drwxr-xr-x 0 0 4096 13-May-2012 19:31 bin\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">drwxr-xr-x 0 0 4096 7-May-2012 13:29 black......\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><strong>*drwxrwxrwt 0 0 4096 14-May-2012 00:02 tmp*<\/strong>\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">drwxr-xr-x 0 0 4096 30-Aug-2008 16:37 usr\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">drwxr-xr-x 0 0 4096 20-Feb-2010 22:50 var\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Are you sure you want to copy \/front cover.doc to the directory \/tmp ?\u00a0<strong>[*Y*\/<\/strong>N]<\/span>\u00a0<span style=\"color: black;\"><br \/>\n<\/span><span style=\"color: red;\"><br \/>\n1 P FAT16 &gt;32M 0 1 1 1015 7 60 487620\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Directory \/\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\"><strong>*Copy done!*<\/strong>\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">-rwxr-xr-x 0 0 *19456* 14-May-2012 00:23 front cover.doc\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">-rwxr-xr-x 0 0 36352 14-May-2012 00:23 ReportTemplate.doc\u00a0<\/span><\/p>\n<p><span style=\"color: #ff0000;\">-rwxr-xr-x 0 0 135 14-May-2012 00:24 hashes.txt\u00a0<\/span><\/p>\n<p>Now check the recovered file size and checksum in the \/tmp directory...<\/p>\n<p><span style=\"color: #0070c0;\"># ls -ls \/tmp\/front\\ cover.doc<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\">20 -rw-r--r-- 1 root root <strong>*19456*<\/strong> 2012-05-14 00:23 \/tmp\/front cover.doc<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: #0070c0;\"># shasum \/tmp\/front\\ cover.doc<\/span><span style=\"color: black;\">\u00a0<\/span><\/p>\n<p><span style=\"color: red;\"><strong>3846af692dfbdee3dbc88f7a6b78c6d79cde07c7<\/strong>\u00a0\/tmp\/front cover.doc<\/span><span style=\"color: black;\"><span style=\"font-size: 12pt;\">\u00a0<\/span><\/span><\/p>\n<p><span style=\"color: #ffffff;\">From earlier dir...\u00a0<\/span><\/p>\n<p><span style=\"color: #ffffff;\"><strong>3846af692dfbdee3dbc88f7a6b78c6d79cde07c7<\/strong>\u00a0\/mstest\/front cover.doc\u00a0<\/span><\/p>\n<p><span style=\"color: #ffffff;\">As the checksum is the same, the file size has to be the same by definition!\u00a0<\/span><\/p>\n<p><span style=\"color: #ffffff;\">Cool huh?<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_772\" class=\"pvc_stats all  \" data-element-id=\"772\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>Example using a phone SIM card. In Windows, a deleted file from such flash type media does not go into the Recycle Bin so is \"lost\" immediately no?\u00a0 The card is \/dev\/sdf1 in this case. Let's look at it with some Linux tools... # cfdisk \/dev\/sdf\u00a0 cfdisk (util-linux-ng 2.13.1.1)\u00a0 Disk Drive: \/dev\/sdf\u00a0 Size: 249823232 bytes, <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/file-recovery-with-testdisk-photorec\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 File Recovery with TestDisk + Photorec<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-772","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"a3_pvc":{"activated":true,"total_views":1,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=772"}],"version-history":[{"count":1,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/772\/revisions"}],"predecessor-version":[{"id":10564,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/772\/revisions\/10564"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}