{"id":3367,"date":"2022-12-20T17:02:28","date_gmt":"2022-12-20T20:02:28","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/btrfsrestore-man8\/"},"modified":"2022-12-20T17:02:28","modified_gmt":"2022-12-20T20:02:28","slug":"btrfsrestore-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/btrfsrestore-man8\/","title":{"rendered":"BTRFS&minus;RESTORE (man8)"},"content":{"rendered":"<h1 align=\"center\">BTRFS\u2212RESTORE<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#EXIT STATUS\">EXIT STATUS<\/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\">btrfs-restore \u2212 try to restore files from a damaged btrfs filesystem image<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>btrfs restore<\/b> [options] <i><device> <path><\/i> | \u2212l <i><device><\/i><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i><b>btrfs restore<\/b><\/i> is used to try to salvage files from a damaged filesystem and restore them into <i><path><\/i> or just list the subvolume tree roots. The filesystem image is not modified.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the filesystem is damaged and cannot be repaired by the other tools (<b>btrfs\u2212check<\/b>(8) or <b>btrfs\u2212rescue<\/b>(8)), <b>btrfs restore<\/b> could be used to retrieve file data, as far as the metadata are readable. The checks done by restore are less strict and the process is usually able to get far enough to retrieve data from the whole filesystem. This comes at a cost that some data might be incomplete or from older versions if they\u2019re available.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">There are several options to attempt restoration of various file metadata type. You can try a dry run first to see how well the process goes and use further options to extend the set of restored metadata.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For images with damaged tree structures, there are several options to point the process to some spare copy.<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><b><big>Note<\/big><\/b> <br \/> It is recommended to read the following btrfs wiki page if your data is not salvaged with default option: <b><font color=\"#0000FF\">https:\/\/btrfs.wiki.kernel.org\/index.php\/Restore<\/font><\/b><\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212s|\u2212\u2212snapshots<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">get also snapshots that are skipped by default<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212x|\u2212\u2212xattr<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">get extended attributes<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212m|\u2212\u2212metadata<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">restore owner, mode and times for files and directories<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212S|\u2212\u2212symlinks<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">restore symbolic links as well as normal files<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212i|\u2212\u2212ignore\u2212errors<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">ignore errors during restoration and continue<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212o|\u2212\u2212overwrite<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">overwrite directories\/files in <i><path><\/i>, eg. for repeated runs<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212t <i><bytenr><\/i><\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">use <i><bytenr><\/i> to read the root tree<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212f <i><bytenr><\/i><\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">only restore files that are under specified subvolume root pointed by <i><bytenr><\/i><\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212u|\u2212\u2212super <i><mirror><\/i><\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">use given superblock mirror identified by <i><mirror><\/i>, it can be 0,1 or 2<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212r|\u2212\u2212root <i><rootid><\/i><\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">only restore files that are under a specified subvolume whose objectid is <i><rootid><\/i><\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212d<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">find directory<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212l|\u2212\u2212list\u2212roots<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">list subvolume tree roots, can be used as argument for <i>\u2212r<\/i><\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212D|\u2212\u2212dry\u2212run<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">dry run (only list files that would be recovered)<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212\u2212path\u2212regex <i><regex><\/i><\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">restore only filenames matching a regular expression (<b>regex<\/b>(7)) with a mandatory format<\/font><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><font color=\"#000000\"><b>^\/(|home(|\/username(|\/Desktop(|\/.*))))$<\/b><\/font><\/big><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><big><font color=\"#000000\">The format is not very comfortable and restores all files in the directories in the whole path, so this is not useful for restoring single file in a deep hierarchy.<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212c<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">ignore case (\u2212\u2212path\u2212regex only)<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212v|\u2212\u2212verbose<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">(deprecated) alias for global <i>\u2212v<\/i> option<\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\"><b>Global options<\/b><\/font><\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\">\u2212v|\u2212\u2212verbose<\/font><\/big><\/p>\n<p style=\"margin-left:17%;\"><big><font color=\"#000000\">be verbose and print what is being restored<\/font><\/big><\/p>\n<h2>EXIT STATUS <a name=\"EXIT STATUS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\"><b>btrfs restore<\/b> returns a zero exit status if it succeeds. Non zero is returned in case of failure.<\/font><\/big><\/p>\n<h2>AVAILABILITY <a name=\"AVAILABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\"><b>btrfs<\/b> is part of btrfs\u2212progs. Please refer to the btrfs wiki<\/font> <b><font color=\"#0000FF\">http:\/\/btrfs.wiki.kernel.org<\/font><\/b> <font color=\"#000000\">for further details.<\/font><\/big><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><font color=\"#000000\"><b>mkfs.btrfs<\/b>(8), <b>btrfs\u2212rescue<\/b>(8), <b>btrfs\u2212check<\/b>(8)<\/font><\/big><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  btrfs-restore \u2212 try to restore files from a damaged btrfs filesystem image <\/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,495,4],"class_list":["post-3367","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-btrfs-restore","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3367","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=3367"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3367\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}