七.解决文件系统问题
6.7.1恢复错误的超级块:如果在使用fsck或者mount命令时,出现以下错误时,可能是超级块损坏:fsck: Not an AIX3 file system
fsck: Not an AIXV3 file system
fsck: Not an AIX4 file system
fsck: Not an AIXV4 file system
fsck: Not a recognized file system type
mount: invalid argument
这些问题可以通过恢复超级块备份来解决:dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00.
对于AIX4:fsck –p /dev/lv00
一旦恢复进程完成,用fsck检查文件系统的完整性.
一般说来,超级块的恢复会恢复文件系统,如果没有恢复,重建文件系统然后恢复数据.
6.7.2不能umount文件系统
如果一个文件系统的任何参数仍然活动就不能被umount.下列情况可能让一个开放的参数留在mount的文件系统中:
1.文件系统中的文件打开了,对于这种情况可以用fuser命令检查活动状态,它为所有的在某个文件系统中有开放参数的进程返回ID:
fuser –xc /tmp
有开放参数的进程可以被杀死,然后就可以umount了.
2.文件系统可能由于核心进程打开了.fuser命令不会显示这些类型的参数,因为用户进程没有包括在内.但是genkex命令会报告所有的核心用户进程.
3.文件系统mount在另一个文件系统中,在umount一个文件系统之前,必须确认所有的mount在该文件系统mount点上的文件系统已经被umount.
4.一个进程在使用要umount的文件系统中的一个目录,fuer命令追加一个c到所有这些进程ID,-u参数区分进程的属主.可以和find命令一起使用.如:
find /home –type d –exec fuser –u {} \
意思是在/home目录下找到所有的目录,对每条记录执行fuser –u,然后回车.{}代表每条记录.对于一个交互进程,有一个确定的用户改变它们的工作目录到文件系统外.否则杀死该进程,就可以完成umount.
八.LVM命令总结
6.8.1PV命令:
getlvcb获取lvcb信息
lsdev列出ODM中的设备
chdev改变设备属性
mkdev加入设备
chpv改变PV状态
lspv显示一个VG中的PV的信息
migratepv从一个PV移动一个已分配的PP到一个或多个其他PV
6.8.2VG命令:
mirrorvg对VG镜象
unmorrorvg解除镜象
mkvg创建新VG
extendvg给一个VG加新的PV
reducevg从一个VG中删除一个PV
chvg改变VG属性
lsvg显示一个VG的信息
importvg安装一个VG
exportvg删除一个VG
reogrvg重组VG
syncvg同步VG
varyonvg使一个VG可用
varyoffvg使VG不可用
2.8.3LV命令
mklv创建LV
lslv列出LV属性
rmlv删除LV
extendlv增加一个LV的大小
chlv改变LV的属性
mklvcopy为一个LV增加副本
rmlvcopy从一个LV删除副本
6.8.4文件系统命令
chfs改变一个FS的属性
crfs加入一个FS
lsfs显示一个FS的属性
rmfs删除一个FS
mount使一个文件系统可用
umount使一个mount的文件系统或目录或文件不可用
fsck检查文件系统一致性并交互修复文件系统
df报告文件系统中的空间信息
1. While using the SMIT install menus to install an LPP, the response yes has been selected for the option: EXTEND file systems if space needed. After successfully installing the LPP, the /usr file system appears to be unnecessarily large. Which of the following actions can be performed to reduce the size of the /usr file system?
A. Backup, unmount, remove, recreate and restore the file system.
B. Unmount, run defragfs /usr and the reducefs -size XXX /usr commands.
C. Boot from mksysb tape and follow the procedure to reduce the file system.
D. Update /etc/filesystems with the desired size for /usr and reboot the
system.
4. A system has been recovered from a hard disk failure and the failed disk has been replaced with a new unformatted one. When the system administrator varies on the volume group, an error message about a missing or unavailable disk matches the one the system administrator replaced. Which of the following commands will eliminate this error message?
A. cfgmgr
B. export VGName
C. mkdev -1 hdisk3
D. reducevg -df VGName PVID