Upgrades for Lenovo W500

For anyone interested. It is possible to upgrade your aging Lenovo W500 to 802.11ac wifi, if you have flashed your BIOS without the whitelist. Upgrades I’ve done.

– WWAN F5521GW (Still 3G, but supposedly a bit faster than the original F3507g).
– WiFi Intel 7260 (this is a half hight mini-pcie card, so you need a extension plate).
– SSD

Posted in Data, Linux | Tagged , , , , , , , , | Leave a comment

intel amt/me debian

Endel Intel systemer idag kommer med vPro. Dette vil si at det er en slags billig iLO/iDRAC løsning integrert. Systemet jeg konfigurerte hadde en eldre versjon, som kun gir mulighet for å styre power samt konsoll over seriell. For oss er det mer enn godt nok for breakfix ved feil.

I korte trekk hva som må konfigureres.

1. IP på Intel ME firmware. Trykk F9? rett etter BIOS. I utgangspunktet kan Intel ME ligge på samme IP som host, og ta over trafikk på vei inn på maskinen. Av gammel vane liker jeg helst å separere denne trafikken helt.
2. Konfigurer grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet elevator=deadline console=ttyS2,115200n8"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL="console serial"
GRUB_SERIAL_COMMAND="serial --port=0xc000 --speed=115200 --word=8 --parity=no --stop=1"

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Kort forklaring på “–port=0xc000”. Denne finner du ved å kjøre:

# dmesg |grep ttyS2 |grep irq
[ 0.527818] 0000:00:03.3: ttyS2 at I/O 0xc000 (irq = 17, base_baud = 115200) is a 16550A

Ser at det stemmer med

# lspci |grep KT
00:03.3 Serial controller: Intel Corporation 82Q35 Express Serial KT Controller (rev 02)

3. Konfigurer systemd med getty.

# systemctl enable serial-getty@ttyS2.service
# systemctl start serial-getty@ttyS2.service

4. Koble til med amttool / amtterm

# export AMT_PASSWORD=passw0rd
# amttool hostname
### AMT info on machine 'hostname' ###
AMT version: 3.2.3
Use of uninitialized value $domainname in printf at /bin/amttool line 244.
Hostname: hostname.
Powerstate: S0
Remote Control Capabilities:
IanaOemNumber 0
OemDefinedCapabilities IDER SOL BiosSetup
SpecialCommandsSupported PXE-boot HD-boot cd-boot
SystemCapabilitiesSupported powercycle powerdown powerup reset
SystemFirmwareCapabilities 0
# amtterm hostname
amtterm: NONE -> CONNECT (connection to host)
ipv4 hostname [192.168.2.3] 16994 open
amtterm: CONNECT -> INIT (redirection initialization)
amtterm: INIT -> AUTH (session authentication)
amtterm: AUTH -> INIT_SOL (serial-over-lan initialization)
amtterm: INIT_SOL -> RUN_SOL (serial-over-lan active)
serial-over-lan redirection ok
connected now, use ^] to escape

Debian GNU/Linux 8 hostname ttyS2

hostname login:

Kan også nå web interface for å styre power, se på events osv på port 16992. eks http://192.168.2.3:16992/

Kilder:
https://linux.die.net/man/7/amt-howto
https://wiki.debian.org/AMT/SerialOverLan
http://0pointer.de/blog/projects/serial-console.html
https://en.wikipedia.org/wiki/Intel_AMT_versions

Posted in Data, Linux | Tagged , , , , , | 1 Comment

Design RottLAN 2017

Nytt av året blir IPv6 only subnet. Dette vil bli tilgjengelig på egen SSID + utvalgte porter i core+edge switch (forbeholdt vlan støtte).

Posted in Data, Nettverk | Tagged , | Leave a comment

Utvide ZFS pool med ny RAIDZ VDEV

