[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /var/lib/dpkg/status strangeness



Simon Bell wrote:
> My /var/lib/dpkg/status file became corrupt recently, I was getting
> this when trying to apt-update:
> ...
> I managed to correct the issue by pulling some stuff from
> /var/lib/dpkg/status-old...

Also don't forget about /var/backups.  There is a daily copy stored
there too.

  -rw-r--r-- 1 root root    3379467 Dec 20 12:10 dpkg.status.0
  -rw-r--r-- 1 root root    1029277 Dec 20 12:10 dpkg.status.1.gz
  -rw-r--r-- 1 root root    1037392 Dec 19 12:33 dpkg.status.2.gz
  -rw-r--r-- 1 root root    1037406 Dec 18 10:58 dpkg.status.3.gz
  -rw-r--r-- 1 root root    1037409 Dec 17 12:26 dpkg.status.4.gz
  -rw-r--r-- 1 root root    1037407 Dec 16 11:37 dpkg.status.5.gz
  -rw-r--r-- 1 root root    1037385 Dec 15 10:23 dpkg.status.6.gz

> But, can anyone explain why the corruption (shown below) ended up containing 
> the name of an old wireless SSID I used to use!?
> ...
> The SSID was called 'airdrawndagger', it hasn't been active for over
> a year and the machine in question was clean installed after the
> Wireless network was replaced with another!
>
> If only for my sanity, does anyone have any idea how this could happen?

Very odd.  It *did* happen.  Therefore there must be vector.  It must
have been on the disk.  Possibly in swap.  There must have been some
disk corruption to have caused that block to appear where it should
not have.  Normally I would suspect a bad pointer to reference
unexpected data.

Among the things I would check I would check the status of the disk.
Assuming /dev/sda get the SMART selftest information.

  apt-get install smartmontools
  smartctl -l error /dev/sda
  smartctl -l selftest /dev/sda
  smartctl -t short /dev/sda
  smartctl -l selftest /dev/sda
  smartctl -t long /dev/sda
  smartctl -l selftest /dev/sda

If you haven't configured smart to run routinely then I would so do.
I like this in my /etc/smartd.conf file:

  # Monitor all attributes, enable automatic offline data collection,
  # automatic Attribute autosave, and start a short self-test every
  # weekday between 2-3am, and a long self test Saturdays between 3-4am.
  # Ignore attribute 194 temperature change.
  # Ignore attribute 190 airflow temperature change.
  # On failure run all installed scripts (to send notification email).

  /dev/sda -a -o on -S on -s (S/../../[1-5]/03|L/../../6/03) -I 194 -I 190 -m root -M exec /usr/share/smartmontools/smartd-runner

I guess I would suspect a disk problem but that doesn't rule out some
other possible problem.  But definitely a scary system integrity
failure of some sort.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: