LVM on the Solaris Platform

Mirror to disks devdskc1t1d0 and devdskc1t2d0: lvextend −m 1 devvg01lvol4 devdskc1t1d0 devdskc1t2d0 • Check physical volume layout: pvdisplay −v devdskc0t1d0 pvdisplay −v devdskc0t2d0 pvdisplay −v devdskc1t1d0 pvdisplay −v devdskc1t2d0 • To make a journaled VxFS filesystem: Create VxFS filesystem: newfs −F vxfs devvg01rvol4 • Mount the new filesystem: mkdir mntvol4 mount devvg01lvol4 mntvol4 • Modify the etcfstab file; add the entry: devvg01lvol4 mntvol4 vxfs delaylog, datainlog,rw,suid 0 2 • To make 4 GB striped logical volume lvol5 across the six remaining disks: Create the logical volume LVM will select all disks: lvcreate −n lvol5 −i 6 −I 4 devvg01 • Check physical volume layout: pvdisplay −v devdskc0t3d0 pvdisplay −v devdskc0t4d0 pvdisplay −v devdskc0t5d0 pvdisplay −v devdskc1t3d0 pvdisplay −v devdskc1t4d0 pvdisplay −v devdskc1t5d0 • Create VxFS filesystem: newfs −F vxfs devvg01rvol5 • Mount the new filesystem: mkdir mntvol5 mount devvg01lvol5 mntvol5 • Modify the etcfstab file; add the entry: devvg01lvol5 mntvol5 vxfs delaylog, datainlog,rw,suid 0 3 • The remaining disk space can be managed in a similar way.

27.2.2 LVM on the Solaris Platform

For Solaris, VxVM is optional software; the standard OS installation uses disk partitions. Let us suppose that the OS was installed on two disk partitions this is one of the possible outputs of the installation program: 689 kernel c0t0d0s1 swap To prepare the root and swap mirrored volumes: Encapsulate the existing root and swap disk and create the mandatory default disk group rootdg and the root and swap volumes: vxencap −g rootdg −c btd01=c0t0d0 • Initialize and add a new disk into the disk group rootdg: vxdisksetup −i c1t0d0 vxdg −g rootdg adddisk btd02=c1t0d0 • Mirror the root and swap volumes: vxrootmir btd02 vxassist mirror swapvol layout =contig,diskalign btd02 • or alternatively: vxassist mirror rootvol layout =contig,diskalign btd02 vxbootsetup V_opt btd02 vxassist mirror swapvol layout =contig,diskalign btd02 • Modify EEPROM variables to make the system bootable from the alternate disk: eeprom use−nvramrc ?=true eeprom nvramrc =devalias vx−btd02 hwpath_for_c1t0d0 eeprom boot−device =disk vx−btd02 • The ten remaining disks will be placed into the disk group appldg and the new RAID0+1 volume will be created. VxVM supports RAID0+1. Initialize remaining disks: vxdisksetup −i c0t1d0 vxdisksetup −i c0t2d0 ..... vxdisksetup −i c1t4d0 vxdisksetup −i c1t5d0 • Create a new disk group with the first disk: vxdg init appldg apd01=c0t1d0 • Add the other disks into the group: vxdg −g appldg adddisk apd02=c0t2do vxdg −g appldg adddisk apd03=c0t3do ..... vxdg −g appldg adddisk apd09=c1t4do vxdg −g appldg adddisk apd10=c1t5do • Create the striped volume applvol of the maximum size RAID0, across five VM disks supposing Bourne or Korn shell: MAX = vxassist −g appldg −U fsgen −p maxsize layout= stripe,nolog,nstripe=5 \ stripeunit= 128 apd01 apd02 apd03 apd04 apd05 vxassist −g appldg −U fsgen make applvol MAX layout= stripe,nolog,nstripe=5 \ stripeunit= 128 apd01 apd02 apd03 apd04 apd05 • Mirror the created volume applvol RAID0, across five remaining VM disks RAID 0 +1: • 690 691

Chapter 28: UNIX Emergency Situations

28.1 Introductory Notes

UNIX systems run and behave very stably, especially if they are properly configured for their missions. Unfortunately, unpredicted and unwanted situations occur. A UNIX system, as any other computer system, can experience different problems giving quite a hard time to UNIX administrators. It is very important to be ready to handle such events. This chapter describes several procedures to overcome certain emergency situations. It is very instructive in the sense of what to do if something similar happens. Although the illustrated examples are related to Solaris and HP−UX flavors, they could also provide hints on how to approach the same problems on other UNIX platforms. In the first part, the problem of forgotten root password is addressed; more or less every UNIX administrator faces the same problem during the professional carrier. The second part describes some other cases when a recovery action is required, or at least preparedness for such an action is supposed. All presented examples are fully documented.

28.2 Lost Root Password

Almost all UNIX administrators during their professional careers face the problem of a lost root password; occasionally a root password for some of the existing UNIX systems drops out of our control, and we are no longer able to administer that system. In a network with several hundred UNIX boxes, administered by dozens of UNIX administrators, it is not so unusual to find a forgotten system that nobody has taken care of lately. How it happened, and why it has happened, is another issue; the fact is that a superuser access to this very system is not possible, and we desperately need it. UNIX predicts such situations, and each UNIX flavor does have a procedure to solve them. The forgotten password can never be recreated — it can only be replaced with a new password. However, UNIX allows the change of a password only if the old password is previously submitted as a proof of an authorized password replacement. Obviously, at the moment we are not able to fulfill this requirement. So the solution is to purge the encrypted root password in the etcpasswd file or etcshadow file, where encrypted passwords are normally kept. For this action the UNIX system has to be brought in the single−user mode. Two examples follow.

28.2.1 Solaris and Lost Root Password

This paragraph describes the emergency procedure to change the root password on Solaris 2.X platform if the root password was lost forgotten. When root access to the system is not possible, the usual procedures to change a password by using the command passwd, or to bring the system into single−user mode cannot be implemented. The emergency procedure requires the Solaris 2.X OS Installation CD disk. Start Solaris 2.X from CD in single−user mode. Put Solaris 2.6 Software CD in the CD drive. ok boot cdrom −s At this point the Mini OS — single−user mode — from CD is loaded into memory. 1. 692