{"id":3766,"date":"2022-12-20T17:20:00","date_gmt":"2022-12-20T20:20:00","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/ntfsundelete-man8\/"},"modified":"2022-12-20T17:20:00","modified_gmt":"2022-12-20T20:20:00","slug":"ntfsundelete-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/ntfsundelete-man8\/","title":{"rendered":"NTFSUNDELETE (man8)"},"content":{"rendered":"<h1 align=\"center\">NTFSUNDELETE<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#CAVEATS\">CAVEATS<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#BUGS\">BUGS<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a><br \/> <a href=\"#AVAILABILITY\">AVAILABILITY<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">ntfsundelete \u2212 recover a deleted file from an NTFS volume.<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ntfsundelete<\/b> [<i>options<\/i>] <i>device<\/i><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i><b>ntfsundelete<\/b><\/i> has three modes of operation: <i>scan<\/i>, <i>undelete<\/i> and <i>copy<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Scan<\/b> <br \/> The default mode, <i>scan<\/i> simply reads an NTFS Volume and looks for files that have been deleted. Then it will print a list giving the inode number, name and size.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Undelete<\/b> <br \/> The <i>undelete<\/i> mode takes the files either matching the regular expression (option \u2212m) or specified by the inode\u2212expressions and recovers as much of the data as possible. It saves the result to another location. Partly for safety, but mostly because NTFS write support isn\u2019t finished.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Copy<\/b> <br \/> This is a wizard\u2019s option. It will save a portion of the MFT to a file. This probably only be useful when debugging <i>ntfsundelete<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Notes <br \/> ntfsundelete<\/b> only ever <b>reads<\/b> from the NTFS Volume. <b>ntfsundelete<\/b> will never change the volume.<\/p>\n<h2>CAVEATS <a name=\"CAVEATS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Miracles <br \/> ntfsundelete<\/b> cannot perform the impossible.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When a file is deleted the MFT Record is marked as not in use and the bitmap representing the disk usage is updated. If the power isn\u2019t turned off immediately, the free space, where the file used to live, may become overwritten. Worse, the MFT Record may be reused for another file. If this happens it is impossible to tell where the file was on disk.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Even if all the clusters of a file are not in use, there is no guarantee that they haven\u2019t been overwritten by some short\u2212lived file.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Locale<\/b> <br \/> In NTFS all the filenames are stored as Unicode. They will be converted into the current locale for display by <b>ntfsundelete<\/b>. The utility has successfully displayed some Chinese pictogram filenames and then correctly recovered them.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Extended MFT Records<\/b> <br \/> In rare circumstances, a single MFT Record will not be large enough to hold the metadata describing a file (a file would have to be in hundreds of fragments for this to happen). In these cases one MFT record may hold the filename, but another will hold the information about the data. <b>ntfsundelete<\/b> will not try and piece together such records. It will simply show unnamed files with data.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>Compressed and Encrypted Files <br \/> ntfsundelete<\/b> cannot recover compressed or encrypted files. When scanning for them, it will display as being 0% recoverable.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>The Recovered File\u2019s Size and Date<\/b> <br \/> To recover a file <b>ntfsundelete<\/b> has to read the file\u2019s metadata. Unfortunately, this isn\u2019t always intact. When a file is deleted, the metadata can be left in an inconsistent state. e.g. the file size may be zero; the dates of the file may be set to the time it was deleted, or random. <br \/> To be safe <b>ntfsundelete<\/b> will pick the largest file size it finds and write that to disk. It will also try and set the file\u2019s date to the last modified date. This date may be the correct last modified date, or something unexpected.<\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Below is a summary of all the options that <b>ntfsundelete<\/b> accepts. Nearly all options have two equivalent names. The short name is preceded by <b>\u2212<\/b> and the long name is preceded by <b>\u2212\u2212<\/b>. Any single letter options, that don\u2019t take an argument, can be combined into a single command, e.g. <b>\u2212fv<\/b> is equivalent to <b>\u2212f \u2212v<\/b>. Long named options can be abbreviated to any unique prefix of their name. <b><br \/> \u2212b<\/b>, <b>\u2212\u2212byte<\/b> NUM<\/p>\n<p style=\"margin-left:22%;\">If any clusters of the file cannot be recovered, the missing parts will be filled with this byte. The default is zeros.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212C<\/b>, <b>\u2212\u2212case<\/b><\/p>\n<p style=\"margin-left:22%;\">When scanning an NTFS volume, any filename matching (using the <b>\u2212\u2212match<\/b> option) is case\u2212insensitive. This option makes the matching case\u2212sensitive.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212c<\/b>, <b>\u2212\u2212copy<\/b> RANGE<\/p>\n<p style=\"margin-left:22%;\">This wizard\u2019s option will write a block of MFT FILE records to a file. The default file is <i>mft<\/i> which will be created in the current directory. This option can be combined with the <b>\u2212\u2212output<\/b> and <b>\u2212\u2212destination<\/b> options.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212d<\/b>, <b>\u2212\u2212destination<\/b> DIR<\/p>\n<p style=\"margin-left:22%;\">This option controls where to put the output file of the <b>\u2212\u2212undelete<\/b> and <b>\u2212\u2212copy<\/b> options.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212f<\/b>, <b>\u2212\u2212force<\/b><\/p>\n<p style=\"margin-left:22%;\">This will override some sensible defaults, such as not overwriting an existing file. Use this option with caution.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212h<\/b>, <b>\u2212\u2212help<\/b><\/p>\n<p style=\"margin-left:22%;\">Show a list of options with a brief description of each one.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212i<\/b>, <b>\u2212\u2212inodes<\/b> RANGE<\/p>\n<p style=\"margin-left:22%;\">Recover the files with these inode numbers. <i>RANGE<\/i> can be a single inode number, several numbers separated by commas &#8220;,&#8221; or a range separated by a dash &#8220;\u2212&#8221;.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212m<\/b>, <b>\u2212\u2212match<\/b> PATTERN<\/p>\n<p style=\"margin-left:22%;\">Filter the output by only looking for matching filenames. The pattern can include the wildcards \u2019?\u2019, match exactly one character or \u2019*\u2019, match zero or more characters. By default the matching is case\u2212insensitive. To make the search case sensitive, use the <b>\u2212\u2212case<\/b> option.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212O<\/b>, <b>\u2212\u2212optimistic<\/b><\/p>\n<p style=\"margin-left:22%;\">Recover parts of the file even if they are currently marked as in use.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212o<\/b>, <b>\u2212\u2212output<\/b> FILE<\/p>\n<p style=\"margin-left:22%;\">Use this option to set name of output file that <b>\u2212\u2212undelete<\/b> or <b>\u2212\u2212copy<\/b> will create.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212P<\/b>, <b>\u2212\u2212parent<\/b><\/p>\n<p style=\"margin-left:22%;\">Display the parent directory of a deleted file.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212p<\/b>, <b>\u2212\u2212percentage<\/b> NUM<\/p>\n<p style=\"margin-left:22%;\">Filter the output of the <b>\u2212\u2212scan<\/b> option, by only matching files with a certain amount of recoverable content. <b>Please read the caveats section for more details.<\/b><\/p>\n<p style=\"margin-left:11%;\"><b>\u2212q<\/b>, <b>\u2212\u2212quiet<\/b><\/p>\n<p style=\"margin-left:22%;\">Reduce the amount of output to a minimum. Naturally, it doesn\u2019t make sense to combine this option with <b>\u2212\u2212scan<\/b>.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212s<\/b>, <b>\u2212\u2212scan<\/b><\/p>\n<p style=\"margin-left:22%;\">Search through an NTFS volume and print a list of files that could be recovered. This is the default action of <b>ntfsundelete<\/b>. This list can be filtered by filename, size, percentage recoverable or last modification time, using the <b>\u2212\u2212match<\/b>, <b>\u2212\u2212size<\/b>, <b>\u2212\u2212percent<\/b> and <b>\u2212\u2212time<\/b> options, respectively.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The output of scan will be:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">Inode Flags %age Date Time Size Filename <br \/> 6038 FN.. 93% 2002\u221207\u221217 13:42 26629 thesis.doc<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\"> <\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"8%\"><\/td>\n<td width=\"7%\"><\/td>\n<td width=\"85%\"> <\/td>\n<\/tr>\n<\/table>\n<p align=\"center\"><img decoding=\"async\" src=\"grohtml-1092151.png\" alt=\"Image grohtml-1092151.png\"><\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The percentage field shows how much of the file can potentially be recovered.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212S<\/b>, <b>\u2212\u2212size<\/b> RANGE<\/p>\n<p style=\"margin-left:22%;\">Filter the output of the <b>\u2212\u2212scan<\/b> option, by looking for a particular range of file sizes. The range may be specified as two numbers separated by a \u2019\u2212\u2019. The sizes may be abbreviated using the suffixes k, m, g, t, for kilobytes, megabytes, gigabytes and terabytes respectively.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212t<\/b>, <b>\u2212\u2212time<\/b> SINCE<\/p>\n<p style=\"margin-left:22%;\">Filter the output of the <b>\u2212\u2212scan<\/b> option. Only match files that have been altered since this time. The time must be given as number using a suffix of d, w, m, y for days, weeks, months or years ago.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212T<\/b>, <b>\u2212\u2212truncate<\/b><\/p>\n<p style=\"margin-left:22%;\">If <b>ntfsundelete<\/b> is confident about the size of a deleted file, then it will restore the file to exactly that size. The default behaviour is to round up the size to the nearest cluster (which will be a multiple of 512 bytes).<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212u<\/b>, <b>\u2212\u2212undelete<\/b><\/p>\n<p style=\"margin-left:22%;\">Select <b>undelete<\/b> mode. You can specify the files to be recovered using by using <b>\u2212\u2212match<\/b> or <b>\u2212\u2212inodes<\/b> options. This option can be combined with <b>\u2212\u2212output<\/b>, <b>\u2212\u2212destination<\/b>, and <b>\u2212\u2212byte<\/b>.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">When the file is recovered it will be given its original name, unless the <b>\u2212\u2212output<\/b> option is used.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212v<\/b>, <b>\u2212\u2212verbose<\/b><\/p>\n<p style=\"margin-left:22%;\">Increase the amount of output that <b>ntfsundelete<\/b> prints.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212V<\/b>, <b>\u2212\u2212version<\/b><\/p>\n<p style=\"margin-left:22%;\">Show the version number, copyright and license for <b>ntfsundelete<\/b>.<\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Look for deleted files on \/dev\/hda1.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ntfsundelete \/dev\/hda1<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Look for deleted documents on \/dev\/hda1.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ntfsundelete \/dev\/hda1 \u2212s \u2212m \u2019*.doc\u2019<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Look for deleted files between 5000 and 6000000 bytes, with at least 90% of the data recoverable, on \/dev\/hda1.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ntfsundelete \/dev\/hda1 \u2212S 5k\u22126m \u2212p 90<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Look for deleted files altered in the last two days<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ntfsundelete \/dev\/hda1 \u2212t 2d<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Undelete inodes 2, 5 and 100 to 131 of device \/dev\/sda1<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ntfsundelete \/dev\/sda1 \u2212u \u2212i 2,5,100\u2212131<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Undelete inode number 3689, call the file \u2019work.doc\u2019, set it to recovered size and put it in the user\u2019s home directory.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ntfsundelete \/dev\/hda1 \u2212u \u2212T \u2212i 3689 \u2212o work.doc \u2212d ~<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Save MFT Records 3689 to 3690 to a file \u2019debug\u2019<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>ntfsundelete \/dev\/hda1 \u2212c 3689\u22123690 \u2212o debug<\/b><\/p>\n<h2>BUGS <a name=\"BUGS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">There are some small limitations to <b>ntfsundelete<\/b>, but currently no known bugs. If you find a bug please send an email describing the problem to the development team: <br \/> ntfs\u22123g\u2212devel@lists.sf.net<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ntfsundelete<\/b> was written by Richard Russon and Holger Ohmacht, with contributions from Anton Altaparmakov. It was ported to ntfs-3g by Erik Larsson and Jean-Pierre Andre.<\/p>\n<h2>AVAILABILITY <a name=\"AVAILABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ntfsundelete<\/b> is part of the <b>ntfs-3g<\/b> package and is available from: <br \/> http:\/\/www.tuxera.com\/community\/<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>ntfsinfo<\/b>(8), <b>ntfsprogs<\/b>(8)<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  ntfsundelete \u2212 recover a deleted file from an NTFS volume. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,869],"class_list":["post-3766","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-ntfsundelete"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3766"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3766\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}