{"id":322,"date":"2009-04-22T07:26:29","date_gmt":"2009-04-21T21:26:29","guid":{"rendered":"http:\/\/nsrd.wordpress.com\/?p=322"},"modified":"2018-12-12T16:20:32","modified_gmt":"2018-12-12T06:20:32","slug":"recovering-with-scanner-and-uasm","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2009\/04\/22\/recovering-with-scanner-and-uasm\/","title":{"rendered":"Recovering with scanner and uasm"},"content":{"rendered":"<p>There are some types of recoveries that fall into the &#8220;last ditch effort&#8221; category \u2013 everything else has been tried, but the data just won&#8217;t come back. I would have to say that in 99.99% of cases this is due to one of the following two things:<\/p>\n<ol>\n<li>The data was never properly backed up in the first place.<\/li>\n<li>Cloning wasn&#8217;t done, and the only piece of media that holds a particular backup is broken.<\/li>\n<\/ol>\n<p>Assuming the data was actually backed up, as a last thing to try*, you <em>can<\/em> recover <strong>filesystem<\/strong> data using scanner and uasm. This is documented in the man page for scanner \u2013 and also available as a PDF to Windows administrators in the command reference guide.<\/p>\n<p>As per the man page, the way of running scanner and uasm to facilitate a recovery is as follows:<\/p>\n<pre># scanner -S ssid device | uasm -r -v -m \/source=\/dest<\/pre>\n<p>or, if you prefer to avoid using the pipe,<\/p>\n<pre># scanner -S ssid device -x uasm -r -v -m \/source=\/dest<\/pre>\n<p>Where in each of those commands:<\/p>\n<ul>\n<li>ssid is the saveset ID you want to recover from<\/li>\n<li>device is the path to the device where the volume holding that saveset can be accessed<\/li>\n<li>\/source is the source path you&#8217;re recovering that you want to replace with:<\/li>\n<li>\/dest is the replacement to the source path<\/li>\n<\/ul>\n<p>Out of these, probably the &#8220;\/source&#8221; and &#8220;\/dest&#8221; makes the least sense, until you see an example.<\/p>\n<p>Say for instance you have a backup of &#8220;\/home&#8221; that you want to recover this way. Chances are, you <em>don&#8217;t<\/em> want to recover it on top of an existing \/home; thus, you&#8217;d use &#8220;-m \/home=\/tmp\/recovery&#8221;, or something like that. This instructs uasm to replace the &#8220;\/home&#8221; path in the incoming data stream with &#8220;\/tmp\/recovery&#8221; when writing the data back out.<\/p>\n<p>However, it&#8217;s not just a saveset ID argument that scanner takes in this mode; in fact, you can pass through most arguments in relation to restricting what is scanned \u2013 that is, clients, saveset names, and even file\/record numbers.<\/p>\n<p>If you&#8217;re dealing with potentially damaged media, the file\/record numbers can sometimes be your saving grace. Say you&#8217;re doing a recovery and mid-way through the recovery NetWorker aborts saying there&#8217;s an error at file number 33 on the tape. At this point, y<a title=\"The importance of having a clone\" href=\"https:\/\/nsrd.info\/blog\/2009\/01\/29\/how-important-is-it-to-clone\/\" target=\"_blank\">ou should at this point have a clone. Honestly, you really, really should have a clone<\/a>.<\/p>\n<p>Assuming though that for some reason you don&#8217;t have a clone, there&#8217;s a good chance your data is hosed** \u2013 <em>recover<\/em>, <em>nwrecover<\/em>, <em>winworkr<\/em> are not going to get you past that point.<\/p>\n<p>Scanner <em>might<\/em>. There&#8217;s no guarantee, but it <em>might<\/em>. If the media error is limited to just a single portion of the tape, you may find that you can run a scanner\/uasm combination that starts at the next file marker and <strong>hope<\/strong> that it gets your data back. Assuming we&#8217;re needing to get \/home back for the client &#8216;baal&#8217; on \/dev\/nst0***, this would make the command<\/p>\n<pre># scanner -c baal -N \/home -f 34 \/dev\/nst0 | uasm -r -v -m \/home=\/tmp\/recovery<\/pre>\n<p>If you need to get even more data back, you could even use a starting record number. Say the recovery failed at file number 33, media record 1138; you might try the following:<\/p>\n<pre># scanner -c baal -N \/home -f 33 -r 1139 \/dev\/nst0 | uasm -r -v -m \/home=\/tmp\/recovery<\/pre>\n<p>However, in each case, remember that the extent to which scanner and uasm will be able to recover your data will be limited to the amount of physical damage on the tape.<\/p>\n<p>As I mentioned before, there&#8217;s no guarantees scanner is going to &#8230; ahem, save your bacon &#8230; if things have reached this point \u2013 but, what is there to lose by trying?<\/p>\n<p>&#8212;<br \/>\n* This is also a valid technique where you have a decommissioned server and you just need to urgently pull back a few files without doing a full rebuild.<\/p>\n<p>** And it&#8217;s not NetWorker&#8217;s fault of media or devices go bad, and it&#8217;s the only copy of the data!<\/p>\n<p>*** If you&#8217;re needing to do this because of a media failure, make sure you use a different tape drive for your &#8220;last attempt&#8221;, just in case it was the tape drive that caused the failure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are some types of recoveries that fall into the &#8220;last ditch effort&#8221; category \u2013 everything else has been tried,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[16],"tags":[685,788,1252,862,1035,1109],"class_list":["post-322","post","type-post","status-publish","format-standard","hentry","category-networker","tag-nwrecover","tag-recover","tag-recovery","tag-scanner","tag-uasm","tag-winworkr"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-5c","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/comments?post=322"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/322\/revisions"}],"predecessor-version":[{"id":7669,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/322\/revisions\/7669"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}