{"id":186,"date":"2021-06-18T17:28:13","date_gmt":"2021-06-18T17:28:13","guid":{"rendered":"https:\/\/systemsmedic.net\/?p=186"},"modified":"2024-10-30T16:46:10","modified_gmt":"2024-10-30T16:46:10","slug":"centos-5-root-password-break-during-the-file-system-unexpected-inconsistency","status":"publish","type":"post","link":"https:\/\/systemsmedic.net\/index.php\/2021\/06\/18\/centos-5-root-password-break-during-the-file-system-unexpected-inconsistency\/","title":{"rendered":"Centos 5 root Password break during the file system unexpected inconsistency."},"content":{"rendered":"\n<p>Today we had an issue with one of our database servers hosted in a VMware cluster. Database (mysql) is running on Centos 5 operating system. We were asked to check the VM due to application failure. I was able to see the below error in the VM console.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"928\" height=\"381\" src=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h43_46.png\" alt=\"\" class=\"wp-image-187\" srcset=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h43_46.png 928w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h43_46-300x123.png 300w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h43_46-768x315.png 768w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h43_46-600x246.png 600w\" sizes=\"auto, (max-width: 928px) 100vw, 928px\" \/><\/figure>\n\n\n\n<p>Seems it had been hanged because of the out of memory. I performed a reboot to see if it came to normal state. Unfortunately, It didn\u2019t boot into the OS saying file system inconsistency and needed to enter the maintenance mode to run the manual file system check.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"863\" height=\"418\" src=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h44_55.png\" alt=\"\" class=\"wp-image-188\" style=\"width:796px;height:386px\" srcset=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h44_55.png 863w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h44_55-300x145.png 300w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h44_55-768x372.png 768w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h44_55-600x291.png 600w\" sizes=\"auto, (max-width: 863px) 100vw, 863px\" \/><\/figure>\n\n\n\n<p>Big problem was no one has the root password because this is a bit older legacy environment which is not updated. Finally, the option was breaking the root password.<\/p>\n\n\n\n<p>&nbsp;I tried multiple ways to boot the kernel into single user mode, but nothing helped. After change the kernel into boot as single user mode it\u2019s stop in same place as figure 1.1<\/p>\n\n\n\n<p>Finally, I tried the option below.<\/p>\n\n\n\n<p>1.&nbsp; &nbsp; &nbsp; <strong>Set the VMware boot delay by editing the VM\u2019s setting<\/strong>  <em>[set it to 10000 (10sec)]<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"501\" src=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_00.png\" alt=\"\" class=\"wp-image-189\" style=\"width:814px;height:436px\" srcset=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_00.png 935w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_00-300x161.png 300w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_00-768x412.png 768w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_00-600x321.png 600w\" sizes=\"auto, (max-width: 935px) 100vw, 935px\" \/><\/figure>\n\n\n\n<p>2.&nbsp; &nbsp; &nbsp; <strong>Interrupt the boot pressing arrow keys<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"888\" height=\"411\" src=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_06.png\" alt=\"\" class=\"wp-image-190\" srcset=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_06.png 888w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_06-300x139.png 300w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_06-768x355.png 768w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h45_06-600x278.png 600w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><\/figure>\n\n\n\n<p>Once you get to the above page select the Kernel entry (2<sup>nd<\/sup> row) hit the <strong>\u201ce\u201d to edit the boot loader<\/strong>.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"687\" height=\"143\" src=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h55_18.png\" alt=\"\" class=\"wp-image-192\" srcset=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h55_18.png 687w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h55_18-300x62.png 300w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h55_18-600x125.png 600w\" sizes=\"auto, (max-width: 687px) 100vw, 687px\" \/><\/figure>\n\n\n\n<p>Normally you will see nothing after the <strong>rhgb quiet<\/strong>. In my case I had to type <strong><em>single fastboot <\/em><\/strong>to get me in to the single user mode.<\/p>\n\n\n\n<p>After editing press Enter to accept the editing part and hit \u201cb\u201d to boot using that single user mode (runlevel 1). Then you can see as below. There is the shell to type the <strong><em>passwd<\/em><\/strong> to reset the root password.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1003\" height=\"625\" src=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h57_12.png\" alt=\"\" class=\"wp-image-193\" srcset=\"https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h57_12.png 1003w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h57_12-300x187.png 300w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h57_12-768x479.png 768w, https:\/\/systemsmedic.net\/wp-content\/uploads\/2021\/06\/2021-06-18_22h57_12-600x374.png 600w\" sizes=\"auto, (max-width: 1003px) 100vw, 1003px\" \/><\/figure>\n\n\n\n<p>Once confirmed the password change type <strong>reboot to boot the VM. Sometime when we used fastboot kernel might get panic during the reboot. If something goes wrong, please reset the VM using VMware power operation.<\/strong><\/p>\n\n\n\n<p><strong>Then I was able to enter the maintained mode and run below command to check the file system.<\/strong><\/p>\n\n\n\n<p><strong>FSCK -y&nbsp;&nbsp; &lt;enter this command 2, 3 times &gt;<\/strong><\/p>\n\n\n\n<p>Then VM was successfully booted into login screen.<\/p>\n\n\n\n<p>Thanks for reading. Stay safe!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we had an issue with one of our database servers hosted in a VMware cluster. Database (mysql) is running on Centos 5 operating system. We were asked to check the VM due to application failure. I was able to see the below error in the VM console.&nbsp; Seems it had been hanged because of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":487,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos"],"_links":{"self":[{"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":3,"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":480,"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/posts\/186\/revisions\/480"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/media\/487"}],"wp:attachment":[{"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systemsmedic.net\/index.php\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}