Difference between revisions of "growing root partition"
(Created page with " Example 20GB disk space [Expert@chkpfw1:0]# '''df -h''' Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_splat-lv_current 4....") |
|||
Line 1: | Line 1: | ||
+ | == Problem == | ||
− | Example | + | insufficient disk space to apply an upgrade. |
+ | |||
+ | O.S. : secure platform (splat) or gaia | ||
+ | |||
+ | Check Point versions: multiple | ||
+ | |||
+ | |||
+ | == Solution == | ||
+ | |||
+ | Use available, unallocated disk space. Newer Check Point version use LVM. Check Point often doesn't allocate it all. This not a bad thing. It is a common, best practice with LVM. This allows admins to easily grow partitions as needed using the free disk space. If you allocated it all up front, but needed one partition bigger, you would have to shrink one to grow another. This is more complicated. With root, it can't be shrunk while the system is running(it can be grown as we are about to see). | ||
+ | |||
+ | '''Example''' | ||
20GB disk space | 20GB disk space | ||
+ | |||
+ | [Expert@chkpfw2:0]# '''vgdisplay | grep -i size''' | ||
+ | /dev/hdc: open failed: No medium found | ||
+ | VG Size 18.69 GB | ||
+ | PE Size 32.00 MB | ||
+ | Alloc PE / Size 384 / 12.00 GB | ||
+ | Free PE / Size 214 / 6.69 GB | ||
+ | |||
Line 16: | Line 36: | ||
− | adding 6 gig | + | adding 6 gig to the vg "container" |
− | [Expert@ | + | |
− | Extending logical volume lv_current to 11. | + | [Expert@chkpfw2:0]# '''lvresize -L +6.69GB vg_splat/lv_current''' |
+ | /dev/hdc: open failed: No medium found | ||
+ | Rounding up size to full physical extent 6.72 GB | ||
+ | Extending logical volume lv_current to 11.72 GB | ||
+ | Insufficient free space: 215 extents needed, but only 214 available | ||
+ | |||
+ | that failed... specifying the increase in GB is less precise. So, lets use "extents" | ||
+ | |||
+ | [Expert@chkpfw2:0]# '''lvresize -l +214 vg_splat/lv_current''' | ||
+ | /dev/hdc: open failed: No medium found | ||
+ | Extending logical volume lv_current to 11.69 GB | ||
Logical volume lv_current successfully resized | Logical volume lv_current successfully resized | ||
− | [Expert@ | + | verifying resized volume group |
+ | |||
+ | [Expert@chkpfw2:0]# vgdisplay | grep -i -E "name|size" | ||
+ | /dev/hdc: open failed: No medium found | ||
+ | VG Name vg_splat | ||
+ | VG Size 18.69 GB | ||
+ | PE Size 32.00 MB | ||
+ | Alloc PE / Size 598 / 18.69 GB | ||
+ | Free PE / Size 0 / 0 | ||
+ | |||
+ | growing the file system to fill the "container" | ||
+ | |||
+ | [Expert@chkpfw2:0]# '''resize2fs /dev/mapper/vg_splat-lv_current''' | ||
resize2fs 1.39 (29-May-2006) | resize2fs 1.39 (29-May-2006) | ||
Filesystem at /dev/mapper/vg_splat-lv_current is mounted on /; on-line resizing required | Filesystem at /dev/mapper/vg_splat-lv_current is mounted on /; on-line resizing required | ||
− | Performing an on-line resize of /dev/mapper/vg_splat-lv_current to | + | Performing an on-line resize of /dev/mapper/vg_splat-lv_current to 3063808 (4k) blocks. |
− | The filesystem on /dev/mapper/vg_splat-lv_current is now | + | The filesystem on /dev/mapper/vg_splat-lv_current is now 3063808 blocks long. |
+ | |||
+ | viewing newly allocated disk space | ||
+ | |||
+ | [Expert@chkpfw2:0]# df -h | ||
+ | Filesystem Size Used Avail Use% Mounted on | ||
+ | /dev/mapper/vg_splat-lv_current | ||
+ | 12G 3.6G 7.2G 33% / | ||
+ | /dev/hda1 289M 24M 251M 9% /boot | ||
+ | tmpfs 217M 0 217M 0% /dev/shm | ||
+ | /dev/mapper/vg_splat-lv_log | ||
+ | 6.8G 2.2G 4.3G 34% /var/log | ||
+ | |||
+ | So, we grew root while the system had it mounted and was running from it. Thank you LVM! |
Revision as of 07:06, 4 December 2015
Problem
insufficient disk space to apply an upgrade.
O.S. : secure platform (splat) or gaia
Check Point versions: multiple
Solution
Use available, unallocated disk space. Newer Check Point version use LVM. Check Point often doesn't allocate it all. This not a bad thing. It is a common, best practice with LVM. This allows admins to easily grow partitions as needed using the free disk space. If you allocated it all up front, but needed one partition bigger, you would have to shrink one to grow another. This is more complicated. With root, it can't be shrunk while the system is running(it can be grown as we are about to see).
Example
20GB disk space
[Expert@chkpfw2:0]# vgdisplay | grep -i size /dev/hdc: open failed: No medium found VG Size 18.69 GB PE Size 32.00 MB Alloc PE / Size 384 / 12.00 GB Free PE / Size 214 / 6.69 GB
[Expert@chkpfw1:0]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_splat-lv_current 4.9G 3.6G 1.1G 77% / /dev/hda1 289M 24M 251M 9% /boot tmpfs 217M 0 217M 0% /dev/shm /dev/mapper/vg_splat-lv_log 6.8G 3.7G 2.9G 57% /var/log
adding 6 gig to the vg "container"
[Expert@chkpfw2:0]# lvresize -L +6.69GB vg_splat/lv_current /dev/hdc: open failed: No medium found Rounding up size to full physical extent 6.72 GB Extending logical volume lv_current to 11.72 GB Insufficient free space: 215 extents needed, but only 214 available
that failed... specifying the increase in GB is less precise. So, lets use "extents"
[Expert@chkpfw2:0]# lvresize -l +214 vg_splat/lv_current /dev/hdc: open failed: No medium found Extending logical volume lv_current to 11.69 GB Logical volume lv_current successfully resized
verifying resized volume group
[Expert@chkpfw2:0]# vgdisplay | grep -i -E "name|size" /dev/hdc: open failed: No medium found VG Name vg_splat VG Size 18.69 GB PE Size 32.00 MB Alloc PE / Size 598 / 18.69 GB Free PE / Size 0 / 0
growing the file system to fill the "container"
[Expert@chkpfw2:0]# resize2fs /dev/mapper/vg_splat-lv_current resize2fs 1.39 (29-May-2006) Filesystem at /dev/mapper/vg_splat-lv_current is mounted on /; on-line resizing required Performing an on-line resize of /dev/mapper/vg_splat-lv_current to 3063808 (4k) blocks. The filesystem on /dev/mapper/vg_splat-lv_current is now 3063808 blocks long.
viewing newly allocated disk space
[Expert@chkpfw2:0]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_splat-lv_current 12G 3.6G 7.2G 33% / /dev/hda1 289M 24M 251M 9% /boot tmpfs 217M 0 217M 0% /dev/shm /dev/mapper/vg_splat-lv_log 6.8G 2.2G 4.3G 34% /var/log
So, we grew root while the system had it mounted and was running from it. Thank you LVM!