{"id":4997,"date":"2021-02-25T23:53:58","date_gmt":"2021-02-25T23:53:58","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=4997"},"modified":"2021-02-25T23:53:58","modified_gmt":"2021-02-25T23:53:58","slug":"qnap-ghost-snapshot-thin-pool-repairing","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/qnap-ghost-snapshot-thin-pool-repairing","title":{"rendered":"QNAP Ghost snapshot thin pool repairing"},"content":{"rendered":"<p><strong>Check metadata:<\/strong><\/p><p><strong>Please use thin_check to check the metadata of the pool to confirm what wrongs in the metadata.<\/strong><\/p><p>pdata_tools_8192( or 4096) thin_check \/dev\/mapper\/vg1-tp1_tmeta &#8211;non<\/p><p># Assume the ghost snapshot happen in vg1\/tp1. Please according to happened ghost snapshot pool to adjust vg${#}<\/p><p>-tp${#}_tmetadata<\/p><p># if the firmware version of QTS is less than 4.3.5, please remove &#8220;&#8211;non&#8221; option<\/p><p><strong>Generally, the metadata has the below wrong:<\/strong><\/p><p><img loading=\"lazy\" decoding=\"async\" width=\"1017\" height=\"722\" class=\"wp-image-4998 img-responsive\" src=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2021\/02\/word-image.jpg\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2021\/02\/word-image.jpg 1017w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2021\/02\/word-image-300x213.jpg 300w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2021\/02\/word-image-768x545.jpg 768w\" sizes=\"auto, (max-width: 1017px) 100vw, 1017px\" \/><\/p><p><strong>If the metadata has no such as above wrong, please contact sustain team to analyze.<\/strong><\/p><p><strong>Backup metadata before repairing the metadata:<\/strong><\/p><p><strong>Caution!!! This is very important task!!!<\/strong><\/p><p><strong>Please must make a backup of the metadata to avoid the repairing task fail.<\/strong><\/p><p><strong>If the repairing task fail, the storage may crash. We can use the backup metadata to restore the storage.<\/strong><\/p><p><strong>Please use the below guide to make the backup of metadata:<\/strong><\/p><p><a href=\"https:\/\/drive.google.com\/file\/d\/14HSVV6DWSnqc7FXTSUukzJWB812Q8Tkv\/view?usp=sharing\"><strong>https:\/\/drive.google.com\/file\/d\/14HSVV6DWSnqc7FXTSUukzJWB812Q8Tkv\/view?usp=sharing<\/strong><\/a><\/p><p><strong>Repairing flow and limitations:<\/strong><\/p><p><strong>Limitations:<\/strong><\/p><p><strong>If the storage configuration and QTS firmware versions can not meet the following condition, please contact sustain team to do repairing task.<\/strong><\/p><p>1. The QTS firmware version is great or equal than 4.3.5.<\/p><p>2. The chunk size of the metadata need to be 8192. Please use the below command to confirm.<\/p><p>echo $((16#`hexdump -s 340 -n 2 \/dev\/mapper\/vg1-tp1_tmeta | awk &#8216;NR==1{print $2}&#8217;`*512))<\/p><p><strong>Repairing steps:<\/strong><\/p><p><strong>Step 1: Download &#8220;pdata_tools&#8221; which support thin_rebuild option from the below link and transfer new &#8220;pdata_tools&#8221; to the NAS.<\/strong><\/p><p># Download<\/p><p><a href=\"http:\/\/download.qnap.com\/Storage\/tsd\/utility\/pdata_tools_X86_64.zip\">wget http:\/\/download.qnap.com\/Storage\/tsd\/utility\/pdata_tools_X86_64.zip # X86_64 version<\/a><a href=\"http:\/\/download.qnap.com\/Storage\/tsd\/utility\/pdata_tools_ARM_64.zip\"> wget http:\/\/download.qnap.com\/Storage\/tsd\/utility\/pdata_tools_ARM_64.zip # ARM_64 version<\/a><\/p><p># Unzip<\/p><p>unzip pdata_tools_X86_64.zip unzip pdata_tools_ARM_64.zip<\/p><p># Please rename to pdata_tools<\/p><p>mv pdata_tools_X86_64 pdata_tools mv pdata_tools_ARM_64 pdata_tools<\/p><p><strong>Step 2: Change &#8220;pdata_tools&#8221; to executable file.<\/strong><\/p><p>chmod +x pdata_tools<\/p><p><strong>Step 3: Run pdata_tools with thin_rebuild option.<\/strong><\/p><p>.\/pdata_tools thin_rebuild \/dev\/mapper\/vg1-tp1_tmeta # This process will execute about couple minutes or hours. Please wait for the process done patiently.<\/p><p><strong>Step 4: Use thin_check to check metadata again to confirm the &#8220;reference counts&#8221; wrongs are all fixed. If the result of thin_check still has wrongs, please contact sustain team to do the repairing task.<\/strong><\/p><p>.\/pdata_tools thin_check &#8211;clear-needs-check-flag \/dev\/mapper\/vg1-tp1_tmeta<\/p><p><strong>Step 5: Restore the storage:<\/strong><\/p><p>lvchange -ay vg1 # bring up the volume group storage_util &#8211;sys_startup_p2 # mount all of volumes<\/p><p>\/sbin\/daemon_mgr lvmetad start &#8220;\/sbin\/lvmetad&#8221; # enable lvm cache<\/p><p>\/etc\/init.d\/services.sh start # start up all of services<\/p><p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Check metadata:Please use thin_check to check the metadata of the pool to confirm what wrongs in the metadata.pdata_tools_8192( or 4096) thin_check \/dev\/mapper\/vg1-tp1_tmeta &#8211;non# Assume the ghost snapshot [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3450,3449],"class_list":["post-4997","post","type-post","status-publish","format-standard","hentry","category-research","tag-ghost-snapshot-thin-pool-repairing","tag-qnap"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/4997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=4997"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/4997\/revisions"}],"predecessor-version":[{"id":4999,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/4997\/revisions\/4999"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=4997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=4997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=4997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}