<?xml version='1.0' encoding='utf-8' ?>

<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>The Mandelbear&apos;s Musings</title>
  <link>https://mdlbear.dreamwidth.org/</link>
  <description>The Mandelbear&apos;s Musings - Dreamwidth Studios</description>
  <lastBuildDate>Thu, 27 Aug 2020 05:09:12 GMT</lastBuildDate>
  <generator>LiveJournal / Dreamwidth Studios</generator>
  <lj:journal>mdlbear</lj:journal>
  <lj:journaltype>personal</lj:journaltype>
  <image>
    <url>https://v2.dreamwidth.org/15740388/505737</url>
    <title>The Mandelbear&apos;s Musings</title>
    <link>https://mdlbear.dreamwidth.org/</link>
    <width>96</width>
    <height>96</height>
  </image>

<item>
  <guid isPermaLink='true'>https://mdlbear.dreamwidth.org/1734398.html</guid>
  <pubDate>Thu, 27 Aug 2020 05:09:12 GMT</pubDate>
  <title>Troubleshooting Sable&apos;s SSD</title>
  <link>https://mdlbear.dreamwidth.org/1734398.html</link>
  <description>&lt;p&gt; Early last Sunday afternoon I noticed that the battery-charge indicator
    had vanished from (main laptop)Sable&apos;s Gnome panel.  (That&apos;s sort of like
    the row of icons and such you see along the bottom of the screen on a Mac,
    except that I&apos;ve configured it to go vertically down the left-hand edge,
    where it doesn&apos;t reduce the hight of my browser window too much.)

&lt;p&gt; Hmm, says I to myself, maybe it will come back after a reboot.  So I did
    that, and logging in presented me with an empty screen background.  ??? A
    little more experimentation showed that only the Gnome-2 desktop was
    affected; the Ubuntu one (which I detest) worked fine.  So did a console
    terminal, and SSH.  The obvious next step was to run &lt;code&gt;fsck&lt;/code&gt;,
    the file-system checker (and many hackers&apos; favorite stand-in for a certain
    four-letter expletive).

&lt;p&gt; Well, not quite the next step.  Since I figured that fixing file-system
    corruption might possibly make things worse, I moved over to one of my
    spare laptops, Raven, sat Sable on the shelf next to my desk, and logged
    in on Sable with SSH.  Then I went to the top of my working tree and ran
    &lt;code&gt;make&amp;nbsp;status&lt;/code&gt; to see what needed to be checked in.  I
    think I&apos;ve mentioned &lt;a href=&quot;https://gitlab.com/ssavitzky/MakeStuff&quot;&gt;MakeStuff&lt;/a&gt; before -- it&apos;s basically a multi-function build tool based
    on &lt;a href=&quot;https://www.gnu.org/software/make/manual/make.html&quot;&gt;GNU
    Make&lt;/a&gt;, and one of the things it can do is find every git repository
    under the top-level directory, and do things like check its status, or
    pull.  (Commit takes a little more thought, so you don&apos;t want to do it
    indiscriminately.)

&lt;p&gt; Then I ran &lt;a href=&quot;https://gitlab.com/ssavitzky/MakeStuff&quot;&gt;MakeStuff&lt;/a&gt;/scripts/&lt;a href=&quot;https://gitlab.com/ssavitzky/MakeStuff/-/blob/master/scripts/pull-all&quot;&gt;scripts/pull-all&lt;/a&gt; on Raven.  Done.

&lt;p&gt; Well, almost.  There are a few things in my home directory that aren&apos;t
    under my working tree, mostly &lt;code&gt;Desktop&lt;/code&gt;,
    &lt;code&gt;Documents&lt;/code&gt;, &lt;code&gt;Downloads&lt;/code&gt;, my Firefox bookmarks, and
    my Gnome Panel configuration.  I hauled out a USB stick, fired up
    &lt;code&gt;tar&lt;/code&gt; (like zip, except that it can save &lt;em&gt;everything&lt;/em&gt;
    about a file, not just what DOS knows about).  The command I actually
    used, because I probably forgot a few things (and should have excluded a
    few more, like Ruby and Perl), was

&lt;pre&gt;    rsync -a --exclude vv --exclude ?cache --exclude ?golang . \
          nova:/vv/backups/steve\@sable
&lt;/pre&gt;

