Wojciech Błaszkowski

Motto: trust, but check

Archive for the 'Linux' Category

Adaptec 3405 - remote array creating

The mission:
Add 2 SATA II disks in machine with Adaptec 3405, upgrade controller’s firmware/BIOS too.

The hardware:
Adaptec 3405 with 2 SAS MAX3147RC disks as RAID 1, I added 2 WD7500AYYS-01RCA SATA disks wich we need to merge on RAID 1 as let’s say a backup place.

Notice:
As usually, exaple will be made on machine powerd by PLD Linux ;-)

Build/install package arcconf. In my example: arcconf-5.30-1.x86_64.rpm and check what we’ve got on board.

# arcconf GETVERSION
Controllers found: 1
Controller #1
==============
Firmware : 5.2-0 (15611)
Staged Firmware : 5.2-0 (15611)
BIOS : 5.2-0 (15611)
Driver : 1.1-5 (2437)
Boot Flash : 5.2-0 (15611)

Command completed successfully. So, we’ve got one Adaptec 3405 device, it’s ID is 1. That ID will be useful later. Check device status:


# arcconf GETSTATUS 1
Controllers found: 1
Logical device Task:
Logical device : 0
Task ID : 100
Current operation : Rebuild
Status : In Progress
Priority : High
Percentage complete : 28
Command completed successfully.

To make things more interesting, I purposefully removed out one of the SAS disks for a feew seconds ;-) Simulation of array damage. Let’s put SATA disks, and upgrade controller’s software.


# wget http://download.adaptec.com/raid/asr/fw_bios/3405_fw_b15728.exe
# unzip 3405_fw_b15728.exe
# ls -lh
razem 2,5M
-rw-r--r-- 1 root root 256K kwi 1 17:44 acusas.exe
-rw-r--r-- 1 root root 196K kwi 1 17:44 afu.exe
-rw-r--r-- 1 root root 629K kwi 1 17:44 as340501.ufi
-rw-r--r-- 1 root root 1,4M kwi 1 17:44 as340502.ufi
-rw-r--r-- 1 root root 2,9K kwi 5 18:12 Relnotes.txt
-rw-r--r-- 1 root root 82 cze 11 00:32 UcliEvt.log

OK, let’s do it !

# arcconf ROMUPDATE 1 as3405
Controllers found: 1
You must restart the system for firmware updates to take effect.
Are you sure you want to continue?
Press y, then ENTER to continue or press ENTER to abort: y
Updating controller 1 firmware...Succeeded
A new software image has been applied to controller 1.
Command completed successfully.

What was done ?

# arcconf GETVERSION 1
Controllers found: 1
Controller #1
==============
Firmware : 5.2-0 (15611)
Staged Firmware : 5.2-0 (15728)
BIOS : 5.2-0 (15611)
Driver : 1.1-5 (2437)
Boot Flash : 5.2-0 (15728)
Command completed successfully.

We need to reboot our machine to set the changes, will do that later. Let’s check added disks.


# arcconf GETCONFIG 1
Device #2
Device is a Hard drive
State : Ready
Supported : Yes
Transfer Speed : SATA 3.0 Gb/s
Reported Channel,Device : 0,2
Reported Location : Connector 0, Device 2
Vendor : WDC
Model : WD7500AYYS-01RCA
Firmware : 30.04G30
Serial number : WD-WCAPT0615906
Size : 715404 MB
Write Cache : Unknown
FRU : None
S.M.A.R.T. : No
Device #3
Device is a Hard drive
State : Ready
Supported : Yes
Transfer Speed : SATA 3.0 Gb/s
Reported Channel,Device : 0,3
Reported Location : Connector 0, Device 3
Vendor : WDC
Model : WD7500AYYS-01RCA
Firmware : 30.04G30
Serial number : WD-WCAPT0636669
Size : 715404 MB
Write Cache : Unknown
FRU : None
S.M.A.R.T. : No

All OK, since now, we can create new array. The arcconf’s help, suggests to type:

arcconf CREATE 1 LOGICALDRIVE Name BACKUP Rcache RON Wcache WB Size MAX Raid1 Channel0 ID2 Channel0 ID3

so, we type:

# arcconf CREATE 1 LOGICALDRIVE Name BACKUP MAX 1 0 2 0 3
Controllers found: 1
Do you want to add a logical device to the configuration?
Press y, then ENTER to continue or press ENTER to abort: y
Creating logical device: BACKUP
Command completed successfully.

The dmesg will tell us, that there is a new device added, in my example it was /dev/sdb - all done ;)

reaktywacja mdadm

Po aktualizacji kernela dla PLD Ac do kernel-grsecurity-2.6.16.60-10.i686 przyszedł mail z informacją od mdadm - wyleciał jeden z dysków. Co zrobić ?

# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 hdb1[0] hda1[1]
96256 blocks [2/2] [UU]
md1 : active raid1 hda3[1]
38523776 blocks [2/1] [_U]
unused devices:<none>

