Outils pour utilisateurs

Outils du site


Problèmes divers

Liens

Accès depuis l'extérieur

  • fab@proxmox, accès par mot de passe. Sur l'hôte ou sur un conteneur ? Plus simple sur l'hôte.
  • ensuite il passe par ssh, avec son propre jeu de clés. Du coup les conteneurs (mutt etc) doivent avoir cette clé publique.
  • Est-ce qu'on pourrait pas arranger un accès par rebond SSH ? ProxyJump.
  • #avoir un petit menu lors du login avec fab pour choisir l'appli/conteneur à démarrer ?
  • ptet avoir un tmux qui permet de switcher entre les différentes applis
#!/bin/bash

C0="\033[0m" # No color
C1="\033[0;30m" # Black
C2="\033[0;31m" # Red
C3="\033[0;32m" # Green
C4="\033[0;33m" # Brown
C5="\033[0;34m" # Blue
C6="\033[0;35m" # Purple
C7="\033[0;36m" # Cyan
C8="\033[0;37m" # Light Gray
C9="\033[1;30m" # Dark Gray
CA="\033[1;31m" # Light Red
CB="\033[1;32m" # Light Green
CC="\033[1;33m" # Yellow
CD="\033[1;34m" # Light Blue
CE="\033[1;35m" # Light Purple
CF="\033[1;36m" # Light Cyan
CG="\033[1;37m" # White

cat << EOF
EOF

  • Désactiver auth par MDP sur mycelium@mplservv

Pistes

Backup incrémentiel snapshot truc :

Cache APT pour les conteneurs (apt-cacher-ng) :

Comprendre uwsgi, etc. :

Gérer soi-même DHCPv6 pour les conteneurs ce serait cool :

Accès aux partitions LVM+LUKS depuis l'hôte

Aller chercher l'image .qcow2 dans /var/lib.

modprobe nbd
qemu-nbd --connect=/dev/nbd0 imagename.qcow2

Puis LUKS:

cryptsetup luksOpen /dev/nbdpX crypted_sda1

Puis LVM:

# lvm vgscan -v
    Wiping cache of LVM-capable devices
    Wiping internal VG cache
  Reading all physical volumes.  This may take a while...
    Using volume group(s) on command line.
    Finding all volume groups.
  Found volume group "pve" using metadata type lvm2
  Found volume group "mplserv-vg" using metadata type lvm2
    Archiving volume group "mplserv-vg" metadata (seqno 3).
    Creating volume group backup "/etc/lvm/backup/mplserv-vg" (seqno 3).
# lvm vgchange -a y
  3 logical volume(s) in volume group "pve" now active
  2 logical volume(s) in volume group "mplserv-vg" now active

Et enfin montage classique :

mount /dev/mplserv-vg/root /mnt/tmp/

Ne pas oublier de démonter les partitions après, sinon il fera un joli fsck avec perte des fichiers modifiés (remis dans lost+found).

Voir du côté de cryptsetup luksClose, dmsetup remove …

smartctl

SAMSUNG SpinPoint M7E

Disque dur fourni avec mon ancien portable LDLC, 320Go.