Rimelig rett frem, det vil riktignok ikke være noen rebalansering av data, så dette må en ta seg av selv. Fordelen er jo at kommandoen er ferdig på sekunder og plassen kan utnyttes umiddelbart.

Først kjørte jeg kommandoen med oppsjonen “-n” for å være sikker på at den var korrekt.

# zpool add -n tank raidz ata-HGST_HDN724040ALE640_PK1381PCJSZ50S-part4 ata-HGST_HDN724040ALE640_PK1381PCJT6EWS-part4 ata-HGST_HDN724040ALE640_PK1381PCK3N9DS-part4 ata-HGST_HDN724040ALE640_PK1381PCKZ840S-part4
would update 'tank' to the following configuration:
tank
raidz1
ata-HGST_HDS724040ALE640_PK1334PBGX5SJS-part4
ata-HGST_HDS724040ALE640_PK1334PBGY417S-part4
ata-HGST_HDS724040ALE640_PK1334PBHJT8NP-part4
ata-HGST_HDS724040ALE640_PK1334PBHJT9UP-part4
raidz1
ata-HGST_HDN724040ALE640_PK1381PCJSZ50S-part4
ata-HGST_HDN724040ALE640_PK1381PCJT6EWS-part4
ata-HGST_HDN724040ALE640_PK1381PCK3N9DS-part4
ata-HGST_HDN724040ALE640_PK1381PCKZ840S-part4
logs
mirror
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485213N-part5
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485216D-part5
cache
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485213N-part6
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485216D-part6

Ser riktig ut, så da kjører vi kommandoen.


# zpool add tank raidz ata-HGST_HDN724040ALE640_PK1381PCJSZ50S-part4 ata-HGST_HDN724040ALE640_PK1381PCJT6EWS-part4 ata-HGST_HDN724040ALE640_PK1381PCK3N9DS-part4 ata-HGST_HDN724040ALE640_PK1381PCKZ840S-part4
# zpool status
pool: tank
state: ONLINE
scan: scrub repaired 0 in 21h19m with 0 errors on Sat Aug 15 01:49:26 2015
config:

NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
ata-HGST_HDS724040ALE640_PK1334PBGX5SJS-part4 ONLINE 0 0 0
ata-HGST_HDS724040ALE640_PK1334PBGY417S-part4 ONLINE 0 0 0
ata-HGST_HDS724040ALE640_PK1334PBHJT8NP-part4 ONLINE 0 0 0
ata-HGST_HDS724040ALE640_PK1334PBHJT9UP-part4 ONLINE 0 0 0
raidz1-2 ONLINE 0 0 0
ata-HGST_HDN724040ALE640_PK1381PCJSZ50S-part4 ONLINE 0 0 0
ata-HGST_HDN724040ALE640_PK1381PCJT6EWS-part4 ONLINE 0 0 0
ata-HGST_HDN724040ALE640_PK1381PCK3N9DS-part4 ONLINE 0 0 0
ata-HGST_HDN724040ALE640_PK1381PCKZ840S-part4 ONLINE 0 0 0
logs
mirror-1 ONLINE 0 0 0
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485213N-part5 ONLINE 0 0 0
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485216D-part5 ONLINE 0 0 0
cache
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485213N-part6 ONLINE 0 0 0
ata-Samsung_SSD_840_EVO_250GB_S1DBNSBF485216D-part6 ONLINE 0 0 0

errors: No known data errors
# zpool list tank
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
tank 28.2T 11.8T 16.4T - 9% 41% 1.00x ONLINE -

Posted in Linux | Tagged , , , , , | Leave a comment

Utvide mdadm RAID10

Det var litt lite informasjon via google om dette var støttet. Men det viser seg etter litt graving at dette går fint så lenge RAID10 settet er opprettet via mdadm 3.3

Selve utvidelsen er rimelig rett frem.


