User Tools

Site Tools


tech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs

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
Next revisionBoth sides next revision
tech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs [2009/11/03 14:56] ccumertech:documentation:procedures:vm:vm_disk_expansion_lvm_xfs [2010/04/27 12:44] kohofer
Line 5: Line 5:
  
 then from on the vm either create an additional partition on the free space. The partition type is 8e then from on the vm either create an additional partition on the free space. The partition type is 8e
-<code> + 
-cfdisk /dev/sda +  cfdisk /dev/sda 
-## for example if the new partition is /dev/sda3 +# for example if the new partition is /dev/sda3 
-## create logical disk /dev/sda3+ 
 +# create logical disk /dev/sda3 
 # make disk visible to linux # make disk visible to linux
-partprobe + 
-pvcreate /dev/sda3 +  partprobe 
-</code>+  pvcreate /dev/sda3 
  
 if you are running a newer kernel you can issue this command to male linux re-read the disk geometry: if you are running a newer kernel you can issue this command to male linux re-read the disk geometry:
-<code> + 
-echo "1" > /sys/class/scsi_device/<device>/device/rescan +  echo "1" > /sys/class/scsi_device/<device>/device/rescan 
-</code>+
  
 or assign the whole new disk to lvm assuming it's /dev/sdb or assign the whole new disk to lvm assuming it's /dev/sdb
-<code> + 
-apt-get install scsitools +  apt-get install scsitools 
-rescan-scsi-bus.sh +  rescan-scsi-bus.sh 
-cfdisk /dev/sdb+  cfdisk /dev/sdb 
 ### for example if the new partition is /dev/sda3 ### for example if the new partition is /dev/sda3
-pvcreate /dev/sdb + 
-</code>+   pvcreate /dev/sdb
  
 now you have to extend the volgroup. use ''lvdisplay'' to see which is the name of the group, in this example it's base now you have to extend the volgroup. use ''lvdisplay'' to see which is the name of the group, in this example it's base
-<code> + 
-lvdisplay +  lvdisplay 
   --- Logical volume ---   --- Logical volume ---
   LV Name                /dev/base/root   LV Name                /dev/base/root
Line 88: Line 92:
  
  
-</code> and we assume the new partition is /dev/sda3+and we assume the new partition is /dev/sda3
  
-<code> +  vgextend base /dev/sda3
-vgextend base /dev/sda3 +
-</code>+
  
 check with ''pvscan'' if the extend was successfull check with ''pvscan'' if the extend was successfull
  
-<code> +  pvscan
-pvscan +
-</code>+
  
 Now we extend the "data" partition to 11.5 GB. See man lvextend for other options\\ Now we extend the "data" partition to 11.5 GB. See man lvextend for other options\\
 11.5 G is the NEW total size of the disk we want to extend! 11.5 G is the NEW total size of the disk we want to extend!
  
-<code> + 
-lvextend -L 11.5G  /dev/base/data  +  lvextend -L 11.5G  /dev/base/data 
-</code>+ 
 +Extend with 20G 
 + 
 + 
 +  lvextend -L +20G  /dev/base/data 
  
 now we have to grow the filesystem /data now we have to grow the filesystem /data
-<code> + 
-xfs_growfs /data +   xfs_growfs /data 
-</code>+ 
 + 
 +===== For swap ===== 
 + 
 +swapoff /dev/base/swap  
 +lvextend -L 3.9G /dev/base/swap  
 +mkswap /dev/base/swap  
 +swapon /dev/base/swap  
 +free
  
 Check if filesystems are ok, and only then release the snapshot Check if filesystems are ok, and only then release the snapshot
 +
 +For ext2/ext3
 +
 +  resize2fs /dev/base/data
 +
/data/www/wiki.inf.unibz.it/data/pages/tech/documentation/procedures/vm/vm_disk_expansion_lvm_xfs.txt · Last modified: 2020/10/13 16:46 by kohofer