Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:cmd:lvm [2021/08/24 11:33] jslinux:cmd:lvm [2022/12/21 09:21] (current) js
Line 26: Line 26:
  
 === resize physical volume === === resize physical volume ===
 +You can use gparted live ios - do the partition magic .... and after that, resize the logical volume and extent the filesystem.
 +
 Rescan Host: Rescan Host:
 <code bash>[root@centos ~]# echo "- - -" >/sys/class/scsi_host/host0/scan</code> <code bash>[root@centos ~]# echo "- - -" >/sys/class/scsi_host/host0/scan</code>
Line 42: Line 44:
 /dev/sda2        411648   8800255   8388608    4G 82 Linux swap / Solaris /dev/sda2        411648   8800255   8388608    4G 82 Linux swap / Solaris
 /dev/sda3       8800256 209715199 200914944 95.8G 8e Linux LVM</code> /dev/sda3       8800256 209715199 200914944 95.8G 8e Linux LVM</code>
 +
 +or user cfdisk / parted:
 +<code bash>cfdisk</code>
 +
 +Get MB of free space:
 +<code bash>parted</code>
 +<code>unit MB</code>
 +<code>print</code>
 +Get the size of the disk in MB
 +<code bash>parted /dev/sda resizepart 2</code>
 +Enter size in MB - e.g. 24242MB
  
 resize resize
Line 54: Line 67:
  
 === resize logical volume === === resize logical volume ===
-resize logical volume<code bash>lvextend -l +100%FREE <path to lv e.g./dev/fsilun/lvfsilun></code+resize logical volume<code bash>[root@centos ~]# lvextend -l +100%FREE <path to lv e.g./dev/fsilun/lvfsilun> 
-<code>File descriptor 7 (pipe:[13154434]) leaked on lvextend invocation. Parent PID 3865: bash+ 
 +File descriptor 7 (pipe:[13154434]) leaked on lvextend invocation. Parent PID 3865: bash
   Size of logical volume fsilun/lvfsilun changed from 250.00 GiB (64000 extents) to 1000.00 GiB (256000 extents).   Size of logical volume fsilun/lvfsilun changed from 250.00 GiB (64000 extents) to 1000.00 GiB (256000 extents).
   Logical volume lvfsilun successfully resized</code>   Logical volume lvfsilun successfully resized</code>
-and than resize filesystem<code bash>resize2fs -p /dev/fsilun/lvfsilun</code> + 
-<code bash>resize2fs 1.41.12 (17-May-2010)+and than resize filesystem<code bash>[root@centos ~]# resize2fs -p /dev/fsilun/lvfsilun 
 + 
 +resize2fs 1.41.12 (17-May-2010)
 Filesystem at /dev/fsilun/lvfsilun is mounted on /mnt/fsi; on-line resizing required Filesystem at /dev/fsilun/lvfsilun is mounted on /mnt/fsi; on-line resizing required
 old desc_blocks = 16, new_desc_blocks = 63 old desc_blocks = 16, new_desc_blocks = 63