smartctl -a /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.4.59-1-pve] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     SAMSUNG SpinPoint M7E (AF)
Device Model:     SAMSUNG HM321HI
Serial Number:    S24PJ9FB409598
LU WWN Device Id: 5 0024e9 204e450da
Firmware Version: 2AJ10001
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    5400 rpm
Form Factor:      2.5 inches
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS T13/1699-D revision 6
SATA Version is:  SATA 2.6, 3.0 Gb/s
Local Time is:    Tue May  9 11:22:29 2017 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
See vendor-specific Attribute list for marginal Attributes.

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:                ( 4980) seconds.
Offline data collection
capabilities:                    (0x5b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        No Conveyance Self-test supported.
                                        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:        (  83) minutes.
SCT capabilities:              (0x003f) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   100   100   051    Pre-fail  Always       -       10
  2 Throughput_Performance  0x0026   055   055   000    Old_age   Always       -       4631
  3 Spin_Up_Time            0x0023   089   001   025    Pre-fail  Always   In_the_past 3404
  4 Start_Stop_Count        0x0032   098   098   000    Old_age   Always       -       2809
  5 Reallocated_Sector_Ct   0x0033   252   252   010    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   252   252   051    Old_age   Always       -       0
  8 Seek_Time_Performance   0x0024   252   252   015    Old_age   Offline      -       0
  9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       28904
 10 Spin_Retry_Count        0x0032   252   252   051    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   090   090   000    Old_age   Always       -       10653
 12 Power_Cycle_Count       0x0032   098   098   000    Old_age   Always       -       2763
191 G-Sense_Error_Rate      0x0022   090   090   000    Old_age   Always       -       103890
192 Power-Off_Retract_Count 0x0022   252   252   000    Old_age   Always       -       0
194 Temperature_Celsius     0x0002   064   053   000    Old_age   Always       -       26 (Min/Max 9/48)
195 Hardware_ECC_Recovered  0x003a   100   100   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   252   252   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   252   252   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   252   252   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0036   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x002a   100   100   000    Old_age   Always       -       2816
223 Load_Retry_Count        0x0032   090   090   000    Old_age   Always       -       10653
225 Load_Cycle_Count        0x0032   001   001   000    Old_age   Always       -       1040069

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Extended offline    Completed without error       00%     15328         -
# 2  Short offline       Completed without error       00%     15317         -

SMART Selective self-test log data structure revision number 0
Note: revision number not 1 implies that no selective self-test has ever been run
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Completed [00% left] (0-65535)
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.
# smartctl -H /dev/sda
smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.4.59-1-pve] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  3 Spin_Up_Time            0x0023   089   001   025    Pre-fail  Always   In_the_past 3404

Problèmes de reconnaissance de disques externes USB

Le disque dur USB fonctionne avec mon ordi portable, mais pas avec ma petite machine (MPLX, qui tourne sous Proxmox 5.2.) Pourtant, pendant longtemps, il a été reconnu. Il suffit qu'il ait été retiré en cours d'exécution, qu'il ait reçu la mauvaise commande SMART ? Pour qu'il ait du mal à se refaire accepter par l'ordi.

Penser aussi à vérifier l'état de la lupiote sur le disque. Parfois on voit que ça clignote alors que ça devrait être constant.

On dirait que le contrôleur du boitier du disque dur conserve un certain état, et qu'il ne se réinitialise pas.

J'ai eu ce problème avec mes 2 disques durs Seagate Expansion.

Il s'avère aussi que ces disques sont parfois réassociés à une VM (via qemu), mais je crois pas que ce soit lié.

Seagate 3 To

Sur MPLX :

[ 2568.989353] usb 1-5.2: new high-speed USB device number 4 using xhci_hcd
[ 2569.135452] usb 1-5.2: New USB device found, idVendor=0bc2, idProduct=3320
[ 2569.135457] usb 1-5.2: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[ 2569.135459] usb 1-5.2: Product: Expansion Desk
[ 2569.135461] usb 1-5.2: Manufacturer: Seagate
[ 2569.135463] usb 1-5.2: SerialNumber: NA4K7Q9X
[ 2569.145990] usbcore: registered new interface driver usb-storage
[ 2569.148516] scsi host4: uas
[ 2569.148727] usbcore: registered new interface driver uas
[ 2569.149919] scsi 4:0:0:0: Direct-Access     Seagate  Expansion Desk   0711 PQ: 0 ANSI: 6
[ 2569.150994] sd 4:0:0:0: Attached scsi generic sg2 type 0
[ 2569.151295] sd 4:0:0:0: [sdc] Spinning up disk...
[ 2570.165532] .
[ 2570.245734] ready
[ 2570.485314] sd 4:0:0:0: [sdc] Read Capacity(16) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 2570.485320] sd 4:0:0:0: [sdc] Sense not available.
[ 2570.729744] sd 4:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 2570.729750] sd 4:0:0:0: [sdc] Sense not available.
[ 2570.829299] sd 4:0:0:0: [sdc] 0 512-byte logical blocks: (0 B/0 B)
[ 2570.829304] sd 4:0:0:0: [sdc] 0-byte physical blocks
[ 2570.913334] sd 4:0:0:0: [sdc] Write Protect is off
[ 2570.913339] sd 4:0:0:0: [sdc] Mode Sense: 00 00 00 00
[ 2570.997327] sd 4:0:0:0: [sdc] Asking for cache data failed
[ 2570.997341] sd 4:0:0:0: [sdc] Assuming drive cache: write through
[ 2571.465305] sd 4:0:0:0: [sdc] Read Capacity(16) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 2571.465311] sd 4:0:0:0: [sdc] Sense not available.
[ 2571.705560] sd 4:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 2571.705565] sd 4:0:0:0: [sdc] Sense not available.
[ 2572.105379] sd 4:0:0:0: [sdc] Attached SCSI disk
[ 2572.342019] usb 1-5.2: reset high-speed USB device number 4 using xhci_hcd
[ 2572.689944] usb 1-5.2: reset high-speed USB device number 4 using xhci_hcd
[ 2572.922115] usb 1-5.2: reset high-speed USB device number 4 using xhci_hcd
[ 2573.273954] usb 1-5.2: reset high-speed USB device number 4 using xhci_hcd