# cat /proc/mdstat
md1 : active raid10 sda3[0] sdc3[2] sdd3[3] sdb3[1]
195179520 blocks super 1.2 512K chunks 2 near-copies [4/4] [UUUU]

# mdadm --manage /dev/md1 --add /dev/sde3 /dev/sdf3 /dev/sdg3 /dev/sdh3
# mdadm --grow --raid-devices=8 /dev/md1
# cat /proc/mdstat
md1 : active raid10 sdh3[7] sdg3[6] sdf3[5] sde3[4] sda3[0] sdc3[2] sdd3[3] sdb3[1]
195179520 blocks super 1.2 512K chunks 2 near-copies [8/8] [UUUUUUUU]
[>....................] reshape = 0.1% (339584/195179520) finish=9.5min speed=339584K/sec

Posted in Data, Linux | Tagged , , , , | Leave a comment

ODROID-C1 NTP Server

odroidc1-gpsBased on the gps receiver from hab supplies, the work of jgilje and debian jessie I have been able to compile a minimal image which can work as a Stratum-1 ntp server.

The image itself is ~90MB compressed, and contains a minimal installation of debian jessie, kernel from hardkernel with the pps-gpio patch from jgilje. ntp package was recompiled and is held from future updates. ntpd is preconfigured to use NMEA(127.127.20.0) driver with PPS sync. And udev rules to create the apropriate devices for ntpd to use. I also removed all of the dvb drivers in the kernel provided by hardkernel.

odroidc1-gps1If you want to relocate the PPS signal to a different gpio pin, this can be done by altering the meson8b_odroidc.dts file and compiling it to an apropriate .dtb file.

Image can be written to memory card using win32diskimager or dd, it will use dhcp for network configuration. Only user enabled is root with the password root. Framebuffer should also work, so you can connect it to a screen and configure it locally.

Things to do at first boot. Use fdisk to delete partition 2, and recreate the partition with the same size as the sd-card. Then resize the root partition.

Please note that on cold boot, it will take some time to lock onto the PPS.

Sources:
https://github.com/jgilje/pps-gpio-amlogic
http://ava.upuaut.net/store/index.php?route=product/product&path=59_60&product_id=117

Download:
odroidc1.img

Some ntpd output.


root@odroid-c1:~# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
+ntp.fnutt.net 192.36.134.17 2 u 5 64 377 11.512 0.230 0.812
+2.81-166-42.cus 85.89.3.25 2 u 36 64 377 4.607 -0.430 0.612
+langbein.monslo 129.242.4.241 2 u 40 64 377 15.449 -1.063 0.953
-ntp-ext.cosng.n 146.213.3.181 2 u 24 64 377 14.528 1.604 1.253
oGPS_NMEA(0) .GPS. 0 l 12 16 377 0.000 -0.001 0.001


root@odroid-c1:~# ntpq -c rl
associd=0 status=0415 leap_none, sync_uhf_radio, 1 event, clock_sync,
version="ntpd 4.2.6p5@1.2349-o Mon May 25 18:52:44 UTC 2015 (1)",
processor="armv7l", system="Linux/3.10.75", leap=00, stratum=1,
precision=-20, rootdelay=0.000, rootdisp=0.354, refid=GPS,
reftime=d90ed892.9bbc5b1d Tue, May 26 2015 11:33:38.608,
clock=d90ed89b.4cfcafe8 Tue, May 26 2015 11:33:47.300, peer=59860, tc=4,
mintc=3, offset=-0.001, frequency=9.542, sys_jitter=0.001,
clk_jitter=0.001, clk_wander=0.000

Posted in Data, Linux, Nettverk | Tagged , , , , , | 2 Comments

Design RottLAN 2015

Ikke veldig mye har forandret seg siden 2012, men noen nye ting er det.

  • Alle får dualstack (IPv4 / IPv6 ) addresser. IPv6 addressene er _helt_ åpne fra utsiden, mens IPv4 addressene er NATet.
  • TV VLAN fra Risnes er tatt ut over trådløs link til RIX. Kan hvis ønskelig dras ned til “rix-s03”

