<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Repairs on mapletree.moe</title><link>https://mapletree.moe/tags/repairs/</link><description>Recent content in Repairs on mapletree.moe</description><generator>Hugo -- 0.160.1</generator><language>en-us</language><copyright>This work is licensed under the MIT0 License.</copyright><lastBuildDate>Sun, 16 Aug 2015 00:00:00 -0500</lastBuildDate><atom:link href="https://mapletree.moe/tags/repairs/index.xml" rel="self" type="application/rss+xml"/><item><title>Ubiquiti EdgeRouter Lite SquashFS Block Read Error: Part 1</title><link>https://mapletree.moe/posts/ubnt-erl-squashfs-read-error/</link><pubDate>Sun, 16 Aug 2015 00:00:00 -0500</pubDate><author>bakayuki</author><guid>https://mapletree.moe/posts/ubnt-erl-squashfs-read-error/</guid><description>&amp;lt;no value&amp;gt;</description><content type="text/html" mode="escaped"><![CDATA[<p><strong>EDIT (2018/12/09):</strong> <em>Part 2 was never written, but this is actually a fairly
common issue with EdgeRouter Lites. A simple Google search should turn up the
EdgeRouter Emergency Recovery Kit GitHub, and that plus some posts on the UBNT
forums should help you solve the problem. Sorry about my inability to deliver
on what I mention in my posts.</em></p>
<h1 id="problem-description">Problem Description<a href="#problem-description" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>Upon booting the EdgeRouter Lite, the system will not boot. Connecting to
console reveals the following log:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-txt" data-lang="txt"><span class="line"><span class="cl">SQUASHFS error: zlib_inflate error, data probably corrupt
</span></span><span class="line"><span class="cl">SQUASHFS error: squashfs_read_data failed to read block 0x1b4574
</span></span><span class="line"><span class="cl">SQUASHFS error: Unable to read fragment cache entry [1b4574]
</span></span><span class="line"><span class="cl">SQUASHFS error: Unable to read page, block 1b4574, size 8519
</span></span><span class="line"><span class="cl">SQUASHFS error: Unable to read fragment cache entry [1b4574]
</span></span><span class="line"><span class="cl">SQUASHFS error: Unable to read page, block 1b4574, size 8519
</span></span></code></pre></div><p>This can be caused by an unclean shutdown, which could potentially occur with a
power failure. Due to the failure, parts of the internal ext3 filesystem
become corrupted, which causes the inability to load the SquashFS partition
which contains EdgeOS. The end result, of course, is a non-functional unit.</p>
<h1 id="problem-severity">Problem Severity<a href="#problem-severity" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>There are four potential levels to determining the severity of this issue:</p>
<ul>
<li>Can the filesystem be salvaged by fscking the ext3 partition until it is
salvageable? (<strong>Severity:</strong> Annoying.)</li>
<li>If the answer to the above is no, can the flash drive be saved by zeroing
out the device and writing a new filesystem to it? (<strong>Severity:</strong> Hardware
issue - End user repair possible..)</li>
<li>If the answer to the above is no, is the device capable of booting? If yes,
it is possible you may be suffering from the <a href="https://community.ubnt.com/t5/EdgeMAX/EdgeRouter-LITE-OS-and-hardware-problems/td-p/667557">EdgeRouter Lite RAM issue</a>. (
<strong>Severity:</strong> Hardware issue - RMA the device.)</li>
<li>If the answer to the above is no, is the device under warranty? If yes,
(<strong>Severity:</strong> Hardware issue - RMA the device.) If no, (<strong>Severity:</strong> Device
Replacement.)</li>
</ul>
<h1 id="problem-resolution">Problem Resolution<a href="#problem-resolution" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p>Resolutions will be broken down into two posts, one for each problem the user
could resolve without warranty work.</p>
<h2 id="resolution-credits">Resolution Credits<a href="#resolution-credits" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>A special thanks to Ubiquiti for providing a community support option via
their official website. Additionally, special thanks to all those users that
utilize said forum, your information was invaluable in helping me to fix my
EdgeRouter, and write this article.</p>
<h2 id="resolution-one-repair-the-file-system">Resolution One: Repair the File System<a href="#resolution-one-repair-the-file-system" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>This is by far the easiest resolution. Open the EdgeRouter Lite (<strong>Caution:</strong>
<em>Your warranty is now void. Depending on how soon you need the device
back in operation, it may be acceptable for you to void the warranty on a
$100USD device if you can get it back in service by the end of the day. If
you think your device may need to be RMA’d, do not open the device and proceed
to UBNT’s Support Site.</em>) by removing two screws on the bottom
of the device, located right under where the interface connections are. Your
device will slide apart, revealing the internal board. On the board you
will see a soldered on female USB port with a small silver USB flash drive,
roughly 3cm long. This is your 2GB of internal memory, but the device itself
is 2.6GB.</p>
<p>Remove the USB drive and plug it into a USB port on your Mac OSX or Linux
powered device. Open a terminal, and run dmesg. You are looking for the
devfs name of your device.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-txt" data-lang="txt"><span class="line"><span class="cl">[  262.645401] scsi 2:0:0:0: Direct-Access                               5.00 PQ: 0 ANSI: 2
</span></span><span class="line"><span class="cl">[  262.647109] sd 2:0:0:0: Attached scsi generic sg1 type 0
</span></span><span class="line"><span class="cl">[  262.648527] sd 2:0:0:0: [sdb] 4057088 512-byte logical blocks: (2.07 GB/1.93 GiB)
</span></span><span class="line"><span class="cl">[  262.648795] sd 2:0:0:0: [sdb] Write Protect is off
</span></span><span class="line"><span class="cl">[  262.648817] sd 2:0:0:0: [sdb] Mode Sense: 0b 00 00 08
</span></span><span class="line"><span class="cl">[  262.649095] sd 2:0:0:0: [sdb] No Caching mode page found
</span></span><span class="line"><span class="cl">[  262.649114] sd 2:0:0:0: [sdb] Assuming drive cache: write through
</span></span><span class="line"><span class="cl">[  262.652309]  sdb: sdb1
</span></span><span class="line"><span class="cl">[  262.655018] sd 2:0:0:0: [sdb] Attached SCSI removable disk
</span></span></code></pre></div><p>In this case, my device name is <code>sdb</code>. Please note that for this guide I am not
using an actual EdgeRouter flash drive. This is a stand-in device. The next
thing to do is make sure none of the partitions on the device have been
automatically mounted. Where I used <code>sdb</code> in the following example, use whatever
dmesg identified as your USB device.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">mount <span class="p">|</span> grep sdb
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-txt" data-lang="txt"><span class="line"><span class="cl">/dev/sdb1 on /media/bakayuki/b7bcf200-26a1-41ed-9122-625558dbc907 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
</span></span></code></pre></div><p>This would indicate that at least one of the partitions on the disk has been
mounted. To correct this we need to use the <code>umount</code> command. Note that in
some operating systems an eject button exists in the taskbar. In my experience,
not only do these buttons unmount the mounted partitions, it also removed the
device entry from the kernel. So I prefer to use manual <code>umount</code> commands. In
the following example, do one line per mounted partition, substituting the
device names of your partitions where I specified <code>/dev/sdb1</code>.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo umount /dev/sdb1
</span></span></code></pre></div><p>Once you have unmounted the devices, you can use fdisk to get a good view
of the partition layout on your USB device. I like to do this even if I know
what I should expect, just as a form of a sanity test to make sure I have the
right device. Note that, as previously stated, this device is a stand in. I have
tried to recreate the partition table to the best of my memory.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">sudo fdisk -l /dev/sdb
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-txt" data-lang="txt"><span class="line"><span class="cl">Disk /dev/sdb: 2 GiB, 2077229056 bytes, 4057088 sectors
</span></span><span class="line"><span class="cl">Units: sectors of 1 * 512 = 512 bytes
</span></span><span class="line"><span class="cl">Sector size (logical/physical): 512 bytes / 512 bytes
</span></span><span class="line"><span class="cl">I/O size (minimum/optimal): 512 bytes / 512 bytes
</span></span><span class="line"><span class="cl">Disklabel type: dos
</span></span><span class="line"><span class="cl">Disk identifier: 0xd9dd6356
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">Device     Boot  Start     End Sectors  Size Id Type
</span></span><span class="line"><span class="cl">/dev/sdb1         2048  264191  262144  128M  b W95 FAT32
</span></span><span class="line"><span class="cl">/dev/sdb2       264192 4057087 3792896  1.8G 83 Linux
</span></span></code></pre></div><p>So we can see from the above that we have two partitions on the USB device. In
your case, when using an actual EdgeRouter flash drive, one of the partitions
will be a vfat partition type, and the second one will be a linux
partition type. Now that we know where our partitions are, and that they are
safely unmounted, we can use fsck. Remember to replace my instance of <code>sdb2</code>
with the correct partition for your device. Note that depending on the damage to
the filesystem, this has the potential to be a <strong>destructive operation</strong>.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">fsck.ext3 -fvy /dev/sdb2
</span></span></code></pre></div><p>Allow the program to run till completion. If you notice the command has become
looped, you will need to clear the journal out on your device. Note that
this is a <strong>potentially destructive operation</strong> to data that had not been
written from the journal to the disk. The first thing that we need to do is
clear out the recovery indicator using <code>debugfs</code> Remember to replace <code>sdb2</code>
with the proper device name of your ext3 partition.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">debugfs -w -R “feature ^needs_recovery” /dev/sdb2
</span></span></code></pre></div><p>After clearing out this flag, it is now possible to use <code>tune2fs</code> to force
removal of the journal.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">tune2fs -f -O ^has_journal /dev/sdb2
</span></span></code></pre></div><p>Now you can go back up and run the <code>fsck</code> command. Once that is done, you will
need to re-enable the journal on your filesystem.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-sh" data-lang="sh"><span class="line"><span class="cl">tune2fs -f -O has_journal -j <span class="nv">size</span><span class="o">=</span>128M /dev/sdb2
</span></span></code></pre></div><p>Once you have a clean fsck output, and you have your journal enabled again, plug
the USB device back into the EdgeRouter and boot. If you are lucky, everything
will come back as it should. As there may be data loss, make sure to restore
from a recent configuration backup (you <strong>do</strong> have configuration backups,
right?) and reboot, before logging into the device through ssh to make sure
everything is where it should be.</p>
<p>If you are still having problems, stick around for part two of this guide, where
I will be walking you through using a separate host computer to recreate the
filesystem.</p>
<h1 id="external-links--resources">External Links &amp; Resources<a href="#external-links--resources" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h1>
<p><a href="https://trick.vanstaveren.us/wp/2009/06/19/how-to-recover-an-ext3-volume-with-an-unreadable-journal/">How to Recover an EXT3 Volume with an Unreadable Journal</a></p>
]]></content></item></channel></rss>