{"id":1136,"date":"2024-06-30T11:45:39","date_gmt":"2024-06-30T11:45:39","guid":{"rendered":"https:\/\/starscape-experiences.space\/?p=1136"},"modified":"2024-06-30T11:45:39","modified_gmt":"2024-06-30T11:45:39","slug":"microsd-crash-on-pi4-kernel-panic-vfs-unable-to-mount-root-fs-on-unknown-block-1792","status":"publish","type":"post","link":"https:\/\/starscape-experiences.space\/index.php\/2024\/06\/30\/microsd-crash-on-pi4-kernel-panic-vfs-unable-to-mount-root-fs-on-unknown-block-1792\/","title":{"rendered":"MicroSD crash on Pi4 &#8211; Kernel Panic: VFS : Unable to mount root fs on unknown-block (179,2)"},"content":{"rendered":"\n<p>Yesterday evening I was surprised to discover that my <a href=\"https:\/\/starscape-experiences.space\/index.php\/2022\/12\/03\/setting-up-astroberry-on-raspberry-pi4-and-custom-software-and-hardware\/\" title=\"\">Astroberry Pi4<\/a> wouldn&#8217;t connect to the wifi or wired network anymore. This morning I finally managed to connect it to a monitor and the wonderful message <strong>Kernel Panic: VFS : <em>Unable to mount root fs on unknown-block (179<\/em>,<em>2<\/em>)<\/strong> appeared while booting. It appears a corrupt filesystem causes this and the boot partition (\/dev\/sdb1) cannot access partition 2 (data &#8211; found in \/dev\/sdb2). In my case, the cause could be the frequent power outages we experience here. After a few hours of searching for solutions that did not involve formatting and losing my data, I came across this simple trick that requires access to a Linux machine. On my Windows machine, I have an Oracle VM Virtual Box running an older Ubuntu on it. Then I used <strong>fsck <\/strong>and <strong>e2fsck <\/strong>to fix by sdb1 (boot) and sdb2 (data) partitions on the microSD. Here are my details and steps:<\/p>\n\n\n\n<p><strong>microSD card<\/strong>: SanDisk Extreme 256GB<\/p>\n\n\n\n<p><strong>OS<\/strong>: Astroberry 2.0.4.<\/p>\n\n\n\n<p><strong>Steps to fix the error <\/strong>and proceed to normal boot:<\/p>\n\n\n\n<ul>\n<li>Start Linux (I started a VM running Ubuntu on Virtual Box).<\/li>\n\n\n\n<li>Insert microSD (directly or through an SD adapter) into the PC running Linux.<\/li>\n\n\n\n<li>Run <code>sudo fdisk -l<\/code> to list all mounted disks.<\/li>\n\n\n\n<li>You should see <em>\/dev\/sdb1<\/em> appear. This is the boot partition on your microSD card. If <em>\/dev\/sdb2<\/em> does not show up mount it using <code>mount \/dev\/sdb2<\/code>.<\/li>\n\n\n\n<li>Running again<code> sudo fdisk  -l<\/code> will display all mounted drives now:<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"479\" height=\"332\" src=\"https:\/\/starscape-experiences.space\/wp-content\/uploads\/2024\/06\/image.png\" alt=\"\" class=\"wp-image-1137\" style=\"width:514px;height:auto\" srcset=\"https:\/\/starscape-experiences.space\/wp-content\/uploads\/2024\/06\/image.png 479w, https:\/\/starscape-experiences.space\/wp-content\/uploads\/2024\/06\/image-300x208.png 300w\" sizes=\"(max-width: 479px) 100vw, 479px\" \/><\/figure><\/div>\n\n\n<ul>\n<li>Both partitions (sdb1 and sdb2) must be fixed. For this first unmount the partitions using <code>sudo umount \/dev\/sdb1<\/code> followed by <code>sudo umount \/dev\/sdb2<\/code>.  \/dev\/sdb1 is fixed using <em>fsck <\/em>while sdb2 is fixed using <em>e2fsck <\/em>(as it is ext4). Run the following commands in order and answer <em>yes <\/em>to all questions: <code>sudo fsck -f -v \/dev\/sdb1<\/code> followed by <code>sudo e2fsck -f -v \/dev\/sdb2<\/code>. In my case, the issues were with the <em>sdb2 <\/em>partition as it contained lost inodes as well as free inods count wrong for certain groups. <\/li>\n\n\n\n<li>Finally, take out the microSD card from the Linux machine and plug it back into the Pi4. Boot the device and the Astroberry will start without any issues. <\/li>\n<\/ul>\n\n\n\n<p>Some posts suggested updating the cmdline.txt file on the boot partition. You can access it once Windows detects the microSD card and opens its contents in explorer. In my case this was unnecessary. The above steps solved the issue.<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style1 like-1136 jlk' href='javascript:void(0)' data-task='like' data-post_id='1136' data-nonce='8aec206929' rel='nofollow'><img class='wti-pixel' src='https:\/\/starscape-experiences.space\/wp-content\/plugins\/wti-like-post\/images\/pixel.gif' title='Like' \/><span class='lc-1136 lc'>0<\/span><\/a><\/div><\/div> <div class='status-1136 status align-left'><\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Yesterday evening I was surprised to discover that my Astroberry Pi4 wouldn&#8217;t connect to the wifi or wired network anymore.<\/p>\n<p><a href=\"https:\/\/starscape-experiences.space\/index.php\/2024\/06\/30\/microsd-crash-on-pi4-kernel-panic-vfs-unable-to-mount-root-fs-on-unknown-block-1792\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\">MicroSD crash on Pi4 &#8211; Kernel Panic: VFS : Unable to mount root fs on unknown-block (179,2)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1137,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[9],"tags":[181,179,177,48,180],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/posts\/1136"}],"collection":[{"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/comments?post=1136"}],"version-history":[{"count":2,"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/posts\/1136\/revisions"}],"predecessor-version":[{"id":1141,"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/posts\/1136\/revisions\/1141"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/media\/1137"}],"wp:attachment":[{"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/media?parent=1136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/categories?post=1136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/starscape-experiences.space\/index.php\/wp-json\/wp\/v2\/tags?post=1136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}