Helps and Hints for Unix

In the four years I have done Unix system administration, I have found that I keep finding myself looking through newsgroups for fixes I discovered long ago. The purpose of these pages is to store these helpful tidbits for future use, and forget about having to research them time and again.

I am hoping you find these hints as helpful as I did.

There is also a separate page for databse help.

AIX | HP-UX | Solaris


Unable to read superblock (TERMINATED)
I had a particularly problematic 230 that liked to eat hard drives. This time, I looked into temporarily fixing the issue rather than just replace the drive outright. After all, it was a new drive; I suspect it was some other issue with the external housing that was causing the problem. At any rate, the process for fixing a bad primary superblock:

dd count=1 bs=4k skip=31 seek=1 if=/dev/lvname of=/dev/lvname

This copies the backup superblock over the primary. This is supposed to work for AIX 3.x, but I have used it for AIX 4.x with success. For AIX 4.x, I am told that the correct way is to do:

fsck -p /dev/lvname


Rebuilding volume groups missing physical volumes
I had an array where a disk in a RAID-0 group went bad on our Model 20 (yes, I am aware that RAID-0 is not fault-tolerant... but there were specific reasons for this). I found out that it had failed because I no longer could access the filesystems I was loading a cold backup from oracle on. Well, to make a long story short, in rebuilding the volume group I found I could not remove lvols or vgs due to the missing physical volume. The trick here is to rebuild /etc/lvmtab, and this is how:

# mv /etc/lvmtab /etc/lvmtab.old
# vgscan -a -v
# vgchange -a y

I also found that it still thought it had the logical volumes originally associated with it. Well, you need to manually clear these out since they no longer are in the LVMREC by:

# rm /dev/<vgroupname>/<lvolname>


A quick way to mount/unmount a floppy
This has got to be one of the fastest/easiest ways to do this... Put the floppy in, and type volcheck; it mounts the floppy automatically. Remove the floppy and do the same... voila, it's gone!

Guest Book | Email | Home

Revised: August 16, 1999