0

I am using a Raspberry Pi A+ with Raspbian Jessie. I am encountering very strange errors where modifications I have performed seem to be reverted a while after.

Example 1: I removed in /etc/apt/sources.list.d file collabora.list and raspi.list. It works ok (no error on rm, and the directory is then empty). But after a while, this is what I see:

$ ls -al
ls: cannot access collabora.list: No such file or directory
ls: cannot access raspi.list: No such file or directory
total 8
drwxr-xr-x 2 root root 4096 Apr  4 09:57 .
drwxr-xr-x 6 root root 4096 Dec 21  2016 ..
-????????? ? ?    ?       ?            ? collabora.list
-????????? ? ?    ?       ?            ? raspi.list

Example 2: I had added these 2 lines in /etc/sysctl.conf:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

Again, it worked for a while. And then suddenly, I see have IPv6 again and that the file no longer has my lines!!

$ grep ipv6 /etc/sysctl.conf
#net.ipv6.conf.all.forwarding=1
#net.ipv6.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_source_route = 0

Example 3: I had added the DNS servers in /etc/network/interfaces.

dns-nameservers 9.9.9.9 8.8.8.8

It worked great. Then after a while, I realise I no longer have name resolution. I go back to my file, and the line is no longer there.

Okay, so by now, you'll think I'm crazy and I didn't edit the files on the right system. So, let me do it again.

cat /etc/network/interfaces
auto lo
iface lo inet loopback
wireless-power off

allow-hotplug wlan0
iface wlan0 inet static
   address 192.168.0.15
   gateway 192.168.0.254
   netmask 255.255.255.0
   network 192.168.0.0
   broadcast 192.168.0.255
   wpa-ssid "blah"
   wpa-psk MYSECRET

Let's prove I don't have name resolution:

$ ping google.com
ping: unknown host google.com
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=21.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=20.2 ms

Now I edit /etc/network/interfaces to add the DNS servers:

$ sudo -s
[sudo] password for user: 
root@wipi:/etc/apt/sources.list.d# vi /etc/network/interfaces
# grep dns /etc/network/interfaces
     dns-nameservers 9.9.9.9 8.8.8.8

Now, I reboot to load the new configuration (I could do ifdown, ifup, true).

$ ssh user@192.168.0.15
Last login: Wed Dec 21 22:17:34 2016 from cray3.home
user@wipi ~ $

I do have name resolution:

$ ping google.com
PING google.com (216.58.210.206) 56(84) bytes of data.
64 bytes from mrs04s09-in-f206.1e100.net (216.58.210.206): icmp_seq=1   ttl=55 time=21.2 ms
64 bytes from mrs04s09-in-f206.1e100.net (216.58.210.206): icmp_seq=2 ttl=55 time=21.3 ms

Then, I try to refresh my source of packages with apt-get update. It doesn't work fully good because collabora isn't available.

W: Failed to fetch http://raspberrypi.collabora.com/dists/jessie/rpi/binary-armhf/Packages  404  Not Found [IP: 2a00:1098:0:82:1000:25:2eeb:e3e2 80]

So, I remove it:

$ sudo rm collabora.list 

This time I get some other errors (see below).

W: Failed to fetch http://archive.raspberrypi.org/debian/dists/jessie/main/binary-armhf/Packages  Hash Sum mismatch

I also test I still have name resolution. This archive.raspberrypi.org is in raspi.list in my sources, so I remove raspi.list and re-update.

$ sudo rm raspi.list
$ sudo apt-get update

But it's worse and worse for apt-get update:

W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/jessie/main/binary-armhf/Packages  Hash Sum mismatch

W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/jessie/non-free/binary-armhf/Packages  Hash Sum mismatch

And now, I try to ping again, bam!! No name resolution:

$ ping google.com
ping: unknown host google.com

Sidenote:

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  5.1G  9.0G  37% /
devtmpfs         87M     0   87M   0% /dev
tmpfs            91M     0   91M   0% /dev/shm
tmpfs            91M  8.5M   83M  10% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            91M     0   91M   0% /sys/fs/cgroup
/dev/mmcblk0p1   56M   21M   36M  38% /boot
tmpfs            19M     0   19M   0% /run/user/1001

$ mount
dev/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
...
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

$ uname -a
Linux wipi 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 8.0 (jessie)
Release:    8.0
Codename:   jessie

The system is on a SD card. No power issue. It gets the network via a Wifi dongle.

Thanks for any idea.

user509010
  • 23
  • 1
  • 3
  • 1
    The SD card may be damaged, try to replace it. Pis have a tendency to break them. – gronostaj Apr 04 '18 at 08:57
  • 2
    ^ this. I've seen several cards across operating systems that appear to delete, format, copy files to and otherwise do not give errors when doing so. They simply drop any write requests on the floor while pretending they happened. Caching in the operating system makes it *look* like it happened until the directory is refreshed. Making themselves read-only when failing is common these days. – Mokubai Apr 04 '18 at 09:17
  • Perhaps! Is there a way to test my SD card? I'll probably reformat it and check for errors. Other idea? – user509010 Apr 04 '18 at 17:59
  • Ok you are right. I tried to format my SD card, which failed. Obviously it is corrupt. Thanks! – user509010 Apr 04 '18 at 19:30
  • @Mokubai Your comment is helpful. Are you going to turn it into a proper answer? I can make a community wiki answer out of it but I don't want to take credit away from you. – Kamil Maciorowski Apr 05 '18 at 06:33
  • @KamilMaciorowski we have a rabbit's warren of possible duplicates hovering around, some starting at https://superuser.com/questions/1255025/sd-card-not-getting-formatted . I can't quickly see one with a good canonical answer though so if you want to write one then feel free. I don't think you need to bother with community wiki, my comment was mostly anecdotal so if you can back up with actual facts then that would be awesome. – Mokubai Apr 05 '18 at 06:45

0 Answers0