Andresen 8 21 02

Post on 22-Nov-2014

982 views 1 download

description

Fashion, apparel, textile, merchandising, garments

Transcript of Andresen 8 21 02

www.bmc.com

1 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Linux/390 Hints and TipsRobert Andresen

2 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Linux/390 Hints and Tips

Linux is a trademark of Linus Torvalds.VM/ESA, z/VM, MVS, OS/390, z/OS, VSE, S/390, z/Series … are trademarks of IBM.UNIX is a trademark licensed through X/Open.

3 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Linux/390 Hints and Tips

Bootstrapping & installation highlightsBooting options after installationDASD layouts and DASD sharing‘init’ and init scriptsAd-hoc software inventoryVarious tips and referencesQ&A throughout

4 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Linux/390 Hints and Tips

What are we doing?Or what have we gotten into??

Linux, Linux on S/390, Linux on VMLinux and S/390 synergy

“If there ever was a silver bullet for VM, I think Linux may be it.” -- Reed Mullen

5 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Show of Hands

Are you VM people?Are you UNIX people?Are you S/390 people?

6 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Linux is Linux

UNIX is UNIX … yeah, rightLinux is UNIX (a flavor of)Linux is Linux (doing the Java job)

pursue compatibility with other UNIXstrongly pursue with other Linux (HW)

7 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

The Players

Marist CollegeSuSETurboLinuxMillenux (ThinkBlue)CaimanRedHat

pub/redhat/linux/7.2/en/os/s390

8 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

zSeries Candidate Applications

SambaApacheWeb ServersIBM developers kitDB2 connect

9 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Watch out

zSeries CPU slower than many IntelCompare bogomips

Advantage is IO subsystemFast access to vast amounts of data

Political, not technical decisionReligious fervor for “correct” platform

10 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Bootstrapping

VM (tape, reader, or SAPL)LPAR (tape)P/390 (tape or OMA)Fun-Soft or other emulationVIF is just plain magic

11 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Machine Requirements

At least one CPUHWC or 3215 consoleIEEE floating point helps64M main storage, no expandedOne 3390-3 (about 2G)Network (CTC or OSA/LCS)Limit extras in IOCDS (Linux in an LPAR)

12 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Bootstrapping

Jumpstart: minimal system prepare DASD prepare network connect using more "UNIXy" tools access other media for installation

13 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Bootstrapping

kernel imageIPL parm lineinstallation system RAMDISK

memory resident

stack all three to tape or virtual reader reader: LRECL 80tape or OMA: LRECL 1024

14 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

P/390 TDF

@TDFH:\IMAGE UNDEFINED RECSIZE 1024H:\PARMLINE UNDEFINED RECSIZE 1024H:\INITRD UNDEFINED RECSIZE 1024TMTMEOT

15 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

YaST

Yet Another Setup Tool (really)requires network:telnet in; use 25 line VT100 equivuse “reachable directory” method

16 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

S/390 YaST and CD-ROM

mkdir /cdromchmod 555 /cdrom

Better to mount CD manually rather than by script

mount CD via NFSmount -r host:/cdrom /cdrom

mount CD as FBAmount -r /dev/dasdc /cdrom

17 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

DASD

1B0 = /boot 1B1 = root R/W 1B3 = swap R/W 1BA = /opt 1BD = /usr/man 1BE = /usr 1BF = /usr/local

18 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

DASD

1B0 = /boot 1B1 = root 1B3 = swap 1BA = /opt 1BE = /usr

keep it simple

19 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

DASD, Linux and CMS

1B0 = /boot -- 190 = S1B1 = root -- 191 = A1B2 = /export -- 192 = D1BA = /opt -- 319 = P1BD = /usr/man -- 19D = Z1BE = /usr -- 19E = Y1BF = /usr/local -- 19F = X

20 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Extreme DASD Specialization

1B0 = /boot can be R/O1B1 = root1B2 = /export can be R/O1B3 = swap1B5 = /var1B7 = /tmp (may be v-disk)1BA = /opt (here below R/O)1BC = /usr/src1BD = /usr/man1BE = /usr1BF = /usr/local

21 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

DASD Parm Token

dasd=1b0-1bf“CMS convention”

Parmfile in /boot to list avalable DASD

