How to force xfs filesystem to shutdown?

How to force xfs filesystem to shutdown?

 SOLUTION UNVERIFIED - 已更新 2019年四月8日10:47 - 

English 

環境

  • Red Hat Enterprise Linux 7
  • XFX filesystem

問題

  • Unmounting an xfs filesystem failed with EBUSY.

Raw

# umount /mount_point
umount: /mount_path: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
  • Could not identify any user process accessing the filesystem:

Raw

# fuser -muv /mount_point
                     USER        PID ACCESS COMMAND
/mount_path:               root     kernel mount (root)/mount_point

# lsof | grep "/mount_point"
# 
  • Unmounted the filesystem with --lazy option to detach that from the filesystem hierarchy.

Raw

# umount -l /mount_point
# 
  • After that, deactivating the volume group still failed with below error:

Raw

# vgchange -an vg01
  Logical volume vg01/lv01 contains a filesystem in use.
  Can't deactivate volume group "vg01" with 1 open logical volume(s)
  • Looks like some unknown process stil have an access on the filesystem after that filesystem was detached from the filesystem hierarchy with --lazy umount option. How do I force an xfs filesystem to shutdown when unmounting that filesystem failed?

決議

  • Use xfs_io shutdown to shutdown the xfs filesystem forcibly.

Raw

# umount /mount_point/
umount: /mount_point: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

# xfs_io -x -c 'shutdown -f' /mount_point
# 

# ls /mount_point
ls: cannot access /mount_point: Input/output error

# df /mount_point
df: ‘/mount_point’: Input/output error
  • After that, please try to unmount that filesystem and deactivate the volume group:

Raw

# umount /mount_point
# 

# vgchange -an vg01
  0 logical volume(s) in volume group "vg01" now active
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章