我正在尝试扩展第二卷/ u01,使用我以前使用的过程来扩展卷,而无需重新启动服务器。 我无法findLV名称和用于扩大音量的VG名称。
这可能只是在过去,我只更新了“8e Linux LVM”,而这是第一次尝试扩展“83 Linux”驱动器。 我还没有find任何过程来扩大这种驱动器types,而不卸载现有的驱动器。
我在vSphere中添加了空间,并扫描驱动器。
ls sd *
sda sda1 sda2 sdb sdb1 dev]# ls /sys/class/scsi_device/ 0:0:0:0 0:0:1:0 2:0:0:0 [root@lsaa21d dev]# echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan [root@lsaa21d dev]# echo 1 > /sys/class/scsi_device/0\:0\:1\:0/device/rescan [root@lsaa21d dev]# echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
运行fdisk我看到新的sdb2磁盘空间
fdisk -l
Disk /dev/sdb: 96.6 GB, 96636764160 bytes, 188743680 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x283108d4 Device Boot Start End Blocks Id System /dev/sdb1 2048 146800639 73399296 83 Linux <<< Volume to expand /dev/sdb2 146800640 188743679 20971520 83 Linux <<< Drive expansion Disk /dev/sda: 85.9 GB, 85899345920 bytes, 167772160 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000e448c Device Boot Start End Blocks Id System /dev/sda1 * 2048 1026047 512000 83 Linux /dev/sda2 1026048 167772159 83373056 8e Linux LVM Disk /dev/mapper/rhel_lor9p-root: 51.6 GB, 51636076544 bytes, 100851712 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/rhel_lor9p-swap: 8455 MB, 8455716864 bytes, 16515072 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk /dev/mapper/rhel_lor9p-home: 25.2 GB, 25211961344 bytes, 49242112 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes dev]# pvcreate /dev/sdb2 Physical volume "/dev/sdb2" successfully created.
的vgdisplay
--- Volume group --- VG Name rhel_lor9p System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 4 VG Access read/write VG Status resizable MAX LV 0 Cur LV 3 Open LV 3 Max PV 0 Cur PV 1 Act PV 1 VG Size 79.51 GiB PE Size 4.00 MiB Total PE 20354 Alloc PE / Size 20338 / 79.45 GiB Free PE / Size 16 / 64.00 MiB VG UUID 2IY7ZG-H4yn-1RrK-eHUI-RxSd-T8Qi-faCBAV
pvdisplay将
--- Physical volume --- PV Name /dev/sda2 VG Name rhel_lor9p PV Size 79.51 GiB / not usable 3.00 MiB Allocatable yes PE Size 4.00 MiB Total PE 20354 Free PE 16 Allocated PE 20338 PV UUID ToJPjk-ICWd-KG2T-Rjl0-88Lj-q4zR-e16HuK "/dev/sdb2" is a new physical volume of "20.00 GiB" --- NEW Physical volume --- PV Name /dev/sdb2 VG Name PV Size 20.00 GiB Allocatable NO PE Size 0 Total PE 0 Free PE 0 Allocated PE 0 PV UUID BdzW42-Yi8u-priM-Uuiy-Z8B2-aaLP-1WS4vh
因此,我尝试扩展或合并sdb1和sdb2驱动器空间的逻辑卷未find。
dev]# lvextend -L+20G /dev/rhel_lor9p/u01 Logical volume u01 not found in volume group rhel_lor9p.
编辑7/24 添加lvdisplay
--- Logical volume --- LV Path /dev/rhel_lor9p/swap LV Name swap VG Name rhel_lor9p LV UUID AWcuVC-5uRN-jrfJ-biQO-gpZf-IDmn-jPqrY8 LV Write Access read/write LV Creation host, time lor9p.salemstate.edu, 2016-06-02 12:54:31 -0400 LV Status available # open 2 LV Size 7.88 GiB Current LE 2016 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:1 --- Logical volume --- LV Path /dev/rhel_lor9p/home LV Name home VG Name rhel_lor9p LV UUID FkOe1k-chhq-nfrd-M3ly-OV13-i6Sb-HYwgoo LV Write Access read/write LV Creation host, time lor9p.salemstate.edu, 2016-06-02 12:54:31 -0400 LV Status available # open 1 LV Size 23.48 GiB Current LE 6011 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:2 --- Logical volume --- LV Path /dev/rhel_lor9p/root LV Name root VG Name rhel_lor9p LV UUID iTRJA7-ATOs-nr2v-ryUz-GeLl-FfgM-2ewf9t LV Write Access read/write LV Creation host, time lor9p.salemstate.edu, 2016-06-02 12:54:32 -0400 LV Status available # open 1 LV Size 48.09 GiB Current LE 12311 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 8192 Block device 253:0
添加DF -h
Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_lor9p-root 49G 5.0G 44G 11% / tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup /dev/sdb1 69G 66G 2.7M 100% /u01 /dev/sda1 497M 268M 229M 54% /boot /dev/mapper/rhel_lor9p-home 24G 5.4G 19G 23% /home
您需要扩展卷组,然后扩展逻辑卷。 你没有列出你试图延伸的LV,所以我会假设回家。 您将磁盘添加到LVM,现在扩展您的卷组。
$ vgextend rhel_lor9p /dev/sdb2
你目前的rhel_lor9p VG是80GB。 用sdb2扩展后,应该是100GB。
$ vgdisplay rhel_lor9p
然后你可以延长你的LV。
$ lvextend /dev/rhel_lor9p/home -L +10G
这将增加10GB到家里。 如果您在没有加号的情况下指定大小,则LVM会将LV设置为该大小。 用加号将这个空间量增加到当前LV的大小。
然后你扩展你的文件系统。 我假设你使用的是Red Hat或CentOS,因为你的VG名称中包含“rhel”。 但是,我不知道你的RHEL版本是什么,所以我不能确切的说明这个命令是什么,但是默认情况下,RHEL5和RHEL6分别使用ext3和ext4,而RHEL7切换到xfs。
对于ext3或4:
$ resize2fs /dev/rhel_lor9p/home
对于xfs:
$ xfs_growfs /dev/rhel_lor9p/home
这两种都将文件系统的大小调整到最大可用大小。 如果这不是你想要的,请参阅相应命令的手册页。
所有这些命令都可以在线完成。 他们不需要卸载文件系统。
可悲的是没有逻辑卷,我发现唯一的过程需要卸载驱动器。 我还发现,我无法将现有驱动器转换为逻辑卷,而不删除现有信息。 在获得一个窗口来卸载驱动器之后,我将按照RedHat发布的指示进行操作。
我也将更新configuration过程,以便我使用逻辑卷进行额外的驱动器。 在现场服务器上扩展驱动器的好处太重要,不能使用它。