历史:我们的HP Proliant,Centos 5.9服务器昨天没有正确的关机程序.从那时起,/ home分区一直处于我们无法攻击它,挂载或卸载它的状态. umount声明它没有挂载,但mount / fsck表示它正忙或已挂载.这最初导致服务器无法启动.我们最终从/ etc / fstab中删除了磁盘/分区,以便启动不会失败.
# mount -t ext3 /dev/cciss/c0d0p1 /home mount: /dev/cciss/c0d0p1 already mounted or /home busy # fsck /dev/cciss/c0d0p1 fsck 1.39 (29-May-2006) e2fsck 1.39 (29-May-2006) fsck.ext3: Device or resource busy while trying to open /dev/cciss/c0d0p1 Filesystem mounted or opened exclusively by another program?
如您所见,磁盘未以任何方式安装.
df输出:
# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/cciss/c0d1p3 198381228 24920704 163220696 14% / /dev/cciss/c0d1p2 267818128 191652 253802544 1% /logs /dev/cciss/c0d1p1 194442 33575 150828 19% /boot tmpfs 49495044 0 49495044 0% /dev/shm
装载输出:
# mount /dev/cciss/c0d1p3 on / type ext3 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) /dev/cciss/c0d1p2 on /logs type ext3 (rw) /dev/cciss/c0d1p1 on /boot type ext3 (rw) tmpfs on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/ etc / fstab文件
# cat /etc/fstab LABEL=/ / ext3 defaults 1 1 LABEL=/logs /logs ext3 defaults 1 2 LABEL=/boot /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 LABEL=SW-cciss/c0d1p5 swap swap defaults 0 0
在/ etc / mtab中
# cat /etc/mtab /dev/cciss/c0d1p3 / ext3 rw 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 devpts /dev/pts devpts rw,mode=620 0 0 /dev/cciss/c0d1p2 /logs ext3 rw 0 0 /dev/cciss/c0d1p1 /boot ext3 rw 0 0 tmpfs /dev/shm tmpfs rw 0 0 none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
的/ proc /坐骑
# cat /proc/mounts rootfs / rootfs rw 0 0 /dev/root / ext3 rw,data=ordered 0 0 /dev /dev tmpfs rw 0 0 /proc /proc proc rw 0 0 /sys /sys sysfs rw 0 0 /proc/bus/usb /proc/bus/usb usbfs rw 0 0 devpts /dev/pts devpts rw 0 0 /dev/cciss/c0d1p2 /logs ext3 rw,data=ordered 0 0 /dev/cciss/c0d1p1 /boot ext3 rw,data=ordered 0 0 tmpfs /dev/shm tmpfs rw 0 0 none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0 /etc/auto.misc /misc autofs rw,fd=7,pgrp=9694,timeout=300,minproto=5,maxproto=5,indirect 0 0 -hosts /net autofs rw,fd=13,indirect 0 0
lsof的
# lsof /dev/cciss/c0d0p1 #
定影
# fuser /dev/cciss/c0d0p1 #
fdisk -l
# fdisk -l /dev/cciss/c0d0 Disk /dev/cciss/c0d0: 1800.2 GB,1800280694784 bytes 255 heads,63 sectors/track,218871 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/cciss/c0d0p1 * 1 218871 1758081276 83 Linux
根据网络上的其他建议,我们使用ILO3远程终端启动Centos LiveCD.当我们这样做时,我们能够安装/卸载,fsck,分区没有任何错误或问题. (即:磁盘本身很好).
我们还使用“debugfs”为Journal Inode< 8>执行inode clear.然后fsck重新构建了日志而没有错误.同样,我们能够在启动到LiveCD时毫无问题地安装/卸载磁盘.
当我们切换回正常启动分区时,由于操作系统认为分区繁忙,我们回到同一个地方,无法挂载或fsck.
我想了解Linux中的其他内容可能表明此磁盘正在使用中.可以使用哪些其他实用程序来查找并清除它?
任何帮助是极大的赞赏.
其他信息,如要求:
lsof和fuser on / home,以及显示/ home内容和目录权限.
# lsof /home # fuser /home # ls -la /home total 16 drwxr-xr-x 2 root root 4096 Mar 15 2013 . drwxr-xr-x 27 root root 4096 Nov 19 08:31 .. # ls -l / | grep home drwxr-xr-x 2 root root 4096 Mar 15 2013 home #
mount -o remount失败,因为自最近一次启动以来尚未安装此分区. (这是自服务器安装以来的一个工作分区,并且在昨天硬重启后才显示此问题).
# mount -o remount -t ext3 /dev/cciss/c0d0p1 /home mount: /home not mounted already,or bad option
我可以将此分区重新添加到/ etc / fstab,并在需要时重新启动.
2013/11/19上午11:12 CST
dmsetup输出:
# dmsetup table mpath0: 0 3516173232 multipath 1 queue_if_no_path 0 1 1 round-robin 0 1 1 104:0 1000 mpath0p1: 0 3516162552 linear 253:0 63 # dmsetup info Name: mpath0 State: ACTIVE Read Ahead: 256 Tables present: LIVE Open count: 1 Event number: 1 Major,minor: 253,0 Number of targets: 1 UUID: mpath-3600508b1001cb6e6453d25c4052abca5 Name: mpath0p1 State: ACTIVE Read Ahead: 256 Tables present: LIVE Open count: 0 Event number: 0 Major,1 Number of targets: 1 UUID: part1-mpath-3600508b1001cb6e6453d25c4052abca5
lsof -n
# lsof -n | grep /home #
最终解决方案
# multipath -ll mpath0 (3600508b1001cb6e6453d25c4052abca5) dm-0 HP,LOGICAL VOLUME [size=1.6T][features=1 queue_if_no_path][hwhandler=0][rw] \_ round-robin 0 [prio=1][active] \_ #:#:#:# cciss!c0d0 104:0 [active][ready] # multipath -F # multipath -ll # # mount -t ext3 /dev/cciss/c0d0p1 /home # cat /proc/mounts | grep home /dev/cciss/c0d0p1 /home ext3 rw,data=ordered 0 0
使用dmsetup表检查设备映射表.如果它在那里,请使用dmsetup删除< name>清除映射.
如果没有,请在dmesg中查找错误.
# dmsetup table mpath0: 0 3516173232 multipath 1 queue_if_no_path 0 1 1 round-robin 0 1 1 104:0 1000 mpath0p1: 0 3516162552 linear 253:0 63
啊啊! multipath声称磁盘.你可以通过运行multipath -ll来看到.
运行:multipath -F刷新所有未使用的映射,然后multipath -ll不输出任何内容.
或者,只需使用/ dev / mapper / mpath0p1而不是/ dev / cciss / c0d0p1.