Reakcja:
# mdadm /dev/md1 -a /dev/hdb3
mdadm: re-added /dev/hdb3
# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 hdb1[0] hda1[1]
96256 blocks [2/2] [UU]md1 : active raid1 hdb3[2] hda3[1]
38523776 blocks [2/1] [_U]
[>....................] recovery = 0.0% (3328/38523776) finish=377.6min speed=1664K/sec
unused devices:<none>

Rebuild raida nie zajął więcej niż 120 minut.

Szukamy winnego:
w /var/log/kernel znajduję:

Apr 27 09:13:17 exploder kernel: hda: hda1 hda2 hda3
Apr 27 09:13:17 exploder kernel: hdb: max request size: 512KiB
Apr 27 09:13:17 exploder kernel: hdb: 78242976 sectors (40060 MB) w/2048KiB Cache, CHS=16383/255/63, UDMA(100)
Apr 27 09:13:17 exploder kernel: hdb: cache flushes supported
Apr 27 09:13:17 exploder kernel: hdb: hdb1 hdb2 hdb3
Apr 27 09:13:17 exploder kernel: SGI XFS with ACLs, security attributes, large block numbers, no debug enabled
Apr 27 09:13:17 exploder kernel: SGI XFS Quota Management subsystem
Apr 27 09:13:17 exploder kernel: md: md1 stopped.
Apr 27 09:13:17 exploder kernel: md: bind
Apr 27 09:13:17 exploder kernel: md: bind
Apr 27 09:13:17 exploder kernel: md: kicking non-fresh hdb3 from array!
Apr 27 09:13:17 exploder kernel: md: unbind
Apr 27 09:13:17 exploder kernel: md: export_rdev(hdb3)
Apr 27 09:13:17 exploder kernel: raid1: raid set md1 active with 1 out of 2 mirrors

co sugeruje, że raid nie poskładał się przy starcie systemu i problem istniał już przed podmianą kernela. Sugestia: pamiętaj o wpisaniu poprawnego adresu e-mail MDADM_EMAIL w /etc/sysconfig/mdadm.

PLD Th: niektóre pakiety na ftp zostały podpisane

Niektórzy z Was już zapewne zauważyli podczas upgradu/instalacji:

Installing set #2
Processing dependencies...
geninitrd-9000.4-2.noarch obsoleted by geninitrd-9000.5-2.noarch
There are 1 package to install, 1 to remove:
I geninitrd-9000.5-2.noarch
R geninitrd-9000.4-2.noarch
Need to get 38.9KB of archives (38.9KB to download).
After unpacking 70.2KB will be used.
Retrieving th::geninitrd-9000.5-2.noarch.rpm...
.............................. 100.0% [39.1K (39.1K/s)]
Executing rpm –upgrade -vh –root / –noorder…
warning: /root/.poldek-cache/ftp_ftp.th.pld-linux.org.dists.th.PLD.noarch.RPMS/geninitrd-9000.5-2.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e4f1bc2d
Preparing… ########################################### [100%]
Repackaging…
1:geninitrd ########################################### [100%]
Upgrading…
1:geninitrd ########################################### [100%]

Tradycyjnie, docelowo wszystkie paczki będą podpisane. Klucz leży na FTP.
Paczki możemy podpisać w sposób:

[root@conflux ~]# wget ftp://master-ftp.pld-linux.org/dists/3.0/PLD-3.0-Th-GPG-key.asc
[root@conflux ~]# rpm –import PLD-3.0-Th-GPG-key.asc
[root@conflux ~]# rpm -qi gpg-pubkey > PLD-3.0-Th-GPG-key.txt

Poprzednio dla Ac opisał to Andrzej ‘The Undefined’ Dopierała.

bcm43xx firmware

po zakupie nowego lapa (DELL Vostro 1500) przyszła pora na wyrzucenie domyślnie zainstalowanej visty home i zainstalowanie PLD.
mały problem z WiFi został szybko rozwiązany specami autorstwa arekm.

dzięki temu uruchomienie całości zprowadza się do:
- zbudowania bcm43xx-fwcutter.spec
- zainstalowanie powyższego
- zbudowania bcm43xx-firmware.spec
- zainstalowania powyższego
- usunięcia bcm43xx (jeśli udev już go wrzucił)
- załadowania bcm43xx

