Viewing File Systems with bdfYou can manually view the file systems you have mounted with the bdf command. bdf provides the following output:
Here is an example of bdf that is also in "Logical Volume Manager Background," covered earlier in this chapter: $ bdf
File System Maintenance with fsckfsck is a program used for file system maintenance on HP-UX systems. fsck checks file system consistency and can make many "life-saving" repairs to a corrupt file system. fsck can be run with several options, including the following:
$ umount /home $ fsck -m /dev/vg00/lvol5 vxfs fsck: sanity check: /dev/vg00/lvol5 OK
Since your system runs fsck on any file systems that were not marked as clean at the time you shut down the system, you can rest assured that when your system boots, any disks that were not properly shut down will be checked. It is a good idea to run fsck interactively on a periodic basis just so you can see firsthand that all of your file systems are in good working order. Should fsck find a problem with a directory or file, it would place these in the lost+found directory, which is at the top level of each file system. If a file or directory appears in lost+found, you may be able to identify the file or directory by examining it and move it back to its original location. You can use the file, what , and strings commands on a file to obtain more information about it to help identify its origin. How are file system problems created? The most common cause of a file system problem is improper shutdown of the system. The information written to file systems is first written to a buffer cache in memory. It is later written to the disk with the sync command by unmounting the disk, or through the normal use of filling the buffer and writing it to the disk. If you walk up to a system and shut off the power, you will surely end up with a file system problem. Data in the buffer that was not synchronized to the disk will be lost, the file system will not be marked as properly shut down, and fsck will be run when the system boots. A sudden loss of power can also cause an improper system shutdown. Proper shutdown of the system is described with the shutdown command. Although fsck is a useful utility that has been known to work miracles on occasion, you don't want to take any unnecessary risks with your file systems. So be sure to properly shut down your system. The /etc/fstab file mentioned earlier is used by fsck to determine the sequence of the file system check if it is required at the time of boot. The sequence of entries in /etc/fstab is important if a "pass number" for any of the entries does not exist. Here is an example of the /etc/fstab file: # System /etc/fstab file. Static information about the file # systems. See fstab(4) and for further details. /dev/vg00/lvol3 / vxfs delaylog 0 1 /dev/vg00/lvol1 /stand hfs defaults 0 1 /dev/vg00/lvol4 /tmp vxfs delaylog 0 2 /dev/vg00/lvol6 /opt vxfs delaylog 0 2 /dev/vg00/lvol5 /home vxfs delaylog 0 2 /dev/vg00/lvol7 /usr vxfs delaylog 0 2 /dev/vg00/lvol8 /var vxfs delaylog 0 2 /dev/dsk/c0tt6d0 /tmp/mnt9.x hfs rw, suid 0 2 v v v v v v
Initialize with mediainitA command you probably won't use, but should be aware of, is mediainit . Here are some of the options of mediainit :
newfs , which was used in some of the earlier examples, is used to create a new file system. newfs calls the mksf command earlier covered. newfs builds a file system of the type you specify (this is one of the commands that uses the -F option, so you can specify the file system type). |