Differences

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

Link to this comparison view

Both sides previous revision Previous revision
server-administration:shrink-lvm-volume [2009-10-09 13:09:34]
garrett.plasky
server-administration:shrink-lvm-volume [2011-07-01 12:20:18] (current)
garrett.plasky Approved
Line 2: Line 2:
 The following steps will show you how to shrink an LVM volume. ​ In this example we will be shrinking volume VolGroup00-LogVol00 down to 20GB. **Note:** This can and will cause data loss if performed improperly or on a volume that you attempt to shrink below the current volume usage. With that said, the steps are as follows: The following steps will show you how to shrink an LVM volume. ​ In this example we will be shrinking volume VolGroup00-LogVol00 down to 20GB. **Note:** This can and will cause data loss if performed improperly or on a volume that you attempt to shrink below the current volume usage. With that said, the steps are as follows:
  
-<code console>umount /​dev/​mapper/​VolGroup00-LogVol00 +<sxh shell>umount /​dev/​mapper/​VolGroup00-LogVol00 
-e2fsck -f /​dev/​mapper/​VolGroup00-LogVol00 +e2fsck -f /​dev/​mapper/​VolGroup00-LogVol00 
-resize2fs /​dev/​mapper/​VolGroup00-LogVol00 20G +resize2fs /​dev/​mapper/​VolGroup00-LogVol00 20G 
-lvreduce -L 20G /​dev/​mapper/​VolGroup00-LogVol00 +lvreduce -L 20G /​dev/​mapper/​VolGroup00-LogVol00 
-e2fsck -f /​dev/​mapper/​VolGroup00-LogVol00</​code>+e2fsck -f /​dev/​mapper/​VolGroup00-LogVol00</​sxh>
  
 The process is similar when expanding a logical volume except the <​c>​lvextend</​c>​ command is used in place of <​c>​lvreduce</​c>​. The process is similar when expanding a logical volume except the <​c>​lvextend</​c>​ command is used in place of <​c>​lvreduce</​c>​.
  
 {{tag>​lvm how-to}} {{tag>​lvm how-to}}