| orm@doc-tcpip.org | Erstellt: August 2003 - Letzte Modifikation: August 2010 |
Die Vorlage für diesen Spickzettel habe ich irgendwann mal zugeschickt bekommen, ich weiß also nicht, wer ihn ursprünglich zusammen gestellt hat. Ich führe diese gute Vorlage jedenfalls einfach weiter...
compress -c file.txt > file.Z Standardtool zum Komprimieren, besser gzip. uuencode in_file mein_filename > ascii_file Konvertiert ein Binärfile in ein ASCII kodiertes File, dass man per Mail versenden kann. uudecode ascii_file Konvertiert das ASCII File zurück, der Name ist dann mein_filename. Filesystem: od -c /tmp Zeigt den Inhalt des Verzeichnisses, eigenwilliges Format. ls -i Dateien und die Inode-Nummer. echo * Listet alle Dateien, unformatiert. Welche Dateien belegen den Platz in einem Filesystem? du -smx Setzen von Timezone und Sprache: chtz MEZ-1MESZ,M3.5.0,M10.5.0/03:00:00 Setzt TZ Variable in /etc/environment. chlang en_US Setzt LANG Variable in /etc/environment. ar -v -t mein_archive Inhalt (wie tar tvf) ar -v -x mein_archive Extrahieren (wie tar xvf) (Man kann so den Inhalt der Library Files sehen in /usr/lib) find /quelle_dir -print | cpio -pdm /ziel_dir Kopiert ein Direktory komplett. dump -nTv binary_file Zeigt den Inhalt eines Binary an (Loader Section, Symbole etc.) dump -c Zeigt alle Strings. dump -o Objekt File Header dump -l Mit Zeilennummern dump -s Text Teil des Binary snap -ao /dev/rmt0 Snap auf einem Tape erzeugen. snap -ad /opt/zeug Snap in dieses Verzeichnis - sonst (/tmp/ibmsupt) /usr/dt/bin/dtconfig -d Desktop Login Abschalten /usr/dt/bin/dtconfig -e und Anschalten /var/dt/Xpid PID des DTlogin Prozess _____________ ODM HANDLING Pd** ==> Predefined Attributes Cu** ==> Customized Attributes (also interessant) Query: odmget -q name=hdisk0 CuDv Suchen in "Customized Devices" nach der Hdisk 0. Man kann auch so SQL artig suchen: odmget -q "name like hdisk?" CuDv - Es geht auch "name like xxx and blabloe like yyyy"
lslicense Anzahl der User Lizenzen
chlicense -u anzahl Ändern der Anzahl
oslevel Betriebsystemstand
4 . 3 . 3 . 0 <--------- Preventive Maintenance Level
| | |
| | +----------------Modification
| +--------------------Release
+------------------------Version
oslevel -q Zeigt alle bekannten ML
oslevel -r Zeigt den "recommended" ML
5300-06 <---------------Recommended Maintenance Level
oslevel -s Zeigt das Service Pack
5300-06-02-0727 <--------Service Pack und Fixpack
oslevel -r -l xxxx-xx Zeigt alle "downlevel" Filesets für diesen ML
oslevel -r -g xxxx-xx Zeigt alle "uplevel" Filesets für diesen ML
(-l und -g werden mit -q, -r und -s kombiniert und zeigen ML, rML und SP an)
oslevel -rq (-sq) Zeigt alle bekannten, aber vielleicht unvollständigen ML/SP
(für oslevel -r -l z.B.)
whence, whereis Zeigt Pfad zum Programm
what Zeigt Eigenschaften des Binary an.
lslpp -L all Welche Software ist installiert?
lslpp -L fileset_name Ist dieses Fileset installiert?
lslpp -f fileset_name Welche Files gehören zu diesem Fileset?
lslpp -ha Installationshistorie
lslpp -w /etc/ifconfig Zu welchem Fileset gehört dieses File?
lppchk -c Vergleicht Prüfsummen mit der SWVPD
lppchk -l Vergleicht symbolische Links mit der SWVPD
instfix -ik IY74567 Ist dieser Fix installiert?
instfix -aik IY74567 Beschreibung des Fix
instfix -ivk IY74567 Beschreibung und installierte Filesets
instfix -ik 4330-02_AIX_ML Ist dieser ML komplet installiert?
instfix -i | grep ML Welche MLs sind installiert?
instfix -k IY54794 -d /mount/cd0 Installiert diesen Fix.
/usr/sys/inst.images/ Hier liegen die Images, Bundles etc.
Installation auf eine zweite Platte:
alt_disk_install -c hdisk1 Clones a running rootvg onto hdisk1
alt_disk_install -w Wakes up alt vg
alt_disk_install -s Sends alt vg to sleep !
alt_disk_install -x Removes alt vg from disk
installp -ad Device Fileset Level Installieren mit Apply und Commit
installp -pad Device Fileset Level Preview (macht also nichts)
installp -u Fileset Entfernen von Filesets
installp -ld Device Welche Software findet sich auf dem Device
installp -C Zum Aufräumen nach Problemen.
RPM - RedHat Packet Manager - Linux Comp.
Ab 5L ist Linux-rpm unterstützt (für Software aus der Linux-Toolbox).
Installiert man über SMIT, geht es automatisch, sonst so:
Was ist installiert (lslpp -l bei "normalem" AIX):
# rpm -qlp meine_software.ppc.rpm
# rpm -qa
Was ist die aktuell installierte Version eines Paketes?
(Name des Paket, Version, Release)
# rpm -q meine_software
Zu welchem Paket gehört das File (wie lslpp -w):
# rpm -qf /usr/bin/ein_file
(umfassende Info mit -i)
In welchen Paketen ist das File dokumentiert?
# rpm -qdf /usr/bin/meine_software
Welche Files sind in einem Paket drin:
# rpm -qpl meine_software.ppc.rpm
Daselbe für ein installiertes rpm Paket:
# rpm -ql meine_software
Ein Paket installieren:
# rpm -ivh meine_software.ppc.rpm
# rpm -i ftp://ftp.example.com/pub/RPMS/meine_software.rpm
Ein vorhandenes Paket in einer neuern Version installieren (Update):
# rpm -Uvh meine_software.ppc.rpm
Ein Paket deinstallieren:
# rpm -e meine_software.ppc.rpm
Die Beschreibung des Paketes ausgeben:
# rpm -qip meine_software.ppc.rpm
Welche Pakete braucht mein Paket, damit ich installieren kann?
# rpm -qpR meine_software.rpm
Wenn das Paket schon installiert ist:
# rpm -qR meine_software
RPM kann man in einer ganzen Reihe Files konfigurieren:
/usr/lib/rpm/rpmrc, /etc/rpmrc und ~/.rpmrc
Das läßt man sich so anzeigen:
# rpm --showrc
/usr/share/lib/terminfo Directory with all support terminal info files.
tty Displays what the tty/pty number of the terminal is.
termdef reports the termtype setup in smit for the tty port
that termdef is run on.
chdev -l (device eg tty1) -a term=vt100 Sets tty to a vt100 terminal type
penable tty0 adds getty line into /etc/inittab for tty0 and starts getty
pdisable tty0 disables the getty line and disables getty
penable / pdisable -a option is for all
stty erase ^? Set backspace key for vt100 terminals
stty erase ^H Set backspace key for wyse50 terminals
lscons Displays the console device
chcons -a login=enable (device eg /dev/tty1) Changes the console device
lsdisp Display adapter device information
chdisp Change default display used by LFT subsystem
Create ttys on ports 0 to 7 on adapter sa2 :-
for i in 0 1 2 3 4 5 6 7
do
mkdev -c tty1 -t tty -s rs232 -p sa2 -w$i -a login=enable -a term=vt100
done
portmir -t /dev/tty0 Mirror current terminal onto /dev/tty0
portmir -o Turns off port mirroring
Pseudoterminals: PTY
Alles, was rlogin, telnet, ssh, aixwindows (X).
/dev/ptc /dev/pts
Es werden succesive alle /dev/pts/1 ... x rausgegeben.
smitty pty um die Anzahl zu erhöhen.
host IP oder Hostname Namensauflösung
hostname Zeigt (und setzt) Namen der Maschine
lsdev -Cc if Listet alle Network Interfaces
chdev -l inet0 -a hostname=mein_hostname Setzt Hostname
ifconfig (device name) Displays network card settings
ifconfig (device name) up Turns on network card
chdev -l (device name) -a state=up Turns on network card
ifconfig (device name) down Turns off network card
ifconfig (device name) detach Removes the network card from the
network interface list
ifconfig lo0 alias 195.60.60.1 Create alias ip address for loopback
route (add/delete) (-net/-host) (destination) (gateway)
Adds or deletes routes to other networks or hosts, does not update
the ODM database and will be lost at reboot.
route add -net 194.60.89.0 194.60.90.4
chdev -l inet0 -a "net,-hopcount,1,-netmask,255.255.255.0,207.156.168.0,10.0.15.254"
(destination) ( gateway )
Adds route and adds entry into ODM, route survives a reboot,
route -rn Display route table
odmget -q "attribute=route" CuAt Displays routes in the ODM.
lsattr -EHl inet0 Displays routes set in ODM and hostname
odmget -q "name=inet0" CuAt Displays routes set in ODM and hostname
refresh -s inetd Refresh inetd after changes to inetd.conf
kill -1 (inetd PID) Refresh inetd after changes to inted.conf
netstat -i Displays interface statistics
entstat -d (ethernet adapter eg en0) Displays ethernet statistics
arp -a Displays ip to mac address table from arp cache
no -a Displays network options use -o to set individual options or
-d to set individual options to default.
no -o option=value (this value is reset at reboot)
no -o "ipforwarding=1"
Setzt man in alten Systemen in der rc.net, in neuen in /etc/tuning
traceroute (name or ipaddress) Displays all the hops from source to
destination supplied.
ping -R (hostname or ipaddress) Same as traceroute except repeats.
spray (hostname or ipaddress) Send a stream of packets to a host
stopsrc -g tcpip Stops all running TCP/IP daemons
/etc/tcp.clean Stops all running TCP/IP daemons and removes all
lock files
/etc/rc.tcpip Start all TCP/IP daemons.
Do not use startsrc -g tcpip as this will start all
TCP/IP daemons including routed & gated
Kommando mktcpip ==> Einträge in die ODM.
In der ODM Einträge in die CuAt:
inet0 ==> Hostname und Routing Informationen
en0/tr0 ==> Network Adresse und Netzmaske
ent0/tok0 ==> Kabel Typ, Ring Speed
==> odmget -q "name=en0" CuAt
Tcpip Deamons werden vom inetd, SRC (rc.tcpip), oder inittab gestartet.
Der SRC wird aus der inittab gestartet.
lssrc -a ==> alle Subsysteme, die der SRC kontrolliert.
startsrc, stopsrc -s deamonname
refresh -s deamonname
(es ist nicht nötig, mit den Prozess ID zu operieren).
Routen: Statisch
smit mkroute ==> chdev -l inet0 -a route=destination,quelle
Schreibt in die ODM.
Nutzt man das route-Kommando, so sind die Routen nach einem Reboot weg.
Routen löschen:
chdev -l inet0 -a delroute=destiantion,gateway
Aus der Kernel-Routing Table:
route delete -net destiantion gateway
Flushen (leeren) der Kernel Routing Table: route -nf
Welche routen sind in der ODM?
odmget -q "attribute=route" CuAt
Dynamisches Routing:
Rechnerseitig ==> smitty routed
Startet das routed Subsystem (also den routed).
Auf Router Seite ==> /etc/gateways wegen der Initial Routen.
Destination Gateway Gateway_Metric Metric
Routed kann RIP, Gated kann mehrere Protokolle.
exportfs Lists all exported filesystems exportfs -a Exports all fs's in /etc/exports file exportfs -u (filesystem) Un-exports a filesystem mknfs Configures and starts NFS services rmnfs Stops and un-configures NFS services mknfsexp -d /directory Creates an NFS export directory mknfsmnt Creates an NFS mount directory mount hostname:/filesystem /mount-point Mount an NFS filesystem nfso -a Display NFS Options nfso -o option=value Set an NFS Option nfso -o nfs_use_reserved_port=1 showmount -a [hostname] zeigt alle NFS Mounts showmount -d [hostname] zeigt alle Directories, die von Clients gemountet wurden showmount -e [hostname] zeigt alle exportierten Verzeichnisse (die lokale Information findet man auch in /etc/rmtab und /etc/xtab)
MKSYSB
------
mkszfile -f Creates /image.data file (4.x onwards)
mkszfile -X Creates /fs.size file (3.x)
mksysb -i (device of file) Creates a mksysb image
mksysb does not save any raw data and will not backup a filesystem that
is not mounted.
mksysb -s
rootvg: 3 Blocks, die das Band bootfähig machen.
SAVEVG
------
savevg -if (device or file) (vg) Creates a savevg image
restvg -q -f (device or file) Restore from a savevg image
Ensure that the restvg command is run from /
mkvgdata (vg) Creates new vgname.data file
CPIO ARCHIVE
------------
find (filesystem) -print | cpio -ocv > (filename or device)
eg find ./usr/ -print | cpio -ocv > /dev/rmt0
CPIO RESTORE
------------
Es gibt unter AIX 2 cpio Binaries - ein SysV und ein BSD cpio:
/usr/sysv/bin/cpio
/usr/bin/cpio
Man hat oft Probleme mit cpio-Archiven, die auf Linux oder SUN
erzeugt wurden.
Das Flag -c wird nur bei Archiven benutzt, die auch mit -c erzeugt
wurden (Header Information ist dann in ASCII).
cpio -ict < (filename or device) | more Gibt die Filenamen.
cpio -icv < (filename or device) Ausgabe wie ls -l.
cpio -icdv < (filename or device)
cpio -icdv < (filename or device) ("files or directories to restore")
eg cpio -icdv < /dev/rmt0 "tcpip/*" Restore directory and contents
cpio -icdv < /dev/rmt0 "*resolve.conf" Restore a named file
Bei der SysV Version kann man mit -I statt der Umleitung arbeiten.
Bekommt man Fehler mit .. out of Phase ... sollte man mal das SysV Binary
probieren.
TAR ARCHIVE
-----------
tar -cvf mein_tar.tar /was/getarrt/werden_soll
TAR RESTORE
-----------
tar -tvf mein.tar oder /dev/rmt0 Lists archive
tar -xvf mein.tar oder /dev/rmt0 Restore all
tar -xvf mein.tar /nur/dieses/spezielle/file (mit ganzem Pfad).
use -p option for restoring with orginal permissions
eg tar -xvf /dev/rmt0 "tcpip" Restore directory and contents
tar -xvf /dev/rmt0 "tcpip/resolve.conf" Restore a named file
Mit -C kann man während der Ausführung des tar-kommandos das Verzeichnis
wechseln. Man muß dabei immer den für tar aktuellen Standort bedenken...
cd /usr
tar -cvf/dev/rmt0 -C./include . -C ../bin .
AIX ARCHIVE
-----------
find (filesystem) -print | backup -iqvf (filename or device)
Backup mit filename, absoluter Pfad.
find /usr/ -print | backup -iqvf /dev/rmt0
Relativer Pfad:
cd /xxx
find . | backup -if /dev/rmt0
backup -(backup level 0 to 9) -f (filename or device) ("filesystem")
Backup by inode.
backup -0 -f /dev/rmt0 "/usr" -u option updates /etc/dumpdates file
backup -0 -uf /dev/rmt0 /xxx (Level 0)
Exclude File:
/etc/exclude.rootvg ==> /home/loser
/zeug
/plunder
AIX RESTORE
-----------
restore -qTvf (filename or device) Lists archive
restore -qvxf (filename or device) Restores all
restore -qvxf (filename or device) ("files or directories to restore")
(use -d for restore directories)
restore -qvxf /dev/rmt0.1 "./etc/passwd" Restore /etc/passwd file
restore -s4 -qTvf /dev/rmt0.1 Lists contents of a mksysb tape
BACKUPS ACROSS A NETWORK
------------------------
To run the backup on a local machine (cpio) and backup on the remote
machine's (remhost) tape drive (/dev/rmt0)
find /data -print | cpio -ocv | dd obs=32k | rsh remhost \
"dd ibs=32k obs=64k of=/dev/rmt0"
To restore/read the backup (cpio) on the remote machine
dd ibs=64k if=/dev/rmt0 | cpio -icvt
To restore/read the backup (cpio) on the local machine from the remote
machine's (remhost) tape drive (/dev/rmt0)
rsh remhost "dd ibs=64k obs=32k if=/dev/rmt0" | dd ibs=32k \
| cpio -icvt
To run the backup (cpio) on a remote machine (remhost) and backup to
the local machines tape drive (/dev/rmt0)
rsh remhost "find /data -print | cpio -ocv | dd ibs=32k" \
| dd ibs=32k obs=64k of=/dev/rmt0
tar cBf - . | rsh remhost "dd ibs=512 obs=512 of=/dev/rmt0"
Same as above but using tar instead of cpio.
B: macht 512 Byte Blocks (nötig für die Pipes)
f - : Schreibt nach STDOUT
lscfg zeigt alle installierten Devices mit Location Code
lscfg -v lists all installed devices in detail
lscfg -vl (device name) lists device details
bootinfo -b reports last device the system booted from
bootinfo -k reports keyswitch position
1=secure, 2=service, 3=normal
bootinfo -r reports amount of memory (/ by 1024)
bootinfo -s (disk device) reports size of disk drive
bootinfo -T reports type of machine
ie rspc,rs6ksmp,rspc or chrp
lsattr -El sys0 Zeigt alle System Einstellungen.
lsattr -El sys0 -a realmem Zeigt das Memory des Systems.
mknod (device) c (major no) (minor no) Creates a /dev/ device file.
mknod /dev/null1 c 2 3
lsdev -C zeigt alle "customised devices" also alle installierten
lsdev -P zeigt alle "pre-defined devices" also die unterstützten
lsdev -(C or P) -c (class) -t (type) -s (subtype)
lsdev -C -r class zeigt alle Klassen, die angepasst wurden
chdev -l (device) -a (attribute)=(new value) Einstellen von Attributen eines Device
chdev -l sys0 -a maxuproc=2048 Beispiel: Erhöhung max. Userprozesse
lists all installed deviceslsattr -EH -l (device) -D Lists the defaults in the pre-defined db
lsattr -EH -l sys0 -a modelname
rmdev -l (device) Change device state from available to defined
rmdev -l (device) -d Delete the device
rmdev -l (device) -SR S stops device, R unconfigures child devices
lsresource -l (device) Displays bus resource attributes of a device.
cfgmgr Configures devices
cfgmgr -i /dev/cd0 Configure devices and install drivers from /dev/cd0
if required
cfgmgr -S Run in serial, used with a larger number of disks
cfgmgr -l scsi0 Es wird nur dieses Device Konfiguriert
diag Run hardware diagnostic menu
smitty diag Run hardware diagnostic menu
( 7020-40P and 7248-43P machines cannot run diagnostics, use diagnostics
in the SMS menus instead )
diag -d (device) Run diagnostics against a device.
lsslot Displays all hot swap slots
lsslot -c pci Lists all pci hot swap slots
lsslot -c pci -a Lists all available pci hot swap slots
lsslot -c pci -l ent0 Slot des PCI Ethernet Adapters
drslot Reconfgiures PCI hot-plug slots
drslot -i -c pci -s U0.1-P1-I3 Display a slot, flashes the LED next to
the slot so that it can be identified.
Power Management (PCI machines)
-------------------------------
pmctrl -a Displays the Power Management state
rmdev -l pmc0 Unconfigure Power Management
mkdev -l pmc0 Configure Power Management
Blocksize: Wenn man sie nicht kennt, kann man einen Block auslesen und
schauen, wie groß er ist.
dd if=/dev/rmt0 bs=128 count=1 | wc -c ==> Größe in Byte.
(tcopy /dev/rmt0 zeigt die Größe direkt).
rmt0.x where x = A + B + C
A = density 0 = high 4 = low
B = retension 0 = no 2 = yes
C = rewind 0 = yes 1 = no
tctl -f (tape device) fsf (No) Skips forward (No) tape markers
(Vorspulen zum 3 Marker (Start 4 Block, Daten)
tctl -f (tape device) bsf (No) Skips back (No) tape markers
tctl -f (tape device) rewind Rewind the tape
tctl -f (tape device) offline Eject the tape
tctl -f (tape device) status Show status of tape drive
chdev -l rmt0 -a block_size=512 changes block size to 512 bytes
(4mm = 1024, 8mm = variable but
1024 recommended)
dd if=/dev/rmt0 bs=128k count=1 | wc -c
Displays the block size of an unknow tape. Set block size to 0 first.
bootinfo -e answer of 1 = machine can boot from a tape drive
answer of 0 = machine CANNOT boot from tape drive
diag -c -d (tape device) Hardware reset a tape drive.
diag -c -d rmt0
tapechk (No of files) Checks Number of files on tape.
< /dev/rmt0 Rewinds the tape !!!
Angepasstes mksysb: => File image.data (aus mksysb -i)
File Signature erzeugen: Inhalt: "data"
Signature und bosinst.data auf Diskette:
ls ./bosinst.data signature | backup -qiv /dev/fd0
Beim Booten die Diskette einlegen, sie wird immer ausgelesen.
Ein paar Sachen zum modifizieren: CONSOLE, INSTALL_METHOD, PROMPT,
CUSTOMIZATION_FILE, HDISKNAME
COPYING DISKETTES
-----------------
dd if=/dev/fd0 of=(filename) bs=36b
dd if=(filename) of=/dev/fd0 bs=36b conv=sync or flcopy
COPYING TAPES
-------------
dd if=/dev/rmt0 of=(filename)
dd if=(filename) of=/dev/rmt0 or tcopy
splp (device) Displays/changes printer driver settings splp /dev/lp0 export $LPDEST="pqname" Set default printer queue for login session lsvirprt Lists/changes virtual printer attributes. lsallq Displays all queues rmvirprt -q queuename -d queuedevice Removes a virtual printer qpri -#(job No) -a(new priority) Change a queue job priority. qhld -#(job No) Put a hold on hold qhld -r #(job No) Release a held job qchk -A Status of jobs in queues lpstat lpstat -p(queue) Status of jobs in a named queue qcan -x (job No) Cancel a job from a queue cancel (job No) enq -U -P(queue) Enable a queue enable (queue) enq -D -P(queue) Disable a queue disable (queue) qmov -m(new queue) -#(job No) Move a job to another queue startsrc -s qdaemon Start qdaemon sub-system lssrc -s qdaemon List status of qdaemon sub-system stop -s qdaemon Stop qdaemon sub-system Wer darf drucken? ==> /etc/hosts.lpd Alle Rechner mit Domainname, die drucken dürfen. ==> + lässt alle am Netz drucken.
Standard (default) Filesysteme in der rootvg:
hd1 - /home
hd2 - /usr
hd3 - /tmp
hd4 - /
hd5 - Boot logical volume
hd6 - Paging space
hd8 - Log device
hd9var - /var
hd10opt - /opt
Physical Volumes (PV's)
-----------------------
bootinfo -o hdisk0 Adresse der hdisk0
bootinfo -s hdisk0 Größe (MB) der hdisk0
(getconf DISK_DEVNAME bzw. DISK_SIZE hdisk0)
lspath -l hdisk0 Zeigt alle MPIO Pfade der hdisk0
lspv Lists all physical volumes (hard disks)
lspv (pv) Lists the physical volume details
lspv -l (pv) Lists the logical volumes on the physical volume
lspv -p (pv) Lists the physical partition usage for that PV
lspv -M (pv) Lists the PP allocation table for that PV.
If the PV state is "missing" but the disk is okay, use "varyonvg vg" to change
the state of the PV to "active".
chdev -l (pv) -a pv=yes Makes a new hdisk a pysical volume.
chpv -v r (pv) Ein PV "quiescen". Alle VGDA und VGSA nehmen nicht mehr
am Quorum teil. Die Platte verschwindet aus der VGDA
der VG.
chpv -v a (pv) Aktiviert die Platte wieder.
chpv -a y (pv) Changes pv allocatable state to YES
chpv -a n (pv) Changes pv allocatable state to NO
migratepv (old pv) (new pv) Alle LV werden von einer Platte (PV) auf die
andere kopiert. Beide Platten müssen in derselben
VG sein!
LVs, die gestriped angelegt sind, kann man so nicht migrieren, man muß
cplv / rmlv einsetzen.
replacepv (old pv) (new pv) (4.3.3 onwards)
Eine Platte entfernen:
- Daten mit migratepv retten.
- umount FS
- reducevg -df VG_name PV_name
- prüfen mit lspv
- rmdev -dl PV_name
- prüfen mit lsdev -Cc disk
Welche PVID steht auf der Platte? Kann ich mit der Platte überhaupt reden?
lquerypv -h /dev/hdisk0 80 10
Wichtige Disk-Information sichern:
dd if=/dev/hdisk0 of=/tmp/hdisk0.save bs=4k count=1
Neue PVID setzten:
PVID in Oktal übersetzten:
00012a3e42bc908f3 -> 00 12 a3 e4 2b c9 08 f3
Octal version -> 000 022 243 344 053 311 010 363
Jede Gruppe mit \0 für Oktal beginnen und alles mit \c beenden:
echo "\0000\0022\0243\0344\0053\0311\0010\0363\c" > /tmp/pvid_neu
Stimmt es?
od -x /tmp/pvid_neu
Und Schreiben:
cat /tmp/pvid_neu | dd of=/dev/hdisk2 bs=1 seek=128
Volume Groups (VG's)
--------------------
lsvg Lists all volume groups
lsvg (vg) Lists the volume group details
lsvg -l (vg) Lists all logical volumes in the volume group
lsvg -p (vg) Lists all physical volumes in the volume group
lsvg -o Lists all varied on volume groups
varyonvg (vg) nimmt eine VG online
varyonvg -f (vg) Forciert den varyon-Prozess
varyonvg -s (vg) Nimmt eine VG im "maintenence mode" online.
Man kann keine LVs für IO öffnen, alles andere geht.
varyonvg -n (vg) Nimmt die VG online, *ohne* die LPs zu syncen
varyoffvg (vg) Nimmt die VG offline
synclvodm (vg) Tries to resync VGDA, LV control blocks and ODM.
synclvodm -v (vg) Erneuert den LVCB (Logical Volume Control Block)
Schreibt ihn auf alle Platten.
(Für synclvodm muß die VG online sein, also nach varyonvg)
getlvcb -AT tivoli_lcf_a_lv
mkvg -y(vg) -s(PP size) (pv) Create a volume group
mkvg -y datavg -s 4 hdisk1
reducevg (vg) (pv) Removes a volume group
reducevg -d (vg) (pv) Removes a volume group and delete all LV's on the PV
reducevg (vg) (PVID) Removes the PVID disk reference from the VGDA when a
disk has vanished without the reducevg (vg) (pv)
command being run first.
reducevg -df (vg) (pv) Deletes all LV's from the VG and removes the VG
from the disk. If the last disk in the VG then
the VG is deleted.
extendvg (vg) (new pv) Adds another PV into a VG.
exportvg (vg) Exports the volume group, removes the VG entries and
removes all FS entries from /etc/filesystems but
leaves the mount points.
Note : Cannot export a VG if it has active paging space, turn off paging,
reboot before exporting VG. Exporting removes entries from filesystems
file but does not remove the mount points.
chvg -a y (vg) Auto Vary On a volume group at system start.
chvg -u (vg) Unlocks a locked volume group.
chvg -t 2 rootvg ==> Wenn nicht genug Platten in die
VG passen, kann man den "T-Factor" setzen. Dann wird
die Anzahl der möglichen PP pro Platten (normal 1016)
um diesen Faktor erhöht.
chvg -C (vg) Setzt die VG in den "enhanced concurrent" Mode
chvg -l (vg) Entfernt das wieder.
lqueryvg -Atp (pv) Details volume group info for the hard disk.
importvg -y (vg name) (pv) Import a volume group from a disk.
importvg (pv) Same as above but VG will be called vg00 etc.
Learning Import (bei HACMP Cluster, oder Maschinen, die sich eine VG teilen)
- VG auf einem (nur einem) Knoten varyon nehmen. VG beliebig anpassen.
- varyonvg -b -u VG_name ==> bricht die Reservirung der Platten
- Auf dem andern Knoten: importvg -L VG_name PV_name
- Prüfen, ob alles schön angekommen ist (/etc/filesystems, lsvg -l)
- Auf dem ersten Knoten: varyonvg VG_name
chvg -Q (y/n) (vg name) Turns on/off Quorum checking on a VG.
reorgvg (vg) (lv) Reorganised a fragmented LV, must state an LV at the
command line else the first LV in the VG is picked.
Does not reorg the PP's of striped LV's.
/usr/sbin/readvgda /dev/hdisk0 Auslesen des VGDA direkt von der Platte.
/usr/sbin/readvgda /dev/vpath0 Alle Info zu Platten, VG, LV, FS.
Mit AIX 5.3 kann man sich Maps zu einzelnen LVs ausgeben lassen:
/usr/sbin/readvgda -s -m tivoli_lcf_lv /dev/hdisk0
Und man kann gezielt den 1. oder 2. VGDA abfragen:
/usr/sbin/readvgda -p /dev/hdisk0 ==> *= 1ST VGDA-VGSA: /dev/hdisk0 =*
/usr/sbin/readvgda -s /dev/hdisk0 ==> *= 2ND VGDA-VGSA: /dev/hdisk0 =*
Logical Volumes (LV's)
----------------------
lslv (lv) Lists the logical volume details
lslv -l (lv) Lists the physical volume which the LV is on
lsattr -EHl (lv) Displays more logical volume details
mklv (vg) (No of PP's) (pv Name optional) Create a logical volume
mklv -y (lv) (PP's) (pv name optional) Creates a named logical volume
( use -t jfs2 when creating an LV for a JFS2 filesystem )
chlv -n (new lv) (old lv) Umbenennen eines LV
chlv -x (number) (lv) Anzahl der PP für ein LV setzen
chlv -s n (lv) Strictness setzten
chlv -s s -u 1 hd3 Ein LV superstict machen
chlv -u 3 (lv) Setzten des UPPER BOUND
Upper Bound ist ein Problem.
Wenn SUPERSTRICT eingeschaltet ist, dann gilt die Zahl pro Spiegel.
(Zahl der erlaubten Platten)
Wenn NICHT superstrict, dann erlaubte Zahl der Platten für alle Spiegel zusammen!
Man muß also entweder auf superstrict gehen oder upper bond auf 3 setzen.
extendlv (lv) (zusätzliche PP) Ein LV vergrößern
rmlv (lv) Remove a logical volume
Haut alles weg.
lsvg -o | lsvg -i -l
cplv -v (vg to copy to) -y (new lv) (lv) Copy an LV to a new LV
If copying a filesystem LV, umount the filesystem before copying, otherwise you
will have to fsck the the new LV before the filesystem can be mounted.
If copying a striped LV to an LV that is already created, and the stripe
size is different ( or not even striped ), then these new parameters are
maintained when the data is copied to the new LV.
Also: Wenn kein LV in der ZielVG existiert: Das LV wird genauso angelegt
wie es war (stripesize)
Wenn schon ein LV angelegt ist, werden dessen Parameter genutzt.
cplv -e (new lv) (old lv) Copy to an existing LV
( new lv must have type as copy use chlv -t copy (new lv) to change )
mklv/extendlv -a = PP alocation policy
-am = middle -ac = center -ae = edge
-aie = inner edge -aim = inner middle
migratepv -l (lv) (old pv) (new pv)
Move a logical volume between physical volumes. Both physical volumes
must be in the same volume group !
migratelp (lv)/(LP Nummer)/(Nummer der Kopie) Neue_Platte
Damit kann man ein einzelnes PP von einer Platte auf eine
andere schieben. Die LP Nummer kommt aus lslv -m (ohne Nullen).
Die Nummer der Kopie ist der Spiegel, zu dem die PP gehört:
migratelp mein_lv/2/1 hdisk9 ==> verschiebt die 2. LP
der ersten Kopie des LV auf die hdisk9.
Optional kann man auch noch die PP Nummer auf der neuen Platte
bestimmen:
migratelp (lv)/(LP Nummer)/(Nummer der Kopie) Neue_Platte/(PP Nummer)
mklv -y (lv) -t jfslog (vg) (No of PP's) (pv Name optional)
Creates a JFSlog logical volume.
logform (/dev/lv) Initialises an LV for use as an JFSlog
getlvcb -AT (lv) Displays Logical Volume Control Block information
File Systems (FS's)
-------------------
lsfs Zeigt alle filesysteme - man kann greppen.
lsfs -q (fs) Zeigt alle filesysteme mit details.
lsjfs Displays data about all filesystems in CSV style format
mount Lists all the mounted filesystems
mount (fs or lv) Mounts a named filesystem
mount -a Mounts all filesystems
mount all
mount -r -v cdrfs /dev/cd0 /cdrom mounts cd0 drive over /cdrom
crfs -v jfs -d(lv) -m(mount point) -A yes
Will create a file system on the whole of the logical volume, adds entry into
/etc/filesystems and will create mount point directory if it does not exist.
( use -v jfs2 for JFS2 filesystems )
crfs -v jfs -g(vg) -m(mount point) -a size=(size of fs) -A yes
Will create a logical volume on the volume group and create the file system on
the logical volume. All at the size stated. Will add entry into
/etc/filesystems and will create the mount point directory if it does not exist.
Use attribute "-a log=/dev/log01" to specify a jfslog devices
Use attrubute "-a bf=true" for a large file enabled filesystem
chfs -A yes (fs) Automount einstellen - FS wird beim booten angezogen.
(sieht man in /etc/filesystems)
chfs -a size=(new fs size)(fs) Größe des FS verändern: file system
chfs -m (new-mount-point) (fs) Change the file system mount point.
rmfs (fs) Entfernt das Filesystem und das Logical Volume.
Entfernt den Eintrag in der /etc/filesystems.
rmfs -r Entfernt auch den Mountpoint
defrag -q (fs) Reports the fragment status of the file system.
defragfs -r (fs) Runs in report only defrag mode (no action).
defragfs (fs) Defragments a file system.
fsck (fs) Verify a file system, the file system must be unmounted!
fsck (-y or -n) (fs) Pre-answer questions either yes or no !
fsck -p (fs) Mit -p wird ein korrupter Superblock durch die Kopie ersetzt.
Erster Superblock:
JFS: lquerypv -h /dev/lvname 1000 100
JFS2: lquerypv -h /dev/lvname 8000 100
Zweiter Superblock:
JFS: lquerypv -h /dev/lvname 1F000 100
JFS2: lquerypv -h /dev/lvname F000 100
Kopieren der zweiten Kopie in die erste:
JFS: dd count=1 bs=4k skip=31 seek=1 if=/dev/LVName of=/dev/LVName
JFS2: dd count=1 bs=4k skip=15 seek=8 if=/dev/LVName of=/dev/LVName
Mirroring
---------
mklv -y (lv) -c(copies 2 or 3) (vg) (No of PP's) (PV Name optional)
Creates a mirrored named logical volume.
mklvcopy -s n (lv) (copies 2 or 3) (pv)
Creates a copy of a logical volume onto another physical volume. The physical
volume MUST be in the same volume group as the orginal logical volume !
rmlvcopy (lv) (copies 1 or 2) Removes logical volume copies.
rmlvcopy (lv) (copies 1 or 2) (pv) From this pv only!
syncvg -p hdisk0 hdisk1 hdisk2 Synchronisaton der logischen
syncvg -l (lv) Partitionen. Auf der Ebene des
syncvg -v (vg) PVs, des LVs und der VG.
Man kann angeben, wie viele LPs parallel bearbeitet werden sollen (1 - 32).
Dazu gibt man -P #LP_parallel an:
syncvg -P 16 -v seppel_vg (die Zahl der para. LPs hängt von der
syncvg -P 16 -l seppel_lv Maschine ab...)
Oft lohnt es sich, eine VG mit -n (ohne
Sync) online zu nehmen.
mirrorvg (vg) (pv)
Mirrors the all the logical volumes in a volume group onto a new physical
volume. New physical volume must already be part of the volume group.
chfs -a splitcopy=/backup -a copy=2 /data1
Splits off a copy of a 3 way mirror and mount read only for use as an
offline backup.
Spiegeln der rootvg:
extendvg rootvg hdisk1
mirrorvg rootvg
bosboot -ad hdisk0
bosboot -ad hdisk1
bootlist -m normal hdisk0 hdisk1
smtctl Ist SMT angeschaltet?
Mirroring does not work with the BLV as it is not a true logical volume,
bosboot must be run against the other disk after mirroring the rootvg.
bootlist -m (normal or service) -o displays bootlist
bootlist -m (normal or service) (list of devices) change bootlist
bootinfo -b Identifies the bootable disk
bootinfo -t Specifies type of boot
Von welcher Platte man gebootet hat, sieht man nach
dem Boot am IPL Device: /dev/ipldevice
Vergleich der Major Number:
0:root@dbkpps15:/root # ls -l /dev/ipldevice
crw------- 2 root system 20, 4 Dec 06 12:20 /dev/ipldevice
0:root@dbkpps15:/root # ls -l /dev/hdisk6
brw------- 1 root system 20, 4 Dec 06 12:20 /dev/hdisk6
bosboot -a -d (/dev/pv) Creates a complete boot image on a physical volume.
mkboot -c -d (/dev/pv) Zero's out the boot records on the physical volume.
savebase -d (/dev/pv) Saves customised ODM info onto the boot device.
lslv -m hd5 Find out which disk the BLV is on.
bootinfo -y Displays which kernel can be used, 32 or 64 bit
genkex Zeigt alle geladenen Kernel Extensions (Loaded Kernel Extensions)
genkld Zeigt alle geladenen Shared Objects (Loaded Shared Objects)
genld Zeigt alle geladenen Objects eines Prozesses
lsdev -Cc processor Lists all processors
lsattr -EHl proc0 Displays attributes of processor 0. AIX 5.1L will
display processor clock frequency.
bootinfo -K Ist der Kernel 32 oder 64 Bit? (Sieht man auch mit ls -l /unix)
Kernel umstellen (der Kernel ist nur ein Link in /unix, bosboot ist aber nötig):
ln -sf /usr/lib/boot/unix_64 /unix
ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
bosboot -ak /usr/lib/boot/unix_64
shutdown -Fr
Wenn das BLV kaputt ist (oder sonstwie verschwunden):
Die hd5 neumachen und bosboot laufen lassen.
Das BLV von einer Platte auf eine andere Migrieren:
migratepv -l hd5 -SourceDiskNumber- -DestinationDiskNumber-
bosboot -a -d /dev/DestinationDiskNumber
bootlist -m normal DestinationDiskNumber
mkboot -c -d /dev/SourceDiskNumber
1, AIX 4.2.1 and greater supports system dump to paging space. 2, AIX 4.3.3 and greater supports system dump to mirrored paging space. 3, Primary dump device must be in the rootvg 4, Secondary dump device can be outside rootvg unless it is a paging device. sysdumpdev -l Lists current dump destination. sysdumpdev -e Estimates dumpsize of the current system in bytes. sysdumpdev -L Displays information about the previous dump. sysdumpstart -p Starts a dump and writes to the primary dump device. sysdumpstart -s Starts a dump and writes to the secondary dump device. (MCA machine can also dump if key is in service position and the reset button is pressed) sysdumpdev -p (dump device) -P Sets the default dump device, permanently Analyse dump file :- echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0 snap -gfkD -o /dev/rmt0 Copy dump to tape to send to IBM support, uses tar.
lsps -a Lists out all paging space
lsps -s Displays total paging and total useage
lsps (ps)
swappon /dev/ps Activates a paging device eg /dev/paging00
swappoff /dev/ps Deactivates a paging device ( AIX 5.x only )
mkps -s(No of PP's) -n -a (vg)
mkps -s(No of PP's) -n -a (vg) (pv)
-n = don't activate/swapon now -a = activate/swapon at reboot
mklv -b n -t paging -y hd6 (vg) (No of PP's) (pv)
Creates paging space using the mklv command.
chps -a n (ps) Turns off paging space.
chps -s(No of PP's) (ps) Increases paging space.
chps -d(No of PP's) (ps) Decreases paging space ( AIX 5.x only )
chlv -n (new name) (old name) Change paging space name
rmps (ps) Remove paging space. PS must have been turned off
and then the system rebooted before it can be removed.
Note : Need to change the swapon entry in /sbin/rc.boot script if you are
changing the default paging space from /dev/hd6. You also need to
do a "bosboot -a -d /dev/hdiskx" before the reboot.
/etc/swapspaces File that lists all paging space devices that are
activated/swapon during reboot.
crontab -l List out crontab entrys
crontab -e Edit crontab entrys
crontab -l > (filename) Output crontab entrys to a file
crontab (filename) Enter a crontab from a file
crontab -r Removes all crontab entrys
crontab -v Displays crontab submission time.
Aufbau des Eintrags in die crontab:
Minute Stunde Tag_Monat Monat Wochentag Kommando
0-59 0-23 1-31 1-12 0-6 (So Mo Di Mi Do Fr Sa)
3 0 1 * * ==> Jeden Monatsersten um 0:03 (egal welcher Monat oder Tag)
/var/adm/cron/cron.allow File containing users allowed crontab use.
/var/adm/cron/cron.deny File containing users denied crontab use.
/var/adm/cron/crontab Directory containing users crontab entries.
/var/adm/cron/log Cron log file.
at (now + 2 minutes, 13:05, etc) {return} Schedule a job using at
Command or schell script {return}
{CTRL D}
echo "shutdown -Fr" | at now + 1 minute
at -l
atq Lists out jobs scheduled to run via at command
at -
Konfiguration des syslogd: wird aus der /etc/rc.tcpip gestartet. Kann Informationen von anderen Dämonen/Services empfangen und diese an Files, Terminals, Users oder an den syslogd eines anderen Systems schicken. ==> /etc/syslog.conf Der syslogd generiert seine Log-Files nicht; man muß diese mit touch anlegen. Man sollte die Log-Files rotieren, damit nichts vollaufen kann.
lsnim ==> zeigt alle NIM-Operations lsnim -q Operation -t Type ==> zeigt gültige Attribute Mit dem nim Kommando sieht man die Attribute. nim -o Operation -a type=attribute .....
ps -ef | sort +3 -r | head -15 ==> Sortiert nach Penalty (C) ps gv | head -n 1 ; ps gv | egrep -v "RSS" | sort ==> Sotriert nach Proc ID ps aux | head -1 ; ps aux | sort -rn +2 | head ==> Sortiert nach CPU Usage ps auxw ==> zeigt USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND (COMMAND in voller Länge) ps -dfl ==> zeigt USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND ps geww==> zeigt Environment des Prozess ps -Amo THREAD ==> zeigt Prozesse mit den zugeordneten Threads ps -eo "%a %t %n" ==> Man kann sich selbst die Ausgabe zusammenstellen Wer hält ein File oder ein Directory offen? fuser -cux ==> Zeigt alle Prozesse, die das Dir offen halten fuser -kcux ==> Killt Prozesse, die im Directory stehen Anzeigen aller Einstellungen für einen User (zum greppen): lsuser -f user Nur die Namen der User (oder jedes andere Attribut: lsuser -a id ALL Einstellen von Attributen: chuser nofiles=4096 core=-1 fsize=-1 mein_user Alle Limits sind "soft" Limits, die der User setzen kann. Diese "soft" Limits bewegen sich im Rahmen der "hard" Limits, die nur der root-User setzen kann. Für diesen Zweck gibt es zu allen Limits jeweils ein weiteres mit dem Zusatz "_hard" (zB. core und core_hard). core ==> Größe des core-Files, das ein User-Prozess generieren kann. Anzahl der 512 Byte Blocks. cpu ==> Systemzeit, die ein User-Prozess verbrauchen kann. In Sekunden, -1 ist "unlimitet". data ==> Die Größe des Daten-Segments für einen User-Prozess. In 512 Byte Blocks, minimum ist 1272. fsize ==> Die Größe eines Files, daß der User-Prozess anlegen kann. In 512 Byte Blöcken. Für Files größer 2GB spezifiziert man -1. Minimum ist 8192. nofiles ==> Anzahl der Files, die ein User-Prozess zugleich öffnen kann. rss ==> Die Menge an physikalischem Speicher, die ein User-Prozess allokieren kann. In 512 Byte Blöcken; wird vom OS nicht benutzt. stack ==> Die Größe des Prozess-Stacks, den ein User-Prozess anlegen kann. In 512 Byte Blöcken. Ein Minimum von 49 Blöcken sind erforderlich und gesetzt. Als Maximum können 2147483647 Blöcke gesetzt werden (1099 GB) In welchem Runlevel befindet sich meine Maschine? who -r ps -ef |grep init ==> der Init-Prozess zeigt Runlevel in Klammern. (Im Gegensatz zu Solaris und Linux (Sys V Unixe) hat AIX kein vergleichbares Runlevel System - so wie die BSD Unixe. Es gibt den normalen Multi-User Modus, in AIX Runlevel 2. Die höheren Level können vom Administrator definiert werden als eine Emulation des Runlevel-Konzeptes.)
Shared Memory Belegung ipcs -a ipcs -m ==> aktive shared Memory Segments ipcrm ==> löscht einzelne Segmente, Semaphoren, Message Queues
[ Allgemein | UNIX | AIX | TCP-IP | TCP | ROUTING | DNS | NTP | NFS | FreeBSD | Linux | RPi | SMTP | Tracing | GPS | LW ]
Copyright 2001-2021 by Orm Hager - Es gilt die GPL