Disk I/O Error beim bereinigen der fhem.db

Begonnen von franky08, 26 April 2016, 17:30:43

Vorheriges Thema - Nächstes Thema

marvin78

Ich kenne mich mit SQlite nicht sonderlich gut aus aber war das nicht so, dass man hier einfach die DB-Dateien kopieren kann und ein DUMP nicht notwendig ist!?

justme1968

wenn fhem angehalten ist kann man das db file einfach kopieren. das würde ich bei einer migration als erstes probieren.

ansonsten hat ein dump hat aber den vorteil das sich damit auch aus einem defekten db file zumindest teile retten lassen und das man ihn zur not auch editieren und auf einem komplett anderen db system einspielen kann.

wenn es tatsächlich an der reinen geschwindigkeit liegt kannst du versuchen den dump der einen platte direkt in ein pgsql für die andere platte zu pipen. dann beschränkt die langsamere platte auch die lese geschwindigkeit.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

franky08

#17
Das Problem ist ja, dass beim kopieren der Host IO Error bringt, siehe betateilchens Posts. Das isr wohl eine Eigenheit der SSD Platten, laut betateilchen passiert das bei mechanischen Platten nicht. Egal ob ich dumpen will oder einfach die Db kopieren oder alte Datensätze löschen möchte, der Kernel Sata Treiber geht ins Nirvana.



VG
Frank
Debian Wheezy auf ZBOX nano/ Debian Bullseye auf 2.ter ZBOX nano F2F an 2x RaspiB
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu ,fhem5.8, CCU2,
ECMD an AVR-NET-IO mit DAC u. ADC an Junkers Stetigregelung, Siemens LOGO!8, JeeLink uvm...

Wernieman

ZitatEgal ob ich dumpen will oder einfach die Db kopieren oder alte Datensätze löschen möchte,
Meiner Meinung nach, hört es sich wirklich wie ein HW-Defekt an. Was für eine Zotac hast Du? bzw. was für ein SATA-Treiber?

btw:
Mal auf die schnelle gegoogled und kannst Du uns bitte folgendes geben
journalctl -a | grep -i SATA
smartctl -a /dev/sda | grep "SATA Version"
uname -a
lspci  | grep SATA


Eventuell must (sollst) Du smartctl installieren. Da ich Deine Distri nicht weiß, kann ich Dir nicht sagen wo genau
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

franky08

Mmh obwohl ich vor einiger Zeit die smartmontools schon einmal installiert hatte, kann ich sie nicht aufrufen.
Statusinformationen werden eingelesen.... Fertig
smartmontools ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.

frank1@zotac:~$ smartctl -a /dev/sda | grep "SATA Version"
-bash: smartctl: Kommando nicht gefunden.

frank1@zotac:~$ sudo frank1@zotac:~$ smartctl -a /dev/sda | grep "SATA Version"
sudo: frank1@zotac:~$: command not found
frank1@zotac:~$ -bash: smartctl: Kommando nicht gefunden.


Nur das bringt Ergebnisse:
frank1@zotac:~$ lspci  | grep SATA
00:13.0 SATA controller: Intel Corporation ValleyView 6-Port SATA AHCI Controller (rev 0e)


uname

Linux zotac 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt25-2~bpo70+1 (2016-04-12) x86_64 GNU/Linux


Debian Wheezy auf ZBOX nano/ Debian Bullseye auf 2.ter ZBOX nano F2F an 2x RaspiB
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu ,fhem5.8, CCU2,
ECMD an AVR-NET-IO mit DAC u. ADC an Junkers Stetigregelung, Siemens LOGO!8, JeeLink uvm...

Wernieman

#20
Kannst Du es als root ausführen?
bzw. mit sudo?
Zitatsudo journalctl -a | grep -i SATA
sudo smartctl -a /dev/sda | grep "SATA Version"
sudo uname -a
sudo lspci  | grep SATA

Ist für mich so selbstverständlich, das ich es immer "vergesse" zu schreiben

P.S. was Du mir noch nicht geschrieben hast, welche Distri verwendest Du? Und was für einen Zotac?
Wenn es ein CI320 ... kannst Du Deinen Kernel aktuallisieren?

