<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2010-04-27:505737</id>
  <title>The Mandelbear's Musings</title>
  <subtitle>mdlbear</subtitle>
  <author>
    <name>mdlbear</name>
  </author>
  <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom"/>
  <updated>2020-08-27T05:09:12Z</updated>
  <dw:journal username="mdlbear" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2010-04-27:505737:1734398</id>
    <link rel="alternate" type="text/html" href="https://mdlbear.dreamwidth.org/1734398.html"/>
    <link rel="self" type="text/xml" href="https://mdlbear.dreamwidth.org/data/atom/?itemid=1734398"/>
    <title>Troubleshooting Sable's SSD</title>
    <published>2020-08-27T05:09:12Z</published>
    <updated>2020-08-27T05:09:12Z</updated>
    <category term="computers"/>
    <category term="curmudgeon"/>
    <category term="troubleshooting"/>
    <category term="hardware"/>
    <dw:mood>didactic</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>11</dw:reply-count>
    <content type="html">&lt;p&gt; Early last Sunday afternoon I noticed that the battery-charge indicator
    had vanished from (main laptop)Sable's Gnome panel.  (That's sort of like
    the row of icons and such you see along the bottom of the screen on a Mac,
    except that I've configured it to go vertically down the left-hand edge,
    where it doesn'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' 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've mentioned &lt;a href="https://gitlab.com/ssavitzky/MakeStuff"&gt;MakeStuff&lt;/a&gt; before -- it's basically a multi-function build tool based
    on &lt;a href="https://www.gnu.org/software/make/manual/make.html"&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't want to do it
    indiscriminately.)

&lt;p&gt; Then I ran &lt;a href="https://gitlab.com/ssavitzky/MakeStuff"&gt;MakeStuff&lt;/a&gt;/scripts/&lt;a href="https://gitlab.com/ssavitzky/MakeStuff/-/blob/master/scripts/pull-all"&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'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'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's okay; "preen"
    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 "yes" to all requests for approval; instead I left
    it off and hit Enter a hundred times or so.  Almost all the problems were
    "doubly-claimed blocks", 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't
    missed anything.  It hadn'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'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 "works" 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't
    appear to have kept a log, so broken files will keep turning up for a
    while.  I know there aren't any bad zip files left because there'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'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's that.


&lt;p class="colophon"&gt; &lt;em&gt;Another fine post from
   &lt;a href="https://mdlbear.dreamwidth.org/tag/curmudgeon"&gt;The Computer Curmudgeon&lt;/a&gt; (also at
   &lt;a href="https://computer-curmudgeon.com/"&gt;computer-curmudgeon.com&lt;/a&gt;).&lt;br&gt;
   Donation buttons in &lt;a href="https://mdlbear.dreamwidth.org/"&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="https://www.dreamwidth.org/tools/commentcount?user=mdlbear&amp;ditemid=1734398" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
