Redhat

無法調整邏輯卷的大小

  • July 20, 2016

我在lvdisplayvs中顯示可用空間的差異df -h

[user@box]~ lvdisplay

 --- Logical volume ---
 LV Path                /dev/rhel_data/www
 LV Name                www
 VG Name                rhel_data
 LV UUID                898kpA-ZtbV-RjEB-Qu6V-tM5v-cEvd-KjbtZS
 LV Write Access        read/write
 LV Creation host, time box.example.com, 2016-06-14 16:43:11 -0400
 LV Status              available
 # open                 1
 LV Size                279.38 GiB
 Current LE             71521
 Segments               3
 Allocation             inherit
 Read ahead sectors     auto
 - currently set to     8192
 Block device           253:6

上面的捲安裝在 /data/www。

[user@box ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/dm-19       47G   47G  3.2M 100% /data/www


[user@box ~]# umount /dev/mapper/rhel_data-www 
umount: /dev/mapper/rhel_data-www: not mounted
[user@box ~]# umount /data/www/

[user@box ~]# resize2fs /dev/mapper/rhel_data-www 
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Device or resource busy while trying to open /dev/mapper/rhel_data-www
Couldn't find valid filesystem superblock.

坐騎的相關資料:

[user@box]~ mount | grep www
/dev/mapper/luks-e258bd7a-3201-457e-8ade-695c87c53e36 on /data/www type xfs (rw,nosuid,nodev,noexec,relatime,seclabel,attr2,inode64,noquota) 

如何利用 lvdisplay 顯示的額外空間?

在調整捲大小後擴展 XFS 文件系統以使用分配給它的空間

xfs_growfs /mount/point

例如

xfs_growfs /data/www

引用自:https://serverfault.com/questions/790997