dasd=200-203/dev/dasda => 200/dev/dasdb => 201… so forth ...

22 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Booting from DASD

silo -t2 -i image \-p parmfile \-d /dev/dasda \-b ipleckd.boot

these files reside in /dev/dasda1

23 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Separating /boot

multiple /boot disks (diff’t kernels) IPL volume need not be in config, eg: “dasd=200-203” can IPL from 204root is then free to focus on systemroot can still be IPLable(if “partitioned”)

24 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

/boot content ...

image (the kernel)parm fileRAMDISK (optional)

map file (generated by ‘silo’)

must all be on same volume

25 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

The Secret RAMDISK Option

silo -t2 -i image \-p parmfile \-d /dev/dasda \-b ipleckd.boot \-r initrd

re-use your installation system in a pinch

26 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Booting from NSS

DEFSYS LINUX 0-1FF EW MINSIZE=6MTRACE INST RANGE 10000.4IPL vaddr CLEARSAVESYS LINUXTRACE END

IPL LINUX and enjoy!

27 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

INIT Scripts

/etc/rc.d/init.d/thing [ start | stop ]start, stop, restart, status, start_msg, stop_msgcan use on CMS (OpenExt) or USS

28 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

INIT Scripts

associate a script with a runlevel /etc/rc.d/rc3.d/S24thing

-> /etc/rc.d/init.d/thing /etc/rc.d/rc3.d/K76thing

-> /etc/rc.d/init.d/thing“S” or “K” and 00 to 99

29 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Sample INIT Script

case $1 in start) hcp xautolog syswreck;;stop)hcp force syswreck;;start_msg)echo “starting System Wrecker”;;esac

30 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

runlevel