rottlan2015_network2

 

Posted in Data, Nettverk | Tagged , , , , , , , | 4 Comments

CactiEZ tom for plass.

Innimellom så begynner CactiEZ å logge masse, og da går en tom for plass. For å ikke ødelegge grafene er trikset å restore en gammel backup. Også sørge for at poller_output cachen blir opprettet på ny i mysql.


# /etc/init.d/httpd stop
# cd /
# tar zxvf /var/www/backups/cacti-backup-2015-03-08.tar.gz
# mysql -ppassord cacti < /var/www/html/cacti-backup.sql # mysql -ppassord syslog < /var/www/html/syslog.sql # cd /var/www/html/cli/ # php repair_database.php

Så for å gjenskape mysql output tabellen.

use cacti;
truncate poller_output;

Denne bruker typisk hvis du ser

03/10/2015 02:29:07 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1017', SQL:"select poller_output.output, poller_output.time, UNIX_TIMESTAMP(poller_output.time) as unix_time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name) LIMIT 10000"

i loggene.

Posted in Data, Linux | Tagged , , | Leave a comment

bad-block-list i mdadm

For fremtidige mdadm raid(Blir mest sannsynligvis ZoL uansett), så kan det aktiveres bad-block-list. Dette skal visstnok kunne gjøre at man får lest ut ett mdadm raid selv om det skulle være noen bad-blocks.

Gjelder mdadm 3.3 og kernel 3.1

To add a bbl to a pre-existing array you need to assemble with “–update=bbl”. You cannot hot-add a BBL at present.

http://lwn.net/Articles/608967 <-- scroll ned til Neil Brown sitt innlegg (Aug 20, 2014 1:44 UTC).

Posted in Data, Linux | Tagged , , , , | Leave a comment

CentOS 5 iSCSI target

På arbeidsstasjonen min har jeg en liten 120GB SSD disk, som blir litt for liten når den er delt mellom fedora og windows. Dette igjen betyr at jeg ikke har plass til å bruke windowsen til det den var tiltenkt(spill). Så løsningen ble for min del å lage en “sparse” fil som jeg igjen delte ut via iSCSI fra CentOS serveren min, og monterte denne igjen i windows. Dermed har jeg nå 400GB tilgjengelig uten at jeg bruker mer enn hva filene som ligger i “sparse” filen faktisk opptar.

Så over til smådetaljene.

root@server:/root $ yum install scsi-target-utils
root@server:/root $ cd /etc/tgt/
root@server:tgt $ vi targets.conf
<target iqn.2014-05.fluxxx.lan:workstation.target1>
backing-store /export/iscsi/workstation.img
</target>
root@server:iscsi $ dd if=/dev/zero of=workstation.img bs=1 count=0 seek=400G
root@server:iscsi $ /etc/init.d/tgtd start
root@server:iscsi $ chkconfig tgtd on

Da er i teorien iSCSI delt ut, så kan vi få det verifisert med kommandoen.

root@server:tgt $ tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2014-05.fluxxx.lan:workstation.target1
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Readonly: No
Backing store type: null
Backing store path: None
Backing store flags:
LUN: 1
Type: disk
SCSI ID: IET 00010001
SCSI SN: beaf11
Size: 429497 MB, Block size: 512
Online: Yes
Removable media: No
Readonly: No
Backing store type: rdwr
Backing store path: /export/iscsi/workstation.img
Backing store flags:
Account information:
ACL information:
ALL

Hvor mye plass er faktisk i bruk av selve “sparse” filen.

root@server:iscsi $ du -sh workstation.img
30G workstation.img
root@server:iscsi $ du -sh --apparent-size workstation.img
400G workstation.img

Posted in Data, Linux, Nettverk | Tagged , , , , , , | Leave a comment