{"id":752,"date":"2015-05-08T16:51:07","date_gmt":"2015-05-09T01:51:07","guid":{"rendered":"http:\/\/blog.box.kr\/?p=752"},"modified":"2015-05-08T16:51:07","modified_gmt":"2015-05-09T01:51:07","slug":"linux-recover-corrupted-partition-from-a-bad-superblock","status":"publish","type":"post","link":"https:\/\/blog.box.kr\/?p=752","title":{"rendered":"Linux: Recover Corrupted Partition From A Bad Superblock"},"content":{"rendered":"<p style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">Q.<span class=\"Apple-converted-space\">\u00a0<\/span>How can I Recover a bad<span class=\"Apple-converted-space\">\u00a0<\/span><a href=\"http:\/\/www.cyberciti.biz\/tips\/understanding-unixlinux-filesystem-superblock.html\">superblock<\/a><span class=\"Apple-converted-space\">\u00a0<\/span>from a corrupted ext3 partition to get back my data? I&#8217;m getting following error:<\/p>\n<blockquote style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px 12px; padding: 0px 0px 0px 12px; color: #888888; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; border-left-color: #dddddd; border-left-width: 1px; border-left-style: solid; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\"><p>\/dev\/sda2: Input\/output error<br \/>\nmount: \/dev\/sda2: can&#8217;t read superblock<\/blockquote>\n<p style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">How do I fix this error?<br \/>\n<span id=\"more-1429\"><\/span><br \/>\nA.<span class=\"Apple-converted-space\">\u00a0<\/span>Linux ext2\/3 filesystem<span class=\"Apple-converted-space\">\u00a0<\/span><a href=\"http:\/\/www.cyberciti.biz\/tips\/understanding-unixlinux-filesystem-superblock.html\">stores superblock at different backup location<\/a><span class=\"Apple-converted-space\">\u00a0<\/span>so it is possible to get back data from corrupted partition.<\/p>\n<div style=\"background: #fbfbfb; border-width: 1px 1px 1px 10px; border-style: solid; border-color: #aaaaaa #aaaaaa #aaaaaa #b22222; font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px; padding: 2px 0px 2px 0.5em; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; -webkit-text-stroke-width: 0px;\"><img decoding=\"async\" title=\"Warning examples may crash your computer\" src=\"https:\/\/i0.wp.com\/figs.cyberciti.biz\/warning-40px.png?w=623\" alt=\"\" data-recalc-dims=\"1\" \/><strong>WARNING!<\/strong><span class=\"Apple-converted-space\">\u00a0<\/span>Make sure file system is UNMOUNTED.\n<\/div>\n<p style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">If your system will give you a terminal type the following command, else boot Linux system from rescue disk (boot from 1st CD\/DVD. At boot: prompt type command linux rescue).<\/p>\n<h2 style=\"font: 18px\/29px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 36px 0px 12px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">Mount partition using alternate superblock<\/h2>\n<p style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">Find out superblock location for \/dev\/sda2:<br \/>\n<code># dumpe2fs \/dev\/sda2 | grep superblock<\/code><br \/>\nSample output:<\/p>\n<pre>  Primary superblock at 0, Group descriptors at 1-6\n  Backup superblock at 32768, Group descriptors at 32769-32774\n  Backup superblock at 98304, Group descriptors at 98305-98310\n  Backup superblock at 163840, Group descriptors at 163841-163846\n  Backup superblock at 229376, Group descriptors at 229377-229382\n  Backup superblock at 294912, Group descriptors at 294913-294918\n  Backup superblock at 819200, Group descriptors at 819201-819206\n  Backup superblock at 884736, Group descriptors at 884737-884742\n  Backup superblock at 1605632, Group descriptors at 1605633-1605638\n  Backup superblock at 2654208, Group descriptors at 2654209-2654214\n  Backup superblock at 4096000, Group descriptors at 4096001-4096006\n  Backup superblock at 7962624, Group descriptors at 7962625-7962630\n  Backup superblock at 11239424, Group descriptors at 11239425-11239430\n  Backup superblock at 20480000, Group descriptors at 20480001-20480006\n  Backup superblock at 23887872, Group descriptors at 23887873-23887878<\/pre>\n<p style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">Now check and repair a Linux file system using alternate superblock # 32768:<br \/>\n<code># fsck -b 32768 \/dev\/sda2<\/code><br \/>\nSample output:<\/p>\n<pre>fsck 1.40.2 (12-Jul-2007)\ne2fsck 1.40.2 (12-Jul-2007)\n\/dev\/sda2 was not cleanly unmounted, check forced.\nPass 1: Checking inodes, blocks, and sizes\nPass 2: Checking directory structure\nPass 3: Checking directory connectivity\nPass 4: Checking reference counts\nPass 5: Checking group summary information\nFree blocks count wrong for group #241 (32254, counted=32253).\nFix? yes\nFree blocks count wrong for group #362 (32254, counted=32248).\nFix? yes\nFree blocks count wrong for group #368 (32254, counted=27774).\nFix? yes\n..........\n\/dev\/sda2: ***** FILE SYSTEM WAS MODIFIED *****\n\/dev\/sda2: 59586\/30539776 files (0.6% non-contiguous), 3604682\/61059048 blocks\n<\/pre>\n<p style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">Now try to mount file system using mount command:<br \/>\n<code># mount \/dev\/sda2 \/mnt<\/code><br \/>\nYou can also use superblock stored at 32768 to mount partition, enter:<br \/>\n<code># mount sb={alternative-superblock} \/dev\/device \/mnt<br \/>\n# mount sb=32768 \/dev\/sda2 \/mnt<\/code><br \/>\nTry to browse and access file system:<br \/>\n<code># cd \/mnt<br \/>\n# mkdir test<br \/>\n# ls -l<br \/>\n# cp file \/path\/to\/safe\/location<\/code><\/p>\n<p style=\"font: 14px\/24px Arial, 'Helvetica Neue', Helvetica, sans-serif; margin: 0px 0px 24px; padding: 0px; color: #111111; text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; -ms-word-wrap: break-word; widows: 1; font-size-adjust: none; font-stretch: normal; background-color: #ffffff; -webkit-text-stroke-width: 0px;\">You should always keep backup of all important data including configuration files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q.\u00a0How can I Recover a bad\u00a0superblock\u00a0from a corrupted ext3 partition to get back my data? I&#8217;m getting following error: \/dev\/sda2: Input\/output error mount: \/dev\/sda2: can&#8217;t read superblock How do I fix this error? A.\u00a0Linux ext2\/3 filesystem\u00a0stores superblock at different backup location\u00a0so it is possible to get back data from corrupted partition. WARNING!\u00a0Make sure file system is UNMOUNTED. If your system will give you a terminal type the following command, else boot Linux system from rescue disk (boot from 1st CD\/DVD. At boot: prompt type command linux rescue). Mount partition using alternate superblock Find out superblock location for \/dev\/sda2: # dumpe2fs \/dev\/sda2 | grep superblock Sample output: Primary superblock at 0, Group descriptors at 1-6 Backup superblock at 32768, Group descriptors at 32769-32774 Backup superblock at 98304, Group descriptors at 98305-98310 Backup superblock at 163840, Group descriptors at 163841-163846 Backup superblock at 229376, Group descriptors at 229377-229382 Backup superblock at 294912, Group descriptors at 294913-294918 Backup superblock at 819200, Group descriptors at 819201-819206 Backup superblock at 884736, Group descriptors at 884737-884742 Backup superblock at 1605632, Group descriptors at 1605633-1605638 Backup superblock at 2654208, Group descriptors at 2654209-2654214 Backup superblock at 4096000, Group descriptors at 4096001-4096006 Backup superblock at 7962624, Group descriptors [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"ngg_post_thumbnail":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[17,7],"tags":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5q9Zn-c8","jetpack-related-posts":[{"id":754,"url":"https:\/\/blog.box.kr\/?p=754","url_meta":{"origin":752,"position":0},"title":"Repair a broken Ext4 Superblock in Ubuntu","date":"2015-05-08","format":false,"excerpt":"This has happened to me a few times, and it\u2019s not a nice problem to find yourself in. You computer won\u2019t boot, all your filesystem checks tell you you\u2019ve a bad superblock, but you cant seem to find how to fix it. Well, here goes\u00a0:) This guide is for ext4\u2026","rel":"","context":"In &quot;Linux&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":660,"url":"https:\/\/blog.box.kr\/?p=660","url_meta":{"origin":752,"position":1},"title":"[Linux] \/dev\/sdc1 is apparently in use by the system; will not make a filesystem here!","date":"2015-04-12","format":false,"excerpt":"Centos \uc124\uce58 \ud558\uace0 HDD\ub97c \uc2e0\uaddc\ub85c INSTALL \ud560\ub54c fdisk \uae4c\uc9c0 \uc798 \ub410\ub294\ub370 \uc544\ub798\uc640 \uac19\uc740 \uc624\ub958 \ubc1c\uc0dd [root@localhost ~]# mkfs.ext4 \/dev\/sdb1 mke2fs 1.42.9 (28-Dec-2013) \/dev\/sdc1 is apparently in use by the system; will not make a filesystem here! \uc624\ub958 \ub0b4\uc6a9\uc744 \ubcf4\uba74 \ud574\ub2f9 \ub514\uc2a4\ud06c\uac00 \uc0ac\uc6a9\uc911\uc774\ub780\ub2e4.. \uc544.. ghost\uac00 \uc788\ub098? \uc5f4\uc2ec\ud788 \ucc3e\uc544 \ubcf8 \uacb0\uacfc\u00a0 Disk\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":826,"url":"https:\/\/blog.box.kr\/?p=826","url_meta":{"origin":752,"position":2},"title":"[scrap]50 UNIX \/ Linux Sysadmin Tutorials","date":"2015-05-20","format":false,"excerpt":"http:\/\/www.thegeekstuff.com\/2010\/12\/50-unix-linux-sysadmin-tutorials\/ \u00a0 Merry Christmas and Happy Holidays to all TGS Readers. To wrap this year, I\u2019ve collected 50 UNIX \/ Linux sysadmin related tutorials that we\u2019ve posted so far. This is lot of reading. Bookmark this article for your future reference and read it whenever you get free time. Disk\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":137,"url":"https:\/\/blog.box.kr\/?p=137","url_meta":{"origin":752,"position":3},"title":"How to set default session timeout in Linux","date":"2014-06-24","format":false,"excerpt":"How to set default session timeout in Linux My DC operation guys access Linux servers on a daily basis but somehow they never remember to log out. This is a security risk as anyone could gain access to the open console and create caos. Today, yet again I\u2019m forced to\u2026","rel":"","context":"In &quot;\ucc38\uace0\ub97c \uc704\ud55c \uc800\uc7a5\ubb3c&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":849,"url":"https:\/\/blog.box.kr\/?p=849","url_meta":{"origin":752,"position":4},"title":"[scrap]Introduction to Apache Cassandra&#039;s Architecture","date":"2015-05-20","format":false,"excerpt":"http:\/\/java.dzone.com\/articles\/introduction-apache-cassandras?utm_content=bufferb199d&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer \u00a0 Introduction An Introduction To NoSQL & Apache Cassandra, introduced us to various types of NoSQL database and Apache Cassandra. In this article I am going to delve into Cassandra\u2019s Architecture. Cassandra is a peer-to-peer distributed database that runs on a cluster of homogeneous nodes. Cassandra has been architected\u2026","rel":"","context":"In &quot;\uae30\uc220&quot;","img":{"alt_text":"Cassandra Ring","src":"https:\/\/i0.wp.com\/abiasforaction.net\/wp-content\/uploads\/2015\/01\/Cassandra-Ring.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":538,"url":"https:\/\/blog.box.kr\/?p=538","url_meta":{"origin":752,"position":5},"title":"[\ud38c]\uac00\uc0c1\uba38\uc2e0\uc5d0 Android \uc124\uce58 \ud558\uc5ec adb \uc5f0\uacb0 \ud558\uae30","date":"2015-01-05","format":false,"excerpt":"1. VMWare\uac74 VirtualBox\uac74 \uc0c1\uad00\uc5c6\ub2e4. VM\ud638\uc2a4\ud2b8\ub97c \uc900\ube44\ud558\uc790. 2.\u00a0http:\/\/www.android-x86.org\/download \ub85c \uac00\uc11c\u00a0Deprecated x86 2.2 generic\u00a0\uc744 \ubc1b\uc790. Q) \uc65c Deprecated \uc778 2.2 generic \uc744 \ubc1b\ub098\uc694. Deprecated\ub294 \uc4f0\uba74 \uc548\ub418\ub294 \uac70 \uc544\ub2d8? A) http:\/\/mariuz.android-dev.ro\/vm.iso.7z \ub3c4 \uc788\ub2e4\uace0 \ud55c\ub2e4.\u00a0http:\/\/www.android-x86.org\/download \uc5d0 \uc788\ub294 \uc694\uc998 \uac83\ub4e4\uc740 \uc8c4\ub2e4 \uc548\ub41c\ub2e4. 3. \uc8c4\ub2e4 \uc77c\ub2e8 Default \uc124\uc815\uc5d0 yes yes \ud558\uace0 \uc124\uce58\ud55c\ub2e4. \ud55c\uae00 \ubb38\uc11c\uac00 \ud544\uc694\ud55c \ubd84\uc740\u2026","rel":"","context":"In &quot;\uae30\uc220\uc790\ub8cc&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/1.bp.blogspot.com\/-R8uOK6LYepI\/T0ad0iQ_IPI\/AAAAAAAAFJY\/YuMYSVCsToA\/s320\/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA+2012-02-24+%E1%84%8B%E1%85%A9%E1%84%8C%E1%85%A5%E1%86%AB+5.12.04.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/752"}],"collection":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=752"}],"version-history":[{"count":0,"href":"https:\/\/blog.box.kr\/index.php?rest_route=\/wp\/v2\/posts\/752\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.box.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}