01/24/95 Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 SPECIAL NOTICES Information in this document is correct to the best of our knowledge at the time of this writing. Please send feedback by fax to "AIXServ Information" at (512) 823-4009. Please use this information with care. IBM will not be responsible for damages of any kind resulting from its use. The use of this information is the sole responsibility of the customer and depends on the customer's ability to eval- uate and integrate this information into the customer's operational environment. +----------------------------------------------------------+ | | | NOTE: The information in this document has NOT been | | verified for AIX 4.1. | | | +----------------------------------------------------------+ PROCEDURE If you receive one of the following errors from fsck, the problem may be a corrupted superblock. "fsck: Not an AIX3 file system." "fsck: Not an AIXV3 file system." "fsck: Not a recognized file system type." If the file system in question is on the rootvg volume group, follow the steps in the "With the rootvg Volume Group" section. If the file system in question is in a user-created volume group, follow the steps in the "With User-Created Volume Groups" section. WITH THE ROOTVG VOLUME GROUP Follow these steps if you received the fsck errors on a file system that is NOT in a user-created volume group. 1. Turn the key to the Service position. 2. With bootable media OF THE SAME VERSION AND LEVEL AS THE SYSTEM, boot the system. Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 1 01/24/95 +----------------------------------------------------------+ | | | WARNING: If you boot a 3.2 system with 3.1 media, or | | boot a 3.1 system with 3.2 media, then you will not be | | able to use the standard scripts (getrootfs or | | /etc/continue) to bring your workstation into full main- | | tenance mode. | | | | Moreover, performing the scripts on a 3.1 system with | | 3.2 boot media may actually remove some files and | | prevent your system from booting successfully in normal | | mode until missing files (/etc/mount and /etc/umount) | | are replaced on the disk. | | | +----------------------------------------------------------+ NOTES: a. For information on BOSboot diskettes, refer to InfoExplorer or order fax #2462 from 1-800-IBM-4FAX (or 415-855-4FAX outside the U.S. from a fax machine phone). b. If booting from diskettes, when you see LED c07, insert the next diskette. This may be the optional display extensions diskette (required for AIX 3.2.5) or the display diskette. c. If you have AIX 3.2.5, used a fddi network install, and selected that option for the install device, you will need the communications extensions diskette. If this diskette is not available, you can build it from another system with fddi installed or call your branch office for assistance. Follow the prompts to the installation/maintenance menu. 3. Choose the maintenance shell (option 5 for AIX 3.1, option 4 for AIX 3.2). 4. Determine the hdisk# to use with the getrootfs or /etc/continue command. If you have only one disk, then "hdisk0" is the proper hdisk# to use. If you have more than one disk, do the following: o FOR AIX 3.2.4 OR LATER: Run getrootfs The output indicates the disk that should be used with getrootfs in the next step. o FOR AIX 3.1 TO 3.2.3E: Run lqueryvg -Atp hdisk# | grep hd5 Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 2 01/24/95 for each hdisk# (hdisk0, hdisk1, etc.) until you get output that looks like: 00005264feb3631c.2 hd5 1 The exact output you get will be different but will follow the form large_number.x hd5 1 You may find more than one disk has this output. These will all be disks which belong to the rootvg volume group. You may use any of the disks identi- fied to be in rootvg in the following step. 5. Now access the rootvg volume group by running /etc/continue (for AIX 3.1) or getrootfs (for AIX 3.2). ('#' is the number of the fixed disk, determined in step 4 on page 2). For AIX 3.1 only: /etc/continue hdisk# sh For AIX 3.2 only: getrootfs hdisk# sh If you get errors from /etc/continue or getrootfs, do not continue with the rest of this procedure. Correct the problem causing the error. If you need assistance correcting the problem causing the error, contact one of the following: o local branch office o your point of sale o 1-800-CALL-AIX (to register for fee-based services) All of the above avenues for assistance may be billable. 6. For AIX 3.2.4 or greater, enter the following command: ODMDIR=/dev/objrepos 7. Try rebuilding the log device: For AIX 3.1 only: /etc/aix/logform /dev/hd8 For AIX 3.2 only: /usr/sbin/logform /dev/hd8 Answer YES when asked if you want to destroy the log. 8. Next, run the following commands to check and repair file systems. (The "-y" option gives fsck permission to repair file systems when necessary.) fsck -y /dev/hd1 fsck -y /dev/hd2 fsck -y /dev/hd3 fsck -y /dev/hd4 For AIX 3.2 only, also run fsck -y /dev/hd9var Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 3 01/24/95 Continue with the following steps whether or not you received errors from fsck. 9. Type "exit" to exit from the shell. The file systems will automatically mount after you type "exit". If you get the same fsck errors now during the automatic mounting as you did before starting this procedure, skip to step 12 now. 10. With the key in Normal position, enter the following: sync;reboot If you still get the errors from fsck during the reboot, follow steps 1 through 4 again and then skip to step 11. If you did not get the fsck errors during reboot, you are finished with this procedure. Reboot the system in Normal mode. Do not continue with the following steps. 11. Now access the rootvg volume group (hd5) by running /etc/continue (for AIX 3.1) or getrootfs (for AIX 3.2). ('#' is the number of the fixed disk, determined in step 4.) For AIX 3.1 only: /etc/continue hdisk# For AIX 3.2 only: getrootfs hdisk# 12. Check the entry in block 1000 of the file system in question (/dev/hd4 is used as an example): For AIX 3.1 only: /usr/lpp/bosinst/hdf /dev/hd4 1000 100 For AIX 3.2 only: /usr/sbin/hdf /dev/hd4 1000 100 The output should look something like this: 00001000 43218765 00000000 00000800 0000001F |C!.e............| 00001010 0001A000 10000000 2F000000 0000726F |......../.....ro| 00001020 6F740000 000A0004 01000000 294CD89F |ot..........)L..| 00001030 00000000 00000000 00000000 00000000 |................| 00001040 00000000 00000000 00000000 00000000 |................| You will notice the "43218765" in the second column of the first line. This is the magic number. You'll also see in the strings "/" and "root"; that is, the mount point and "vol =" entry for the file system, respec- tively. If the entry at address 1000 is something other than 43218765, fsck will give an error indicating that it is not an AIXV3 file system. 13. Check the entry in block 1F000 of the file system in question (/dev/hd4 is used as an example): For AIX 3.1 only: /usr/lpp/bosinst/hdf /dev/hd4 1F000 100 For AIX 3.2 only: /usr/sbin/hdf /dev/hd4 1F000 100 Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 4 01/24/95 The output should look something like this: 0001F000 43218765 00000000 00000800 00000000 |C!.e............| 0001F010 0001A000 10000000 2F000000 0000726F |......../.....ro| 0001F020 6F740000 FFFFFFFF 00000000 294CD89F |ot..........)L..| 0001F030 00000000 00000000 00000000 00000000 |................| 0001F040 00000000 00000000 00000000 00000000 |................| If you see "43218765" in the second column of the first line, then you can issue the following command to copy this BACKUP superblock to the CURRENT superblock: dd count=1 bs=4k skip=31 seek=1 if=/dev/hd4 of=/dev/hd4 Now check the integrity of the file system by executing the following command: fsck /dev/hd4 2>&1 | tee /tmp/fsck.errors You may look at the file /tmp/fsck.errors to see what corrections fsck states need to be made. In most cases, by copying the BACKUP superblock entry to the CURRENT superblock entry, you will be able to recover your file system. If this does not work, you will have to re- create the file system, and restore the data from a backup. WITH USER-CREATED VOLUME GROUPS Follow these steps if you received the fsck error on a file system in a user-created volume group. 1. Unmount all file systems that reside in the volume group with the following command: (where lvXX is the name of the logical volume) umount /dev/lvXX 2. Determine the log device for the volume group with the following command: lsvg -l vg_name | grep jfslog Sample output: loglv00 jfslog 1 1 1 closed/syncd N/A The name of the log device in the sample output is: loglv00 3. Try rebuilding the log device: (note that the log device name was obtained in step 2) /usr/sbin/logform /dev/loglv00 Answer YES when asked if you want to destroy the log. 4. Next, run the following commands to check and repair all file systems that reside in the volume group in question Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 5 01/24/95 (the same file systems which were unmounted in step 1). The "-y" option gives fsck permission to repair file systems when necessary. fsck -y /dev/lvXX 5. Attempt to mount the file systems in the volume group in question by issuing the following command: mount all 6. If you were not able to mount a particular file system, follow steps 12 and 13 in the "With the rootvg Volume Group" section for that file system. Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 6 01/24/95 READER'S COMMENTS Please fax this form to (512) 823-4009, attention "AIXServ Informa- tion". You may also e-mail comments to: elizabet@austin.ibm.com. These comments should include the same customer information requested below. Use this form to tell us what you think about this document. If you have found errors in it, or if you want to express your opinion about it (such as organization, subject matter, appearance) or make sug- gestions for improvement, this is the form to use. If you need technical assistance, contact your local branch office, point of sale, or 1-800-CALL-AIX (for information about support offer- ings). These services may be billable. Faxes on a variety of sub- jects may be ordered free of charge from 1-800-IBM-4FAX. Outside the U.S. call 415-855-4329 using a fax machine phone. When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any way it believes appropriate without incurring any obligation to you. NOTE: If you have a problem report or item number, supplying that number may help us determine why a procedure did or did not work in your specific situation. Problem Report or Item #: Branch Office or Customer #: Be sure to print your name and fax number below if you would like a reply: Name: Fax Number: ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ ______________________________________________________________________ END OF DOCUMENT (superblock.recover.krn, 4FAX# 2264) Recovery from a Corrupted Superblock in AIX 3.1 or 3.2 7