Sur mon portable :

[31948.848102] usb 1-1: new high-speed USB device number 5 using ehci-pci
[31949.006705] usb 1-1: New USB device found, idVendor=0bc2, idProduct=3320
[31949.006710] usb 1-1: New USB device strings: Mfr=2, Product=3, SerialNumber=1
[31949.006714] usb 1-1: Product: Expansion Desk
[31949.006717] usb 1-1: Manufacturer: Seagate
[31949.006720] usb 1-1: SerialNumber: NA4K7Q9X
[31949.015050] scsi host6: uas
[31949.019351] scsi 6:0:0:0: Direct-Access     Seagate  Expansion Desk   0711 PQ: 0 ANSI: 6
[31949.021424] sd 6:0:0:0: Attached scsi generic sg2 type 0
[31949.021948] sd 6:0:0:0: [sdb] Spinning up disk...
[31950.048078] ...........ready
[31960.290289] sd 6:0:0:0: [sdb] 732566645 4096-byte logical blocks: (3.00 TB/2.73 TiB)
[31960.298300] sd 6:0:0:0: [sdb] Write Protect is off
[31960.298305] sd 6:0:0:0: [sdb] Mode Sense: 4f 00 00 00
[31960.299030] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[31960.333450]  sdb: sdb1
[31960.337156] sd 6:0:0:0: [sdb] Attached SCSI disk

Le résultat diffère à partir de Spinning up disk…

Dans un cas, c'est ehci qui est utilisé. Dans l'autre, c'est xhci.

Seagate 2 To

Encore pire ici, sur MPLX :

[ 5036.287788] usb 1-1.1: new high-speed USB device number 6 using xhci_hcd
[ 5036.387573] usb 1-1.1: Device not responding to setup address.
[ 5036.595848] usb 1-1.1: Device not responding to setup address.
[ 5036.803778] usb 1-1.1: device not accepting address 6, error -71

Sur l'ordi portable :

[33233.420102] usb 1-1: new high-speed USB device number 6 using ehci-pci
[33233.577541] usb 1-1: New USB device found, idVendor=0bc2, idProduct=3312
[33233.577546] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[33233.577549] usb 1-1: Product: Expansion Desk
[33233.577553] usb 1-1: Manufacturer: Seagate 
[33233.577556] usb 1-1: SerialNumber: NA4J5HJP
[33233.578168] usb-storage 1-1:1.0: USB Mass Storage device detected
[33233.579487] scsi host6: usb-storage 1-1:1.0
[33234.594506] scsi 6:0:0:0: Direct-Access     Seagate  Expansion Desk   0316 PQ: 0 ANSI: 6
[33234.595124] sd 6:0:0:0: Attached scsi generic sg2 type 0
[33244.961038] sd 6:0:0:0: [sdb] 3907029167 512-byte logical blocks: (2.00 TB/1.82 TiB)
[33244.961767] sd 6:0:0:0: [sdb] Write Protect is off
[33244.961772] sd 6:0:0:0: [sdb] Mode Sense: 2b 00 10 08
[33244.962517] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA
[33244.997296]  sdb: sdb1
[33245.001256] sd 6:0:0:0: [sdb] Attached SCSI disk
[33305.613453] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null)
[33321.355724] usb 1-1: USB disconnect, device number 6
[33321.358057] sd 6:0:0:0: [sdb] Synchronizing SCSI cache
[33321.358126] sd 6:0:0:0: [sdb] Synchronize Cache(10) failed: Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

