This Gist describe how to create and attach virtual disk to the VM The source article can be found here.
- SSH to the VM:
ssh -i ~/ssh/ssh_identity_file user@server_ip
- Find the SCSI device identifier (of the attached volume) using
lsscsi
- Install lsscsi if needed:
sudo yum install lsscsi
For the next steps, we assume the new volume is called /dev/sdc
sudo fdisk /dev/sdc
- type ''n'' to create partition
- select ''p'' for primary partition
- type 1 to make it the first partition
- Type ''p'' to see details about the disk
- Type ''w'' to write settings for the new disk
sudo mkfs -t ext4 /dev/sdc1
- Make a directory to mount the new file system:
sudo mkdir /datadrive
- Mount the drive to the directory:
sudo mount /dev/sdc1 /datadrive
- Find the UUID of the new drive:
sudo -i blkid
- Edit /etc/fstab in text editor:
sudo nano /etc/fstab
- Add line to /etc/fstab: (replace UUID value) UUID=33333333-3b3b-3c3c-3d3d-3e3e3e3e3e3e /datadrive ext4 defaults,nofail 1 2
- Unmount the directory:
sudo umount /datadrive
- Mount back the directory:
sudo mount /datadrive
- Make the drive writable:
sudo chmod go+w /datadrive