Andresen 8 21 02

787 views

Published on

Fashion, apparel, textile, merchandising, garments

Published in: Business, Lifestyle
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
787
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Andresen 8 21 02

    1. 1. Linux/390 Hints and Tips Robert Andresen
    2. 2. Linux/390 Hints and Tips <ul><li>Linux is a trademark of Linus Torvalds. </li></ul><ul><li>VM/ESA, z/VM, MVS, OS/390, z/OS, VSE, S/390, z/Series … are trademarks of IBM. </li></ul><ul><li>UNIX is a trademark licensed through X/Open. </li></ul>
    3. 3. Linux/390 Hints and Tips <ul><li>Bootstrapping & installation highlights </li></ul><ul><li>Booting options after installation </li></ul><ul><li>DASD layouts and DASD sharing </li></ul><ul><li>‘init’ and init scripts </li></ul><ul><li>Ad-hoc software inventory </li></ul><ul><li>Various tips and references </li></ul><ul><li>Q&A throughout </li></ul>
    4. 4. Linux/390 Hints and Tips <ul><li>What are we doing? </li></ul><ul><li>Or what have we gotten into?? </li></ul><ul><li>Linux, Linux on S/390, Linux on VM </li></ul><ul><li>Linux and S/390 synergy </li></ul><ul><li>“If there ever was a silver bullet for VM, </li></ul><ul><li>I think Linux may be it.” -- Reed Mullen </li></ul>
    5. 5. Show of Hands <ul><li>Are you VM people? </li></ul><ul><li>Are you UNIX people? </li></ul><ul><li>Are you S/390 people? </li></ul>
    6. 6. Linux is Linux <ul><li>UNIX is UNIX … yeah, right </li></ul><ul><li>Linux is UNIX (a flavor of) </li></ul><ul><li>Linux is Linux (doing the Java job) </li></ul><ul><li>pursue compatibility with other UNIX </li></ul><ul><li>strongly pursue with other Linux (HW) </li></ul>
    7. 7. The Players <ul><li>Marist College </li></ul><ul><li>SuSE </li></ul><ul><li>TurboLinux </li></ul><ul><li>Millenux (ThinkBlue) </li></ul><ul><li>Caiman </li></ul><ul><li>RedHat </li></ul><ul><li>pub/redhat/linux/7.2/en/os/s390 </li></ul>
    8. 8. zSeries Candidate Applications <ul><li>Samba </li></ul><ul><li>Apache </li></ul><ul><li>Web Servers </li></ul><ul><li>IBM developers kit </li></ul><ul><li>DB2 connect </li></ul>
    9. 9. Watch out <ul><li>zSeries CPU slower than many Intel </li></ul><ul><ul><li>Compare bogomips </li></ul></ul><ul><li>Advantage is IO subsystem </li></ul><ul><ul><li>Fast access to vast amounts of data </li></ul></ul><ul><li>Political, not technical decision </li></ul><ul><ul><li>Religious fervor for “correct” platform </li></ul></ul>
    10. 10. Bootstrapping <ul><li>VM (tape, reader, or SAPL) </li></ul><ul><li>LPAR (tape) </li></ul><ul><li>P/390 (tape or OMA) </li></ul><ul><li>Fun-Soft or other emulation </li></ul><ul><li>VIF is just plain magic </li></ul>
    11. 11. Machine Requirements <ul><li>At least one CPU </li></ul><ul><li>HWC or 3215 console </li></ul><ul><li>IEEE floating point helps </li></ul><ul><li>64M main storage, no expanded </li></ul><ul><li>One 3390-3 (about 2G) </li></ul><ul><li>Network (CTC or OSA/LCS) </li></ul><ul><li>Limit extras in IOCDS (Linux in an LPAR) </li></ul>
    12. 12. Bootstrapping <ul><li>Jumpstart: minimal system </li></ul><ul><li>prepare DASD </li></ul><ul><li>prepare network </li></ul><ul><li>connect using more &quot;UNIXy&quot; tools </li></ul><ul><li>access other media for installation </li></ul>
    13. 13. Bootstrapping <ul><li>kernel image </li></ul><ul><li>IPL parm line </li></ul><ul><li>installation system RAMDISK </li></ul><ul><li>memory resident </li></ul><ul><li>stack all three to tape or virtual reader </li></ul><ul><li>reader: LRECL 80 </li></ul><ul><li>tape or OMA: LRECL 1024 </li></ul>
    14. 14. P/390 TDF <ul><li>@TDF </li></ul><ul><li>H:IMAGE UNDEFINED RECSIZE 1024 </li></ul><ul><li>H:PARMLINE UNDEFINED RECSIZE 1024 </li></ul><ul><li>H:INITRD UNDEFINED RECSIZE 1024 </li></ul><ul><li>TM </li></ul><ul><li>TM </li></ul><ul><li>EOT </li></ul>
    15. 15. YaST <ul><li>Yet Another Setup Tool (really) </li></ul><ul><li>requires network: telnet in; use 25 line VT100 equiv </li></ul><ul><li>use “reachable directory” method </li></ul>
    16. 16. S/390 YaST and CD-ROM <ul><li>mkdir /cdrom </li></ul><ul><li>chmod 555 /cdrom </li></ul><ul><li>Better to mount CD manually rather than by script </li></ul><ul><li>mount CD via NFS mount -r host:/cdrom /cdrom </li></ul><ul><li>mount CD as FBA </li></ul><ul><li>mount -r /dev/dasdc /cdrom </li></ul>
    17. 17. DASD <ul><li> 1B0 = /boot </li></ul><ul><li> 1B1 = root R/W </li></ul><ul><li> 1B3 = swap R/W </li></ul><ul><li> 1BA = /opt </li></ul><ul><li> 1BD = /usr/man </li></ul><ul><li> 1BE = /usr </li></ul><ul><li> 1BF = /usr/local </li></ul>
    18. 18. DASD <ul><li> 1B0 = /boot </li></ul><ul><li> 1B1 = root </li></ul><ul><li> 1B3 = swap </li></ul><ul><li> 1BA = /opt </li></ul><ul><li> 1BE = /usr </li></ul><ul><li>keep it simple </li></ul>
    19. 19. DASD, Linux and CMS <ul><li>1B0 = /boot -- 190 = S </li></ul><ul><li>1B1 = root -- 191 = A </li></ul><ul><li>1B2 = /export -- 192 = D </li></ul><ul><li>1BA = /opt -- 319 = P </li></ul><ul><li>1BD = /usr/man -- 19D = Z </li></ul><ul><li>1BE = /usr -- 19E = Y </li></ul><ul><li>1BF = /usr/local -- 19F = X </li></ul>
    20. 20. Extreme DASD Specialization <ul><li>1B0 = /boot can be R/O </li></ul><ul><li>1B1 = root </li></ul><ul><li>1B2 = /export can be R/O </li></ul><ul><li>1B3 = swap </li></ul><ul><li>1B5 = /var </li></ul><ul><li>1B7 = /tmp (may be v-disk) </li></ul><ul><li>1BA = /opt (here below R/O) </li></ul><ul><li>1BC = /usr/src </li></ul><ul><li>1BD = /usr/man </li></ul><ul><li>1BE = /usr </li></ul><ul><li>1BF = /usr/local </li></ul>
    21. 21. DASD Parm Token <ul><li>dasd=1b0-1bf </li></ul><ul><li>“ CMS convention” </li></ul><ul><li>Parmfile in /boot to list avalable DASD </li></ul><ul><li>dasd=200-203 </li></ul><ul><li>/dev/dasda => 200 </li></ul><ul><li>/dev/dasdb => 201 </li></ul><ul><li>… so forth ... </li></ul>
    22. 22. Booting from DASD <ul><li>silo -t2 -i image </li></ul><ul><li>-p parmfile </li></ul><ul><li>-d /dev/dasda </li></ul><ul><li>-b ipleckd.boot </li></ul><ul><li>these files reside in /dev/dasda1 </li></ul>
    23. 23. Separating /boot <ul><li>multiple /boot disks (diff’t kernels) </li></ul><ul><li>IPL volume need not be in config, eg: “dasd=200-203” can IPL from 204 </li></ul><ul><li>root is then free to focus on system </li></ul><ul><li>root can still be IPLable (if “partitioned”) </li></ul>
    24. 24. /boot content ... <ul><li>image (the kernel) </li></ul><ul><li>parm file </li></ul><ul><li>RAMDISK (optional) </li></ul><ul><li>map file (generated by ‘silo’) </li></ul><ul><li>must all be on same volume </li></ul>
    25. 25. The Secret RAMDISK Option <ul><li>silo -t2 -i image </li></ul><ul><li>-p parmfile </li></ul><ul><li>-d /dev/dasda </li></ul><ul><li>-b ipleckd.boot </li></ul><ul><li>-r initrd </li></ul><ul><li>re-use your installation system in a pinch </li></ul>
    26. 26. Booting from NSS <ul><li>DEFSYS LINUX 0-1FF EW MINSIZE=6M </li></ul><ul><li>TRACE INST RANGE 10000.4 </li></ul><ul><li>IPL vaddr CLEAR </li></ul><ul><li>SAVESYS LINUX </li></ul><ul><li>TRACE END </li></ul><ul><li>IPL LINUX and enjoy! </li></ul>
    27. 27. INIT Scripts <ul><li>/etc/rc.d/init.d/thing [ start | stop ] </li></ul><ul><li>start, stop, restart, status, start_msg, stop_msg </li></ul><ul><li>can use on CMS (OpenExt) or USS </li></ul>
    28. 28. INIT Scripts <ul><li>associate a script with a runlevel </li></ul><ul><li>/etc/rc.d/rc3.d/S24thing </li></ul><ul><li> -> /etc/rc.d/init.d/thing </li></ul><ul><li>/etc/rc.d/rc3.d/K76thing -> /etc/rc.d/init.d/thing </li></ul><ul><li>“S” or “K” and 00 to 99 </li></ul>
    29. 29. Sample INIT Script <ul><li>case $1 in </li></ul><ul><li>start) </li></ul><ul><li>hcp xautolog syswreck </li></ul><ul><li>;; </li></ul><ul><li>stop) </li></ul><ul><li>hcp force syswreck </li></ul><ul><li>;; </li></ul><ul><li>start_msg) </li></ul><ul><li>echo “starting System Wrecker” </li></ul><ul><li>;; </li></ul><ul><li>esac </li></ul>
    30. 30. runlevel <ul><li>0 .. pass through to ‘halt’ </li></ul><ul><li>1 .. start-up or maint </li></ul><ul><li>2 .. limitted operation (text console) </li></ul><ul><li>3 .. normal operation (X console) </li></ul><ul><li>4 .. (alternate for #2) </li></ul><ul><li>5 .. (alternate for #3) </li></ul><ul><li>6 .. pass through to ‘reboot’ </li></ul>
    31. 31. Default Run-level <ul><li>/etc/inittab </li></ul><ul><li>The general syntax is ... </li></ul><ul><li>id : levels : action : process </li></ul><ul><li>id:2:initdefault: </li></ul>
    32. 32. INIT Scripts from inittab <ul><li>zz:23:once:/etc/rc.d/init.d/thing start </li></ul><ul><li>yy:23:once:/etc/rc.d/init.d/other start </li></ul>
    33. 33. Service Virtual Machine (Penguins) <ul><li>can use read-only root </li></ul><ul><li>may not need swap space </li></ul><ul><li>can use custom ‘init’ </li></ul><ul><li>must have interaction with other systems (network, spool space, DASD, IUCV) </li></ul>
    34. 34. VMSSL- secure sockets service machine <ul><li>#!/bin/sh </li></ul><ul><li>fsck /dev/dasdb </li></ul><ul><li>mount –o remount,rw /dev/dasdb / </li></ul><ul><li>mkswap /dev/dasdd </li></ul><ul><li>mount –a ; swapon –a </li></ul><ul><li>/etc/rc.d/init.d/vmssld start </li></ul><ul><li>while true ; do sh –i ; end </li></ul><ul><li>GPL “as is – no warranty” </li></ul>
    35. 35. Fun with VMSSL <ul><li> 1B0 = /boot </li></ul><ul><li> 1B1 = root </li></ul><ul><li> 1B3 = swap (v-disk) </li></ul><ul><li> 1BB = /opt/vmssl </li></ul><ul><li> /var/vmssl (in root) </li></ul><ul><li> 1BE = /usr </li></ul>
    36. 36. Filesystems <ul><li>disk is one thing -- filesystem is another </li></ul><ul><li>MVS combines the two concepts </li></ul><ul><li>distinction in most OS is not clear </li></ul><ul><li>distinction in UNIX is clear </li></ul><ul><li>Linux supports VFS for many FS types </li></ul>
    37. 37. RAMDISK? <ul><li>core or DASD, it’s all the same </li></ul><ul><li>UNIX distinguishes file organization from storage media, geometry, or hardware access method </li></ul><ul><li>RAMDISK is ... </li></ul><ul><ul><li>not just for installation </li></ul></ul><ul><ul><li>volatile </li></ul></ul><ul><ul><li>disposable </li></ul></ul>
    38. 38. Filesystem Types <ul><li>ext2 , minix, reiser, proc, nfs , </li></ul><ul><li>hpfs, ntfs, smb, ncp, </li></ul><ul><li>ufs, sysv, </li></ul><ul><li>fat: msdos, vfat, umsdos </li></ul><ul><li>iso (CD-ROM) </li></ul><ul><li>cms (yes, really!) </li></ul>
    39. 39. The Beauty of FBA <ul><li>DDR and ‘dd’ become equivalent </li></ul><ul><li>portable volumes: </li></ul><ul><li>inside Linux and out </li></ul><ul><li>between VM and Linux </li></ul><ul><li>CD-ROM: </li></ul><ul><li>-t iso9660 </li></ul><ul><li>Emulate FBA if you can- more efficient </li></ul>
    40. 40. Filesystem Optimization <ul><li>Mixing physical and logical blocksizes </li></ul><ul><li>logical > physical okay (usually 4K/4K) </li></ul><ul><li>logical < physical NOT OKAY </li></ul><ul><li>Can’t split physical blocks into multiple logical blocks. </li></ul>
    41. 41. CMS FS Driver <ul><li>download from ftp://ftp.bmc.com/pub/cmsfs/cmsfs.tar.gz </li></ul><ul><li>./configure </li></ul><ul><li>make module </li></ul><ul><li>insmod cmsfs.o </li></ul><ul><li>mount -t cms /dev/dasdx /CMS </li></ul><ul><li>(notice no “1” there) </li></ul>
    42. 42. CMS FS Utility <ul><li>download from ftp://ftp.bmc.com/pub/cmsfs/cmsfs.tar.gz (didn’t we just do this??) </li></ul><ul><li>./configure </li></ul><ul><li>make </li></ul><ul><li>enjoy! </li></ul>
    43. 43. CMS FS Utility <ul><li>TYPE </li></ul><ul><li>cmsfscat -d dev [ -a | -i ] fn.ft </li></ul><ul><li>LISTFILE </li></ul><ul><li>cmsfslst -d dev </li></ul><ul><li>Q DISK </li></ul><ul><li>cmsfsvol -d dev </li></ul><ul><li>COPYFILE </li></ul><ul><li>cmsfscp -d dev [ -a | -i ] fn.ft file </li></ul>
    44. 44. CMS FS Utility <ul><li>dev is /dev/dasdx (again, no “1” there) </li></ul><ul><li>-a for “alphameric” (text) </li></ul><ul><li>-i for image (binary) </li></ul><ul><li>conversion based on filetype in driver </li></ul>
    45. 45. CMS FS on Linux <ul><li>Two ways to do it: </li></ul><ul><li>cmsfscat -d /dev/dasdd -a profile.exec </li></ul><ul><li>mount -r -t cms /dev/dasdd /CMS cat /CMS/profile.exec </li></ul>
    46. 46. Tar-to-Tar <ul><li>Tip to copy file systems: </li></ul><ul><li>sh -c ‘ cd /source ; exec tar cf - . ‘ </li></ul><ul><li>| sh -c ‘ cd /target ; exec tar xpf - ‘ </li></ul>
    47. 47. Replication using Tar-to-Tar <ul><li>mkdir /old ; chmod 555 /old </li></ul><ul><li>mount –r /dev/dasdz /old </li></ul><ul><li>mkdir /new ; chmod 555 /new </li></ul><ul><li>mount /dev/dasdx /new </li></ul><ul><li>mkdir /new/usr ; chmod 555 /new/usr </li></ul><ul><li>mount /dev/dasdy /new/usr </li></ul><ul><li>sh -c ‘ cd /old ; exec tar cf - . ‘ </li></ul><ul><li>| sh -c ‘ cd /new ; exec tar xpf - ‘ </li></ul>
    48. 48. Networking <ul><li>ethernet (OSA or LCS), t/r, fddi, gdio </li></ul><ul><li>CTC (virtual or real) </li></ul><ul><li>IUCV Inter User Communication Vehicle (VM only) </li></ul>
    49. 49. Networking via VM <ul><li>Linux end should have an address </li></ul><ul><li>VM end need not have an address (may use addr of another VM device) </li></ul><ul><li>Linux uses a VM addr for default route </li></ul><ul><li>routers must route through VM to Linux </li></ul>
    50. 50. Network Config <ul><li>TurboLinux and RedHat /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-ctc0 </li></ul><ul><li>SuSE /etc/rc.config look for NETCONFIG, IPADDR_0, NETDEV_0 /etc/route.conf </li></ul>
    51. 51. Network Config <ul><li>/etc/HOSTNAME </li></ul><ul><ul><li>match the VM ID </li></ul></ul><ul><li>/etc/hosts </li></ul><ul><li>/etc/resolv.conf </li></ul>
    52. 52. ‘suloginv’ <ul><li>inspired by Q&D use of ‘sulogin’ </li></ul><ul><li>presumes secure console </li></ul><ul><li>run directly from inittab: </li></ul><ul><li>1:1236:respawn:/sbin/suloginv </li></ul><ul><li>(the “v” is for VM) </li></ul>
    53. 53. ‘suloginv’ <ul><li>CONSOLE=&quot;$1&quot; </li></ul><ul><li>if [ -z &quot;$CONSOLE&quot; ] ; then </li></ul><ul><li>CONSOLE=/dev/console ; fi </li></ul><ul><li>PS1=&quot;`hostname` &quot; </li></ul><ul><li>export PS1 </li></ul><ul><li>SHELL=/bin/sh </li></ul><ul><li>if [ -x /sbin/sh ] ; then SHELL=/sbin/sh ; fi </li></ul><ul><li>exec $SHELL -i 0<$CONSOLE 1>$CONSOLE 2>$CONSOLE </li></ul>
    54. 54. Shared filesystem gotcha <ul><li>RPM in shared filesystem </li></ul><ul><li>Install on one Linux image </li></ul><ul><li>Product files in shared filesystem available on all images, but </li></ul><ul><ul><li>RPM database won’t reflect install </li></ul></ul><ul><ul><li>Files not in shared filesystem missing </li></ul></ul><ul><li>Need install procedures to account for shared filesystems across multiple images </li></ul>
    55. 55. Hypervisor Interaction <ul><li>Neale Ferguson’s cpint package </li></ul><ul><li>Issue CP commands from Linux </li></ul><ul><li>http://linuxvm.org/penguinvm/programs/cpint-1.1.2.tar.gz </li></ul><ul><li>hcp q userid </li></ul><ul><li>hcp msg operator gimme more cycles </li></ul><ul><li>hcp disconn </li></ul><ul><li>hcp ipl cms </li></ul>
    56. 56. ‘chroot’ <ul><li>closest thing UNIX has to v-machine </li></ul><ul><li>mount new root, then run: </li></ul><ul><li>mount /dev/dasdx1 /mnt </li></ul><ul><li>chroot /mnt /bin/sh </li></ul><ul><li>… do stuff … </li></ul><ul><li>exit </li></ul><ul><li>umount /mnt </li></ul><ul><li>operationally similar to OVM or USS </li></ul>
    57. 57. ‘chroot’ <ul><li>useful for setting up a new system </li></ul><ul><li>useful for fixing a broken system </li></ul><ul><li>useful for security (eg: FTP padded cell) </li></ul>
    58. 58. Reset Root Password <ul><li>Bring up the installation system, then: </li></ul><ul><li>insmod dasd dasd=io-dev-range </li></ul><ul><li>mount /dev/dasda1 /mnt </li></ul><ul><li>chroot /mnt /bin/sh </li></ul><ul><li>passwd </li></ul><ul><li>exit </li></ul><ul><li>umount /mnt </li></ul><ul><li>rmmod dasd </li></ul>
    59. 59. Sysgen by any other name … <ul><li>Linux kernel build </li></ul><ul><li>cd /usr/src/linux </li></ul><ul><li>make clean </li></ul><ul><li>make menuconfig </li></ul><ul><li>make dep ; make clean </li></ul><ul><li>make image </li></ul><ul><li>or ‘make config’ or ‘make xconfig’ </li></ul>
    60. 60. zSeries X Windows <ul><li>Start X Server on Intel </li></ul><ul><ul><li>Exceed </li></ul></ul><ul><ul><li>Other competitors </li></ul></ul><ul><li>zSeries </li></ul><ul><ul><li>display=<hostname>:0,0 </li></ul></ul><ul><ul><li>export display </li></ul></ul>
    61. 61. <ul><li>in /var/X11R6/lib/Xservers </li></ul><ul><li>comment out :0 local /usr/X11R6/bin/X :0 </li></ul><ul><li>and add * foreign </li></ul><ul><li>in /var/X11R6/lib/xdm-config </li></ul><ul><li>comment out DisplayManager.requestPort: 0 </li></ul>Enabling XDM
    62. 62. Thank You!

    ×