Andresen 8 21 02

62
www.bmc.com 1 6/22/99 ©1999 BMC Software, Inc. All Rights Reserved. Linux/390 Hints and Tips Robert Andresen

description

Fashion, apparel, textile, merchandising, garments

Transcript of Andresen 8 21 02

Page 1: Andresen 8 21 02

www.bmc.com

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

Linux/390 Hints and TipsRobert Andresen

Page 2: Andresen 8 21 02

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.

Page 3: Andresen 8 21 02

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

Page 4: Andresen 8 21 02

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

Page 5: Andresen 8 21 02

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?

Page 6: Andresen 8 21 02

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)

Page 7: Andresen 8 21 02

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

Page 8: Andresen 8 21 02

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

zSeries Candidate Applications

SambaApacheWeb ServersIBM developers kitDB2 connect

Page 9: Andresen 8 21 02

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

Page 10: Andresen 8 21 02

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

Page 11: Andresen 8 21 02

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)

Page 12: Andresen 8 21 02

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

Page 13: Andresen 8 21 02

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

Page 14: Andresen 8 21 02

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

Page 15: Andresen 8 21 02

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

Page 16: Andresen 8 21 02

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

Page 17: Andresen 8 21 02

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

Page 18: Andresen 8 21 02

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

Page 19: Andresen 8 21 02

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

Page 20: Andresen 8 21 02

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

Page 21: Andresen 8 21 02

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 ...

Page 22: Andresen 8 21 02

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

Page 23: Andresen 8 21 02

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”)

Page 24: Andresen 8 21 02

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

Page 25: Andresen 8 21 02

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

Page 26: Andresen 8 21 02

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!

Page 27: Andresen 8 21 02

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

Page 28: Andresen 8 21 02

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

Page 29: Andresen 8 21 02

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

Page 30: Andresen 8 21 02

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’

Page 31: Andresen 8 21 02

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:

Page 32: Andresen 8 21 02

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

Page 33: Andresen 8 21 02

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)

Page 34: Andresen 8 21 02

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”

Page 35: Andresen 8 21 02

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

Page 36: Andresen 8 21 02

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

Page 37: Andresen 8 21 02

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

Page 38: Andresen 8 21 02

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!)

Page 39: Andresen 8 21 02

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

Page 40: Andresen 8 21 02

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.

Page 41: Andresen 8 21 02

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)

Page 42: Andresen 8 21 02

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!

Page 43: Andresen 8 21 02

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

Page 44: Andresen 8 21 02

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

Page 45: Andresen 8 21 02

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

Page 46: Andresen 8 21 02

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 - ‘

Page 47: Andresen 8 21 02

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 - ‘

Page 48: Andresen 8 21 02

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)

Page 49: Andresen 8 21 02

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

Page 50: Andresen 8 21 02

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

Page 51: Andresen 8 21 02

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

Network Config

/etc/HOSTNAMEmatch the VM ID

/etc/hosts/etc/resolv.conf

Page 52: Andresen 8 21 02

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)

Page 53: Andresen 8 21 02

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

Page 54: Andresen 8 21 02

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

Page 55: Andresen 8 21 02

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

Page 56: Andresen 8 21 02

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

Page 57: Andresen 8 21 02

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)

Page 58: Andresen 8 21 02

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

Page 59: Andresen 8 21 02

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’

Page 60: Andresen 8 21 02

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

Page 61: Andresen 8 21 02

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

Page 62: Andresen 8 21 02

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

Thank You!