Edit
sudo dmidecode | grep "Product Name"

Edit2:
O.K. Du hast ein Debian Jessie?
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

franky08

#21
ZitatEdit2:
O.K. Du hast ein Debian Jessie?

Auf dem habe ich Debian Wheezy

Zotac:
Intel(R) Celeron(R) CPU N2930 @ 1.83GHz
ZOTAC ZBOX nano
root@zotac:~# sudo dmidecode | grep "Product Name"
Product Name: ZBOX-CI320NANO series
Product Name: ZBOX-CI320NANO series



Als root:
root@zotac:~# sudo journalctl -a | grep -i SATA
sudo: journalctl: command not found

root@zotac:~# sudo smartctl -a /dev/sda | grep "SATA Version"
root@zotac:~#


root@zotac:~# sudo smartctl -a /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.16.0-0.bpo.4-amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Device Model:     SanDisk SDSSDXPS240G
Serial Number:    142572400594
LU WWN Device Id: 5 001b44 c3d8f2bd2
Firmware Version: X21000RL
User Capacity:    240.057.409.536 bytes [240 GB]
Sector Size:      512 bytes logical/physical
Device is:        Not in smartctl database [for details use: -P showall]
ATA Version is:   8
ATA Standard is:  ACS-2 revision 3
Local Time is:    Thu Apr 28 12:04:13 2016 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
Self-test execution status:      (   0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (    0) seconds.
Offline data collection
capabilities: (0x11) SMART execute Offline immediate.
No Auto Offline data collection support.
Suspend Offline collection upon new
command.
No Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
No Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: (   2) minutes.
Extended self-test routine
recommended polling time: (  10) minutes.

SMART Attributes Data Structure revision number: 4
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0032   100   100   ---    Old_age   Always       -       83
  9 Power_On_Hours          0x0032   253   100   ---    Old_age   Always       -       1377
12 Power_Cycle_Count       0x0032   100   100   ---    Old_age   Always       -       62
166 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       1
167 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       53
168 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       70
169 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       831
171 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       32
172 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       0
173 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       12
174 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       37
184 End-to-End_Error        0x0032   100   100   ---    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   ---    Old_age   Always       -       3
188 Command_Timeout         0x0032   100   100   ---    Old_age   Always       -       0
194 Temperature_Celsius     0x0022   058   049   ---    Old_age   Always       -       42 (Min/Max 25/49)
199 UDMA_CRC_Error_Count    0x0032   100   100   ---    Old_age   Always       -       0
212 Unknown_Attribute       0x0032   100   100   ---    Old_age   Always       -       0
230 Head_Amplitude          0x0032   100   100   ---    Old_age   Always       -       40
232 Available_Reservd_Space 0x0033   100   100   004    Pre-fail  Always       -       99
233 Media_Wearout_Indicator 0x0032   100   100   ---    Old_age   Always       -       3317
241 Total_LBAs_Written      0x0030   253   253   ---    Old_age   Offline      -       169
242 Total_LBAs_Read         0x0030   253   253   ---    Old_age   Offline      -       18
244 Unknown_Attribute       0x0032   000   100   ---    Old_age   Always       -       0

SMART Error Log Version: 1
ATA Error Count: 3
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

Error 3 occurred at disk power-on lifetime: 1375 hours (57 days + 7 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  51 40 02 00 00 00 a0 

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ef 10 02 00 00 00 a0 08      00:00:00.000  SET FEATURES [Reserved for Serial ATA]
  ef 10 02 00 00 00 a0 08      00:00:00.000  SET FEATURES [Reserved for Serial ATA]
  ec 00 00 00 00 00 a0 08      00:00:00.000  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      00:00:00.000  SET FEATURES [Set transfer mode]
  ef 10 02 00 00 00 a0 08      00:00:00.000  SET FEATURES [Reserved for Serial ATA]

Error 2 occurred at disk power-on lifetime: 1375 hours (57 days + 7 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  51 40 00 00 00 00 a0

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  ec 00 00 00 00 00 a0 08      00:00:00.000  IDENTIFY DEVICE
  ef 03 46 00 00 00 a0 08      00:00:00.000  SET FEATURES [Set transfer mode]

Error 1 occurred at disk power-on lifetime: 1375 hours (57 days + 7 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  ER ST SC SN CL CH DH
  -- -- -- -- -- -- --
  51 40 00 00 00 00 00 

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  60 10 28 20 f7 0b 40 08      00:00:00.000  READ FPDMA QUEUED

SMART Self-test log structure revision number 1
No self-tests have been logged.  [To run self-tests, use: smartctl -t]


Device does not support Selective Self Tests/Logging
root@zotac:~#




Debian Wheezy auf ZBOX nano/ Debian Bullseye auf 2.ter ZBOX nano F2F an 2x RaspiB
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu ,fhem5.8, CCU2,
ECMD an AVR-NET-IO mit DAC u. ADC an Junkers Stetigregelung, Siemens LOGO!8, JeeLink uvm...

Wernieman

O.K. weesy, das hat noch kein systemd ...
zgrep -i sata /var/log/kern.*

Habe auf dem CI320 ein Ubuntu, logischerweise bin ich da etwas "neuer" ... aber Weesy und ein 3.2.16 Kernel? Hast Du einen aus dem "nicht-Debian-Repro" installiert?

Du hast 3 "Fehler" auf der SSD, auch wenn es 57 Tage her ist.  Gut wäre ein Test der SSD
sudo  smartctl -t offline /dev/sda
Dafür keine "bekannten" im sata-Bereich ....

Trotzdem: Kannst Du den Kernel upgraden?
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

franky08

#23
ZitatTrotzdem: Kannst Du den Kernel upgraden?

Hatte ich im Dezember schon einmal gemacht, muss mal sehen ob es da was neues gibt.
ZitatHast Du einen aus dem "nicht-Debian-Repro" installiert?

Nein, das war aus einem Debian-Repro, wenn ich mich nicht irre, ist schon etwas her.

Das war hier: Debian 7 wheezy - Aktuellen Linux Kernel aus Backports installieren.
http://www.321linux.com/2014/03/19/debian-7-wheezy-aktuellen-linux-kernel-aus-backports-installieren-howto/
Debian Wheezy auf ZBOX nano/ Debian Bullseye auf 2.ter ZBOX nano F2F an 2x RaspiB
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu ,fhem5.8, CCU2,
ECMD an AVR-NET-IO mit DAC u. ADC an Junkers Stetigregelung, Siemens LOGO!8, JeeLink uvm...

franky08

#24
Da komm ich auch nicht weiter:
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
linux-headers-amd64 ist schon die neueste Version.
linux-image-amd64 ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 96 nicht aktualisiert.


root@zotac:~# sudo apt-cache search linux-image
alsa-base - Konfigurationsdateien für ALSA-Treiber
linux-headers-3.2.0-4-amd64 - Header-Dateien für Linux 3.2.0-4-amd64
linux-image-2.6-amd64 - Linux für 64-Bit-PCs (Übergangspaket)
linux-image-3.2.0-4-amd64 - Linux 3.2 für 64-Bit-PCs
linux-image-rt-amd64 - Linux für 64-Bit-PCs (Metapaket), PREEMPT_RT
linux-headers-3.2.0-4-rt-amd64 - Header files for Linux 3.2.0-4-rt-amd64
linux-image-3.2.0-4-amd64-dbg - Debugging symbols for Linux 3.2.0-4-amd64
linux-image-3.2.0-4-rt-amd64 - Linux 3.2 for 64-bit PCs, PREEMPT_RT
linux-image-3.2.0-4-rt-amd64-dbg - Debugging symbols for Linux 3.2.0-4-rt-amd64
nvidia-kernel-3.2.0-4-amd64 - NVIDIA binary kernel module for Linux 3.2.0-4-amd64
linux-headers-3.16.0-0.bpo.4-amd64 - Header files for Linux 3.16.0-0.bpo.4-amd64
linux-image-3.16.0-0.bpo.4-amd64 - Linux 3.16 for 64-bit PCs
linux-image-3.16.0-0.bpo.4-amd64-dbg - Debugging symbols for Linux 3.16.0-0.bpo.4-amd64
linux-image-amd64 - Linux for 64-bit PCs (meta-package)
linux-image-amd64-dbg - Debugging symbols for Linux amd64 configuration (meta-package)
nvidia-kernel-3.16.0-0.bpo.4-amd64 - NVIDIA binary kernel module for Linux 3.16.0-0.bpo.4-amd64
root@zotac:~#


Der jetzige ist schon ziemlich aktuell:
Linux zotac 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt25-2~bpo70+1 (2016-04-12) x86_64 GNU/Linux
Debian Wheezy auf ZBOX nano/ Debian Bullseye auf 2.ter ZBOX nano F2F an 2x RaspiB
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu ,fhem5.8, CCU2,
ECMD an AVR-NET-IO mit DAC u. ADC an Junkers Stetigregelung, Siemens LOGO!8, JeeLink uvm...

Wernieman

#25
O.K. Backports .... und damit ein jessy-Kernel.

Was sagt der smartctrl-Test?

Ansonsten, um wirklich HW-Probleme ausschließen zu können, könntest Du mal Dein Festplattensubsystem prüfen.
Bitte als root (habe jetzt keien Lust, immer sudo ... ;o) )
apt-get install stress
stress -d 4 -t 30


stress selber kennt noch mehr Möglichkeiten, siehe "man stress"

P.S. um sich das sudo "geraffel" zu sparen, kann man auch eingeben:
sudo -i
Anschließend sollte man root sein ... bitte dann aber seeeehr vorsichtig arbeiten! Gibt einen Grund, das man normalerweise nicht root ist ;o)
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

justme1968

um einzugrenzen ob es hw probleme gibt und wo würde ich dir platte mal an einen anderen rechner hängen und/oder per usb/sata adapter anschließen.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

Wernieman

Zitatusb/sata
Bringt nur die Platte nicht an die Grenzen des möglichen ... und einen Stresstest kann man durchaus auch im gleichen System. Bei einem Performance-Test würde ich es verstehen.

Da wir nicht wissen wo das Problem (SSD, SATA, io, eventuell Temperatur) ist das gleiche System optimaler

Habe mal "auf die Schnelle" bei mir gestartet:
stress -d 4 -t 30s
stress: info: [5918] dispatching hogs: 0 cpu, 4 io, 0 vm, 0 hdd
stress: info: [5918] successful run completed in 30s


Für einen "richtigen" Test bitte die Zeiten verlängern, also anstatt "30s" z.B. "30m" ...

Edit:
Was mir dabei noch einfällt:
wie sieht es mit dem "Trim" aus?
fstrim -va
- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html

franky08

An HW Probleme glaube ich nicht, zwei Systeme mit Samsung Extrem pro SSD, beide mit 250 GB und baugleich in zwei Systemen zeigen das gleiche Verhalten. Das wäre schon ein extremer Zufall. Im gleichen System ohne SSD aber mit normaler 250 GB Hdd mechanisch, taucht der Fehler nicht auf! Das liegt wahrscheinlich wirklich am SATA Treiber, wie gesagt bei zwei Systemen.

VG
Frank
Debian Wheezy auf ZBOX nano/ Debian Bullseye auf 2.ter ZBOX nano F2F an 2x RaspiB
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu ,fhem5.8, CCU2,
ECMD an AVR-NET-IO mit DAC u. ADC an Junkers Stetigregelung, Siemens LOGO!8, JeeLink uvm...

franky08

Stress liefert:
root@zotac:~# sudo stress -d 4 -t 30
stress: info: [7955] dispatching hogs: 0 cpu, 0 io, 0 vm, 4 hdd
stress: info: [7955] successful run completed in 30s
root@zotac:~#
Debian Wheezy auf ZBOX nano/ Debian Bullseye auf 2.ter ZBOX nano F2F an 2x RaspiB
22Zoll ViewSonic als Infodislay (WVC)
3xHMLAN mit vccu ,fhem5.8, CCU2,
ECMD an AVR-NET-IO mit DAC u. ADC an Junkers Stetigregelung, Siemens LOGO!8, JeeLink uvm...