Expand root and swap partitions?
I just installed CentOS 7.2 minimal. I now need to expand my swap (1.6GB now) and root (13.9GB) partitions.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 16G 0 disk +-sda1 8:1 0 500M 0 part /boot +-sda2 8:2 0 15.5G 0 part +-centos-root 253:0 0 13.9G 0 lvm / +-centos-swap 253:1 0 1.6G 0 lvm [SWAP] sr0 11:0 1 1024M 0 rom is this a straight forward process? How do I go about doing this? Its a Vmware virtual machine. So I start by expanding the VM disk size. But then what? I've only ever done this for slackware. |
You can expand the existing disk or create a new VDI. I would probably create a new virtual disk.
You could use system storage manager or use the traditional LVM tools i.e. pvcreate, vgextend, lvextend and finally the filesystem i.e. resize2fs or xfs_growfs. For swap you need to turn it off, add space, mkswap then turn it back on. http://xmodulo.com/manage-lvm-volume...e-manager.html |
I can't resize an existing swap space partition? I didn't think I had to delete and add new.
|
Swap is not a filesystem in the traditional sense and therefore no tools to resize. Actually you do not really have to delete i.e. you can add separate swap partitions and/or swap files and the operating will add the space together.
|
You can choose to expand the existing vmdk or to add a new one.
Adding a new vmdk is the most easy path:
You can also extend the actual vmdk, detect the new device size (the easiest way is to reboot) and create a new partition, then follow the previous commands using a new partition on the same device (for example /dev/sda3 instead of /dev/sda2). Or you can extend the actual vmdk and extend the existing pv /dev/sda2, but in this case you must
For swap logical volume you must deactivate the actual swap (swapoff /dev/centos/swap), extend the lv (lvextend), create the new swap space (mkswap /dev/centos/swap) and enable the swap (swapon /dev/centos/swap) I hope this will helpful :) |
All times are GMT -5. The time now is 01:46 AM. |