wesbarnett / snap-pac

Pacman hooks that use snapper to create pre/post btrfs snapshots like openSUSE's YaST
GNU General Public License v2.0
180 stars 14 forks source link

Broken pipe #8

Closed NicoHood closed 7 years ago

NicoHood commented 7 years ago

I am using snap-pac on my raspberry pi. I've setup the system like this: https://github.com/NicoHood/NicoHood.github.io/wiki/Raspberry-Pi-Encrypted-Btrfs-Root

I recently tried to install a package and got the following error:

(3/3) Performing snapper post snapshots...
    root 
error: command terminated by signal 13: Broken pipe
[alarm@alarmpi ~]$ df -h
Filesystem             Size  Used Avail Use% Mounted on
dev                    421M     0  421M   0% /dev
run                    430M  644K  429M   1% /run
/dev/mapper/cryptroot   30G  4.8G   25G  17% /
tmpfs                  430M   19M  412M   5% /dev/shm
tmpfs                  430M     0  430M   0% /sys/fs/cgroup
tmpfs                  430M   16K  430M   1% /tmp
/dev/mmcblk0p1         100M   28M   73M  28% /boot
/dev/mapper/cryptroot   30G  4.8G   25G  17% /data
/dev/mapper/cryptroot   30G  4.8G   25G  17% /var/cache/pacman/pkg
/dev/mapper/cryptroot   30G  4.8G   25G  17% /var/log
/dev/mapper/cryptroot   30G  4.8G   25G  17% /.snapshots
/dev/mapper/cryptroot   30G  4.8G   25G  17% /var/abs
/dev/mapper/cryptroot   30G  4.8G   25G  17% /srv
/dev/mapper/cryptroot   30G  4.8G   25G  17% /var/tmp
/dev/mapper/cryptroot   30G  4.8G   25G  17% /home
tmpfs                   86M   12K   86M   1% /run/user/1000
tmpfs                   86M  4.0K   86M   1% /run/user/620

I have to not that I enabled btrfs quotas with snapper as suggested in their wiki. But when creating quotas for /home the command fails with a dbus noreply error. So there is possibly more wrong with the filesystem.

Do you know what is wrong here? It might be possible that the sd card slowly dies, or that its just too slow to response? Calling the installation twice made the error not appear anymore.

wesbarnett commented 7 years ago

Does /var/log/pacman.log give any indication near the error?

NicoHood commented 7 years ago

Nothing that would help:

[2016-09-17 15:54] [PACMAN] Running 'pacman -S tigervnc'
[2016-09-17 15:54] [ALPM] running '00_snapper-pre.hook'...
[2016-09-17 15:54] [ALPM-SCRIPTLET]     root 384  ^|^s
[2016-09-17 15:54] [ALPM-SCRIPTLET]     home N/A
[2016-09-17 15:54] [ALPM] transaction started
[2016-09-17 15:54] [ALPM] installed fltk (1.3.3-6)
[2016-09-17 15:54] [ALPM] installed xorg-xsetroot (1.1.1-2)
[2016-09-17 15:54] [ALPM] installed tigervnc (1.7.0-1)
[2016-09-17 15:54] [ALPM] transaction completed
[2016-09-17 15:54] [ALPM] running 'gtk-update-icon-cache.hook'...
[2016-09-17 15:54] [ALPM] running 'update-desktop-database.hook'...
[2016-09-17 15:54] [ALPM] running 'zz_snapper-post.hook'...
[2016-09-17 15:54] [ALPM-SCRIPTLET]     root
[2016-09-17 15:59] [PACMAN] Running 'pacman -S tigervnc'
[2016-09-17 15:59] [ALPM] running '00_snapper-pre.hook'...
[2016-09-17 15:59] [ALPM-SCRIPTLET]     root 386  ^|^s
[2016-09-17 15:59] [ALPM-SCRIPTLET]     home N/A
[2016-09-17 15:59] [ALPM] transaction started
[2016-09-17 15:59] [ALPM] reinstalled tigervnc (1.7.0-1)

But it looks my btrfs filesystem got some unfixable errors:

[arch@arch arduino]$ sudo btrfs check --repair /dev/mapper/cryptsd  2>&1 | tee /tmp/repair
checking extents
Fixed 0 roots.
checking free space cache
checking fs roots
checking csums
checking root refs
checking quota groups
ERROR: out of memory
ERROR: Loading qgroups from disk: -2
extent buffer leak: start 676413440 len 16384
extent buffer leak: start 676315136 len 16384
enabling repair mode
Checking filesystem on /dev/mapper/cryptsd
UUID: fdadc198-542b-4833-9ec9-e9911fa63f22
cache and super generation don't match, space cache will be invalidated
found 4812394496 bytes used err is 0
total csum bytes: 4041828
total tree bytes: 566984704
total fs tree bytes: 546603008
total extent tree bytes: 14794752
btree space waste bytes: 101230858
file data blocks allocated: 18247680000
referenced 14952321024
wesbarnett commented 7 years ago

Okay, sounds like a btrfs filesystem corruption issue. Feel free to reopen if it crops up again on another disk.