[root@kvm7 ~]# df -Th /home Filesystem Type Size Used Avail Use% Mounted on /dev/mapper/vg_kvm7home-vo xfs 97M 5.3M 92M 6% /home
[root@kvm7 ~]# umount /home umount: /home: target is busy. (In some cases useful info about processes that use the device is found by lsof(8) or fuser(1))
[root@kvm7 ~]# lsof | grep /home automount 1539 root 16r DIR 0,37 0 18663 /home/guests automount 1539 1540 root 16r DIR 0,37 0 18663 /home/guests automount 1539 1541 root 16r DIR 0,37 0 18663 /home/guests automount 1539 2032 root 16r DIR 0,37 0 18663 /home/guests automount 1539 2068 root 16r DIR 0,37 0 18663 /home/guests automount 1539 2096 root 16r DIR 0,37 0 18663 /home/guests
[root@kvm7 ~]# systemctl stop autofs.service [root@kvm7 ~]# umount /home
/dev/vg_kvm7home/vo
由 100M 縮小為 50M,出現 Xfs 檔案系統不支援縮小的訊息,表示 lvm 中 xfs 檔案系統格式的 lv 無法直接縮小,若真有必要縮小,必須建一個新的較小的 lv,將資料移過去後再刪除目前的 lv。
[root@kvm7 ~]# lvresize -L 50M /dev/vg_kvm7home/vo -r Phase 1 - find and verify superblock... Phase 2 - using internal log - scan filesystem freespace and inode maps... - found root inode chunk Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - process known inodes and perform inode discovery... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity... - traversing filesystem ... - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify link counts... No modify flag set, skipping filesystem flush and exiting. fsadm: Xfs filesystem shrinking is unsupported fsadm failed: 1 Filesystem resize failed.