0 .. pass through to ‘halt’1 .. start-up or maint2 .. limitted operation (text console)3 .. normal operation (X console)4 .. (alternate for #2)5 .. (alternate for #3)6 .. pass through to ‘reboot’

31 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Default Run-level

/etc/inittab

The general syntax is ... id : levels : action : process

id:2:initdefault:

32 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

INIT Scripts from inittab

zz:23:once:/etc/rc.d/init.d/thing startyy:23:once:/etc/rc.d/init.d/other start

33 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Service Virtual Machine (Penguins)

can use read-only rootmay not need swap spacecan use custom ‘init’must have interaction with other systems(network, spool space, DASD, IUCV)

34 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

VMSSL- secure sockets service machine

#!/bin/sh fsck /dev/dasdb mount –o remount,rw /dev/dasdb / mkswap /dev/dasdd mount –a ; swapon –a /etc/rc.d/init.d/vmssld start while true ; do sh –i ; end

GPL “as is – no warranty”

35 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Fun with VMSSL

1B0 = /boot 1B1 = root 1B3 = swap (v-disk) 1BB = /opt/vmssl /var/vmssl (in root) 1BE = /usr

36 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Filesystems

disk is one thing -- filesystem is anotherMVS combines the two conceptsdistinction in most OS is not cleardistinction in UNIX is clearLinux supports VFS for many FS types

37 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

RAMDISK?

core or DASD, it’s all the sameUNIX distinguishes file organization from storage media, geometry, or hardware access methodRAMDISK is ...not just for installationvolatiledisposable

38 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Filesystem Types

ext2, minix, reiser, proc, nfs, hpfs, ntfs, smb, ncp, ufs, sysv, fat: msdos, vfat, umsdosiso (CD-ROM)cms (yes, really!)

39 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

The Beauty of FBA

DDR and ‘dd’ become equivalentportable volumes:inside Linux and outbetween VM and LinuxCD-ROM:-t iso9660

Emulate FBA if you can- more efficient

40 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Filesystem Optimization

Mixing physical and logical blocksizes

logical > physical okay (usually 4K/4K)logical < physical NOT OKAY

Can’t split physical blocks into multiple logical blocks.

41 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

CMS FS Driver

download fromftp://ftp.bmc.com/pub/cmsfs/cmsfs.tar.gz

./configuremake moduleinsmod cmsfs.omount -t cms /dev/dasdx /CMS

(notice no “1” there)

42 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

CMS FS Utility

download fromftp://ftp.bmc.com/pub/cmsfs/cmsfs.tar.gz

(didn’t we just do this??)./configuremake enjoy!

43 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

CMS FS Utility

TYPEcmsfscat -d dev [ -a | -i ] fn.ft

LISTFILEcmsfslst -d dev

Q DISKcmsfsvol -d dev

COPYFILEcmsfscp -d dev [ -a | -i ] fn.ft file

44 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

CMS FS Utility

dev is /dev/dasdx(again, no “1” there)

-a for “alphameric” (text)-i for image (binary) conversion based on filetype in driver

45 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

CMS FS on Linux

Two ways to do it: cmsfscat -d /dev/dasdd -a profile.exec mount -r -t cms /dev/dasdd /CMS cat /CMS/profile.exec

46 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Tar-to-Tar

Tip to copy file systems:

sh -c ‘ cd /source ; exec tar cf - . ‘ \ | sh -c ‘ cd /target ; exec tar xpf - ‘

47 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Replication using Tar-to-Tar

mkdir /old ; chmod 555 /old mount –r /dev/dasdz /old mkdir /new ; chmod 555 /new mount /dev/dasdx /new mkdir /new/usr ; chmod 555 /new/usr mount /dev/dasdy /new/usr sh -c ‘ cd /old ; exec tar cf - . ‘ \ | sh -c ‘ cd /new ; exec tar xpf - ‘

48 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Networking

ethernet (OSA or LCS), t/r, fddi, gdioCTC (virtual or real)IUCV Inter User Communication Vehicle (VM only)

49 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Networking via VM

Linux end should have an addressVM end need not have an address(may use addr of another VM device)Linux uses a VM addr for default routerouters must route through VM to Linux

50 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Network Config

TurboLinux and RedHat/etc/sysconfig/network/etc/sysconfig/network-scripts/ifcfg-ctc0SuSE/etc/rc.configlook for NETCONFIG, IPADDR_0, NETDEV_0/etc/route.conf

51 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Network Config

/etc/HOSTNAMEmatch the VM ID

/etc/hosts/etc/resolv.conf

52 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

‘suloginv’

inspired by Q&D use of ‘sulogin’presumes secure consolerun directly from inittab:

1:1236:respawn:/sbin/suloginv

(the “v” is for VM)

53 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

‘suloginv’

CONSOLE="$1"if [ -z "$CONSOLE" ] ; then \

CONSOLE=/dev/console ; fi

PS1="`hostname` \\\$ "export PS1

SHELL=/bin/shif [ -x /sbin/sh ] ; then SHELL=/sbin/sh ; fi

exec $SHELL -i 0<$CONSOLE 1>$CONSOLE 2>$CONSOLE

54 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Shared filesystem gotcha

RPM in shared filesystemInstall on one Linux imageProduct files in shared filesystem available on all images, butRPM database won’t reflect installFiles not in shared filesystem missing

Need install procedures to account for shared filesystems across multiple images

55 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Hypervisor Interaction

Neale Ferguson’s cpint package

Issue CP commands from Linux

http://linuxvm.org/penguinvm/programs/cpint-1.1.2.tar.gz

hcp q userid hcp msg operator gimme more cycles hcp disconn hcp ipl cms

56 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

‘chroot’

closest thing UNIX has to v-machinemount new root, then run:

mount /dev/dasdx1 /mntchroot /mnt /bin/sh… do stuff …exitumount /mnt

operationally similar to OVM or USS

57 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

‘chroot’

useful for setting up a new systemuseful for fixing a broken systemuseful for security (eg: FTP padded cell)

58 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Reset Root Password

Bring up the installation system, then:

insmod dasd dasd=io-dev-range mount /dev/dasda1 /mnt chroot /mnt /bin/sh passwd exit umount /mnt rmmod dasd

59 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Sysgen by any other name …

Linux kernel build

cd /usr/src/linux make clean make menuconfig make dep ; make clean make image

or ‘make config’ or ‘make xconfig’

60 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

zSeries X Windows

Start X Server on IntelExceedOther competitors

zSeriesdisplay=<hostname>:0,0export display

61 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

in /var/X11R6/lib/Xservers

comment out :0 local /usr/X11R6/bin/X :0

and add * foreign

in /var/X11R6/lib/xdm-config

comment out DisplayManager.requestPort: 0

Enabling XDM

62 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved.

Thank You!