Skip to content

Instantly share code, notes, and snippets.

@johannesostling
Created March 30, 2017 12:40
Show Gist options
  • Save johannesostling/9c6dcf15b710798600061a945edf5f1b to your computer and use it in GitHub Desktop.
Save johannesostling/9c6dcf15b710798600061a945edf5f1b to your computer and use it in GitHub Desktop.
Vagrant extend disk image
#!/bin/bash
pvcreate /dev/sdb
vgextend VolGroup00 /dev/sdb
lvextend -l +100%FREE /dev/VolGroup00/LogVol00
xfs_growfs /dev/VolGroup00/LogVol00
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |v|
if !File.exist?("disk/extradisk.vdi")
#TODO: check if controler exist already
v.customize [
'storagectl', :id,
"--name", "satacontroller",
"--add", "sata",
"--controller", "IntelAhci",
"--portcount", "1",
"--hostiocache", "off"
]
v.customize [
'createhd',
'--filename', 'disk/extradisk.vdi',
'--format', 'VDI',
'--size', 120400
]
v.customize [
'storageattach', :id,
'--storagectl', "satacontroller",
'--port', 1, '--device', 0,
'--type', 'hdd', '--medium', 'disk/extradisk.vdi'
]
end
end
config.vm.provision "shell", path: "provisionextend.sh"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment