Partitioning for Xen/KVM server during deployment CentOS 7 node
The guide describes the steps for manual partition during the deployment of CentOS 7 server with a single 100G HDD
Note: The instruction is for the deployment from CentOS 7 ISO image
Prerequisites: server with mounted CentOS ISO image, 100G HDD
- Launch Installation Wizard. Choose the language and click Continue
- On the next page select INSTALLATION DESTINATION
- Select I will configure partitioning option and Done
- On the next page choose LVM and click on "+"
- Add '/boot', 'swap' and '/' partitions, after that click on Done. 33.99GiB in that case is amount of unallocated free disc space
- Confirm partitioning scheme by clicking on Accept Changes
- Click on Begin Installation button
- Set ROOT PASSWORD and proceed with installation
The next step is create a physical device for unallocated free disk space and create a volume group
- Connect to the server via SSH or VNC
- Check the current partitioning:
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
Б■°Б■─sda1 8:1 0 2G 0 part /boot
Б■■Б■─sda2 8:2 0 64G 0 part
Б■°Б■─centos-root 253:0 0 60G 0 lvm /
Б■■Б■─centos-swap 253:1 0 4G 0 lvm [SWAP]
sr0 11:0 1 792M 0 rom - Create a new device for unallocated free disk space using fdisk command. Example of such procedure is below:
# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Command (m for help): n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
Partition number (3,4, default 3): 3
First sector (138430464-209715199, default 138430464): 138430464
Last sector, +sectors or +size{K,M,G} (138430464-209715199, default 209715199): 209715199
Partition 3 of type Linux and of size 34 GiB is set
Command (m for help): t
Partition number (1-3, default 3): 3
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): wq
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
# partprobe /dev/sda
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 100G 0 disk
Б■°Б■─sda1 8:1 0 2G 0 part /boot
Б■°Б■─sda2 8:2 0 64G 0 part
Б■┌ Б■°Б■─centos-root 253:0 0 60G 0 lvm /
Б■┌ Б■■Б■─centos-swap 253:1 0 4G 0 lvm [SWAP]
Б■■Б■─sda3 8:3 0 34G 0 part
sr0 11:0 1 792M 0 rom - After that create a volume group for the new device /dev/sda3
# pvcreate /dev/sda3
Physical volume "/dev/sda3" successfully created.
# vgcreate -s 32M solusvm /dev/sda3
Volume group "solusvm" successfully created
# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz--n- 64.00g 4.00m
solusvm 1 0 0 wz--n- <33.97g <33.97gThe new volume group
solusvm
has been created that will be used as LVM storage for KVM/Xen VPSes
At the current point partitioning part has been complete and the server is ready for SolusVM installation
Please sign in to leave a comment.
Comments
0 comments