Version info
This partition-layout will be changed in APS 6.5 to use 2GB for /tmp if the hard drive is smaller than 100GB, or in other case 15GB for drives larger than 100GB.
On older op5 Appliance server installations, the partition layout for the /tmp directory has a fixed size of approximately 15GB. In normal cases this is an non-issue but when running in virtual systems or in test-environments where you'll want to keep the virtual drives as small as possible you might want to change this. This can easily be solved by resizing the volume using LVM. Just follow the simple steps below.
- Make sure that the filesystem on the lv_tmp device is mounted on /tmp, by executing:
df -h /tmp
The output generated by this command should not mention lv_root.
- Create a backup of any data found in /tmp which you want to keep for the future (the data in /tmp will be permanently deleted in the next steps).
- Unmount the current filesystem mounted on /tmp:
umount /tmp
- Make sure that the filesystem is no longer mounted on /tmp:
df -h /tmp
This time it should mention lv_root.
-
Decrease the size of the lv_tmp device by 10GB:
lvresize -L -10G /dev/vg_op5system/lv_tmp
-
Create a new filesystem on the lv_tmp device:
mkfs.ext4 /dev/vg_op5system/lv_tmp
-
Mount the new filesystem:
mount /tmp
- Make sure that the filesystem was properly mounted:
This time, the output should once again show the lv_tmp device.df -h /tmp
- Set proper permissions for the /tmp mount:
chmod 1777 /tmp
- There is now 10GB free space in the volume group, hence 10GB can be added to the lv_root device:
lvresize -L +10G /dev/vg_op5system/lv_root
- Resize the filesystem on the lv_root device:
resize2fs /dev/vg_op5system/lv_root
- Verify that the / mount is now 10GB larger, and the /tmp mount 10GB smaller than before:
df -h
The size change of 10GB is just an example. By executing the command lvs you can find out the size of the current volumes. Just make sure to shrink the lv_tmp device the same amount as you want to increase the lv_root device with. In some systems there's already free space in the volume group. To find out, run the command vgs.
-
Tags:
- resize
- disk space
- lvm
- lvresize
Comments
0 comments
Please sign in to leave a comment.