karta wifi:
0c:00.0 Network controller: Broadcom Corporation BCM94311MCG wlan mini-PCI (rev 01)
dmesg po załadowaniu drivera i podniesieniu sieci zeznaje:
bcm43xx: Chip ID 0x4311, rev 0x1
bcm43xx: Number of cores: 4
bcm43xx: Core 0: ID 0x800, rev 0x11, vendor 0x4243
bcm43xx: Core 1: ID 0x812, rev 0xa, vendor 0x4243
bcm43xx: Core 2: ID 0x817, rev 0x3, vendor 0x4243
bcm43xx: Core 3: ID 0x820, rev 0x1, vendor 0x4243
bcm43xx: PHY connected
bcm43xx: Detected PHY: Analog: 4, Type 2, Revision 8
bcm43xx: Detected Radio: ID: 2205017f (Manuf: 17f Ver: 2050 Rev: 2)
bcm43xx: Radio turned off
bcm43xx: Radio turned off
Device driver eth1 lacks bus and class support for being resumed.
bcm43xx: PHY connected
Device driver 0000:0c:00.0 lacks bus and class support for being resumed.
Device driver 0000:0c:00.0 lacks bus and class support for being resumed.
Device driver 0000:0c:00.0 lacks bus and class support for being resumed.
Device driver 0000:0c:00.0 lacks bus and class support for being resumed.
bcm43xx: Microcode rev 0x127, pl 0xe (2005-04-18 02:36:27)
bcm43xx: Radio turned on
bcm43xx: Radio enabled by hardware
bcm43xx: Chip initialized
bcm43xx: 32-bit DMA initialized
bcm43xx: Keys cleared
bcm43xx: Selected 802.11 core (phytype 2)
ADDRCONF(NETDEV_UP): eth1: link is not ready
bcm43xx: set security called, .level = 0, .enabled = 0, .encrypt = 0
bcm43xx: set security called, .level = 0, .enabled = 0, .encrypt = 0
bcm43xx: set security called, .level = 0, .enabled = 0, .encrypt = 0
bcm43xx: set security called, .level = 0, .enabled = 0, .encrypt = 0
SoftMAC: Open Authentication completed with xx:xx:xx:xx:xx:xx
ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
bcm43xx: set security called, .active_key = 0, .level = 2, .enabled = 1, .encrypt = 1
bcm43xx: set security called, .enabled = 1, .encrypt = 1
eth1: no IPv6 routers present

WL-5460AP

Kolejny router jaki dostałem w swoje łapki. Model o którym mowa dostarczony został przez jedną z chojnickich firm ISP do domu moich rodziców kilka miesięcy temu, więc trzeba sprawdzić co jest w środku rzeczonego pudełka.

Logowanie do panelu (monter ISP nie ustawił hasła !) przebiegło standardowo, po porcie 80.
nmap zeznał (MAC umyślnie zmieniony):

# nmap 192.168.2.1

Starting Nmap 4.20 ( http://insecure.org ) at 2007-09-22 16:09 CEST
Interesting ports on 192.168.2.1:
Not shown: 1695 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
MAC Address: XX:XX:XX:XX:XX:XX (Unknown)

Więc trzeba będzie zalogować się również via ssh, ale to później.

Router pracuje jako gateway dla PPPoE. Mamy tu możliwość wyrzucenia sieci w powietrze z kodowaniem WPA2 (z czego oczywiście skorzystałem), firewall, DDNS, port forwarding (wiele modeli innych firm nadal tego nie ma !), traffic control (podział łącza). Moją szczególną uwagę w menu GUI zwróciła opcja Management -> System Command. Polecenie uname nie przyniosło niestety spodziewanego rezultatu, więc trzeba było spróbować zalogować się na porcie 22. Problemem było hasło. Rozwiązanie proste i szybkie: wykorzytujemy wiersz poleceń dostępny w GUI i wpisujemy:

cat /etc/passwd

na co dostajemy odpowiedź:

root:$1$$oCLuEVgI1iAqOA8pwkzAg1:0:0:root:/:/bin/sh
nobody:x:99:99:Nobody:/:

google zdradzają, że:

$1$$oCLuEVgI1iAqOA8pwkzAg1 = root

i hasło gotowe :)

$ ssh root@192.168.2.1
root@192.168.2.1's password:

BusyBox v1.01 (2006.03.31-16:15+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

Zatem to podstarzała wersja BusyBox. Wnętrzności routera:

# cat /proc/cpuinfo
system type : Philips Nino
processor : 0
cpu model : R3000 V0.0
BogoMIPS : 178.99
wait instruction : no
microsecond timers : no
tlb_entries : 64
extra interrupt vector : no
hardware watchpoint : no
VCED exceptions : not available
VCEI exceptions : not available
ll emulations : 0
sc emulations : 0

# cat /proc/meminfo
total: used: free: shared: buffers: cached:
Mem: 14639104 12832768 1806336 0 159744 7708672
Swap: 0 0 0
MemTotal: 14296 kB
MemFree: 1764 kB
MemShared: 0 kB
Buffers: 156 kB
Cached: 7528 kB
SwapCached: 0 kB
Active: 1516 kB
Inactive: 7892 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 14296 kB
LowFree: 1764 kB
SwapTotal: 0 kB
SwapFree: 0 kB

W mojej opinii router ten to raczej udana konstrukcja. Niewielki, funkcjonalny, bezawaryjny (jak dotąd).

Next Page »