记录一个问题的处理过程:
环境:suse 9,oracle 9,外接一个存储用于备份;
发现/backup目录下为空,但是又可看到该目录
ciqhist:/ # df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 320G 290G 15G 96% /
tmpfs 7.9G 8.0K 7.9G 1% /dev/shm
/dev/sda1 198M 11M 177M 6% /boot
/dev/mapper/backupvg-backuplv 790G 642G 108G 86% /backup
ciqhist:/ # mount
/dev/sda3 on / type ext3 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda1 on /boot type ext3 (rw,acl,user_xattr)
/dev/hda on /media/dvd type subfs (ro,nosuid,nodev,fs=cdfss,procuid,iocharset=utf8)
usbfs on /proc/bus/usb type usbfs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/dev/mapper/backupvg-backuplv on /backup type ext3 (rw)
尝试先umount该/backup,
# umount /backup
失败,报 device is busy
同时通过fdisk -l查看磁盘,发现没有挂载lvm磁盘;
怀疑是存储断掉了;
强制kill掉访问该目录的进程
ciqhist:/ # fuser -km /backup
/backup: 30478 30482
再umount该目录,成功
ciqhist:/ # umount /backup
经现场人员确认,存储前段时间关掉,刚启动存储。
关闭数据库,重启服务器;
重启服务器后,
fdisk -l 查看存储已经可以识别到了;
挂载该目录还是报错
ciqhist:/ # mount /dev/mapper/backupvg-backuplv /backup
/dev/mapper/backupvg-backuplv: Inappropriate ioctl for device
mount: /dev/mapper/backupvg-backuplv: can't read superblock
查看本机发现没有vg 和 lv
重新扫描
ciqhist:~ # pvscan
PV /dev/sdb1 VG backupvg lvm2 [801.88 GB / 80.00 MB free]
Total: 1 [801.88 GB] / in use: 1 [801.88 GB] / in no VG: 0 [0 ]
ciqhist:~ # vgscan
Reading all physical volumes. This may take a while...
Found volume group "backupvg" using metadata type lvm2
ciqhist:~ # lvscan
inactive '/dev/backupvg/backuplv' [801.80 GB] inherit
ciqhist:~ # pvs
PV VG Fmt Attr PSize PFree
/dev/sdb1 backupvg lvm2 a- 801.88G 80.00M
ciqhist:~ # lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
backuplv backupvg -wi--- 801.80G
ciqhist:~ # vgs
VG #PV #LV #SN Attr VSize VFree
backupvg 1 1 0 wz--n 801.88G 80.00M
mount依然报错
ciqhist:~ # mount -t ext3 /dev/mapper/backupvg-backuplv /backup
mount: /dev/mapper/backupvg-backuplv is not a valid block device
激活该vg
ciqhist:~ # vgchange -a y
1 logical volume(s) in volume group "backupvg" now active
ciqhist:~ # lvs
LV VG Attr LSize Origin Snap% Move Log Copy%
backuplv backupvg -wi-a- 801.80G
ciqhist:~ # lvscan
ACTIVE '/dev/backupvg/backuplv' [801.80 GB] inherit
ciqhist:~ # mount -t ext3 /dev/mapper/backupvg-backuplv /backup
挂载成功。
lvm管理激活参考:http://ljx198308.blog.163.com/blog/static/1762742462011292134116/