&lt;p&gt; And ran straight into the fact that USB sticks are usually formatted with
    a FAT filesystem, and limit files to 4Gb.  Growf!  Faced with the
    unappetizing prospect of shipping 17GB of backups over WiFi, I carried
    Sable over to my server and plugged in the ethernet cable that I leave
    hanging off the router for just such occasions.  After that finished, I
    fired up Firefox bookmarked all my tabs, and exported tabs and bookmarks
    to an HTML file.  Should have done that &lt;em&gt;before&lt;/em&gt; I backed up
    everything, but I didn&apos;t think of it.

&lt;p&gt; Finally, I was ready to run &lt;code&gt;fsck&lt;/code&gt; and find out the bad news.
    I plugged in the USB stick with the Ubuntu live installer (one does
    &lt;em&gt;not&lt;/em&gt; run &lt;code&gt;fsck&lt;/code&gt; on a mounted filesystem!), brought up a
    terminal, and ran

&lt;pre&gt;e2fsck -cfp /dev/sda5 # check for bad blocks, force, preen
&lt;/pre&gt;

&lt;p&gt; (Force means to do a full check even if the disk claims it&apos;s okay; &quot;preen&quot;
    means to make all repairs that can be done without human approval.)
    Naturally, after turning up a few dozen bad blocks, it told me that I had
    to run it manually.  I could have replaced the &lt;code&gt;-p&lt;/code&gt; option with
    &lt;code&gt;-y&lt;/code&gt;, to say &quot;yes&quot; to all requests for approval; instead I left
    it off and hit Enter a hundred times or so.  Almost all the problems were
    &quot;doubly-claimed blocks&quot;, mostly shared between some other file and the
    &lt;code&gt;swapfile&lt;/code&gt;.  Of course.  Fsck offered to clone those blocks,
    and I took it up on that offer.  Then ran it again to make sure it hadn&apos;t
    missed anything.  It hadn&apos;t.  But it was still broken, no doubt because of
    all those corrupted files.

&lt;p&gt; So this morning, after a couple of searches, I installed the
    &lt;code&gt;debsums&lt;/code&gt; program, which finds all of the files you&apos;ve
    installed, and compares their checksums against the ones in the packages
    they came from.  The following command then takes that list, and
    re-installs any package containing a file with a bad checksum:

&lt;pre&gt;apt-get install --reinstall $(dpkg -S $(debsums -c) \
       | cut -d : -f 1 | sort -u)
&lt;/pre&gt;

&lt;p&gt; Sable now &quot;works&quot; again.  I know at one zip file was corrupted (it was a
    download, and I was able to find it again), and &lt;code&gt;fsck&lt;/code&gt; doesn&apos;t
    appear to have kept a log, so broken files will keep turning up for a
    while.  I know there aren&apos;t any bad zip files left because there&apos;s an
    option in unzip, &lt;code&gt;-t&lt;/code&gt;, that compares checksums, just the way
    debsums does, so I could loop through all my downloads with:

&lt;pre&gt;for f in *.zip; do echo -n $f:\ ; unzip -tqq $f; echo; done
&lt;/pre&gt;

&lt;p&gt; I have two remaining tasks, I think:  one is to validate all of my Git
    working trees (worst case -- just blow them away and re-clone them), and
    then comes the really hard one:  deciding whether I still trust Sable&apos;s
    SSD, or need to get a new one.  And if I get a new one, how big?  Sable
    and its 500GB drive were purchased together, used, from eBay, and
    brand-new 1TB SSDs are pretty cheap right now.  So there&apos;s that.


&lt;p class=&quot;colophon&quot;&gt; &lt;em&gt;Another fine post from
   &lt;a href=&quot;https://mdlbear.dreamwidth.org/tag/curmudgeon&quot;&gt;The Computer Curmudgeon&lt;/a&gt; (also at
   &lt;a href=&quot;https://computer-curmudgeon.com/&quot;&gt;computer-curmudgeon.com&lt;/a&gt;).&lt;br&gt;
   Donation buttons in &lt;a href=&quot;https://mdlbear.dreamwidth.org/&quot;&gt;profile&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1734398&quot; width=&quot;30&quot; height=&quot;12&quot; alt=&quot;comment count unavailable&quot; style=&quot;vertical-align: middle;&quot;/&gt; comments</description>
  <comments>https://mdlbear.dreamwidth.org/1734398.html</comments>
  <category>computers</category>
  <category>hardware</category>
  <category>curmudgeon</category>
  <category>troubleshooting</category>
  <lj:mood>didactic</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>11</lj:reply-count>
</item>
</channel>
</rss>