Un seagate extirpé d'un boitier Samsung (oui, c'est des blagueurs chez Samsung) :

[104060.726640] usb 1-1.3: new high-speed USB device number 9 using xhci_hcd
[104060.822697] usb 1-1.3: device descriptor read/64, error -71
[104061.698842] usb 2-1.3: new SuperSpeed USB device number 6 using xhci_hcd
[104061.719600] usb 2-1.3: New USB device found, idVendor=04e8, idProduct=6125
[104061.719606] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[104061.719609] usb 2-1.3: Product: D3 Station
[104061.719611] usb 2-1.3: Manufacturer: Samsung 
[104061.719613] usb 2-1.3: SerialNumber: 00000000011E0A49
[104061.720989] usb-storage 2-1.3:1.0: USB Mass Storage device detected
[104061.722563] scsi host5: usb-storage 2-1.3:1.0
[104062.739541] scsi 5:0:0:0: Direct-Access     Samsung  D3 Station       0202 PQ: 0 ANSI: 6
[104062.740601] sd 5:0:0:0: Attached scsi generic sg3 type 0
[104062.741484] sd 5:0:0:0: [sdd] Spinning up disk...
[104068.278518] .
[104069.298440] .
[104070.322410] .
[104071.346417] .
[104072.370615] .
[104073.394582] .
[104073.394829] ready
[104073.395095] sd 5:0:0:0: [sdd] 976754645 4096-byte logical blocks: (4.00 TB/3.64 TiB)
[104073.395721] sd 5:0:0:0: [sdd] Write Protect is off
[104073.395724] sd 5:0:0:0: [sdd] Mode Sense: 2b 00 10 08
[104073.396349] sd 5:0:0:0: [sdd] Write cache: enabled, read cache: enabled, supports DPO and FUA
[104073.399296] sd 5:0:0:0: [sdd] Attached SCSI disk
[104073.400593] sd 5:0:0:0: [sdd] Synchronizing SCSI cache
[104073.682716] usb 2-1.3: reset SuperSpeed USB device number 6 using xhci_hcd
[104073.902679] usb 2-1.3: reset SuperSpeed USB device number 6 using xhci_hcd

[104209.942892] usb 2-1.3: USB disconnect, device number 6
[104223.222927] usb 1-5.2: new high-speed USB device number 10 using xhci_hcd
[104223.324030] usb 1-5.2: New USB device found, idVendor=04e8, idProduct=6125
[104223.324035] usb 1-5.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[104223.324038] usb 1-5.2: Product: D3 Station
[104223.324040] usb 1-5.2: Manufacturer: Samsung 
[104223.324042] usb 1-5.2: SerialNumber: 00000000011E0A49
[104223.325182] usb-storage 1-5.2:1.0: USB Mass Storage device detected
[104223.326807] scsi host5: usb-storage 1-5.2:1.0
[104223.763595] usb 1-5.2: reset high-speed USB device number 10 using xhci_hcd
[104224.063740] usb 1-5.2: reset high-speed USB device number 10 using xhci_hcd
[104224.247238] usb 1-5.2: reset high-speed USB device number 10 using xhci_hcd
[104224.547243] usb 1-5.2: reset high-speed USB device number 10 using xhci_hcd

Bien sûr le reset fait que le disque n'est plus accessible. Tandis que sur mon ordi portable, ça fonctionne.

Je commence à penser qu'il y a un sérieux pépin sur l'USB/le contrôleur disque de ma machine…

Tous les disques ont une alimentation externe. Quand je fais mes tests, j'ai souvent déjà UN disque dur externe de branché. Peut-être qu'il a du mal à en relier un supplémentaire… j'essayerai en débranchant.

article/linux/mplx/divers.txt · Dernière modification: 2018/07/19 22:58 par fab