From 1185acf8be09a3190377e770b555c2f8b566a807 Mon Sep 17 00:00:00 2001 From: Charlie O'Keefe Date: Tue, 20 Mar 2018 09:41:41 -0600 Subject: [PATCH 1/2] Use vagrant-disksize plugin to resize vm hard disk --- README.md | 8 +++++++- Vagrantfile | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a063e2b..8198cf2 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,13 @@ gpg_key_id: '' ssh_key_name: '' ``` -Make sure VirtualBox, Vagrant and Ansible are installed, and then run: +Make sure VirtualBox, Vagrant and Ansible are installed. + +Include this vagrant plugin to support resize of the start up disk: + + vagrant plugin install vagrant-disksize + +Then run: vagrant up --provision zcash-build diff --git a/Vagrantfile b/Vagrantfile index 68330ea..46dba57 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,6 +3,7 @@ Vagrant.configure(2) do |config| config.ssh.forward_agent = true + config.disksize.size = '16GB' config.vm.define 'zcash-build', autostart: false do |gitian| gitian.vm.box = "debian/jessie64" gitian.vm.network "forwarded_port", guest: 22, host: 2200, auto_correct: true From 9d13a595aa49fe9f0b714e350439fc1ec13ce0d3 Mon Sep 17 00:00:00 2001 From: Charlie O'Keefe Date: Tue, 20 Mar 2018 09:49:16 -0600 Subject: [PATCH 2/2] Add steps to repartition disk and resize filesystem on partition --- roles/common/tasks/main.yml | 1 + roles/common/tasks/repartition.yml | 35 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 roles/common/tasks/repartition.yml diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index b597ed0..c7874f5 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -1,4 +1,5 @@ --- +- include: repartition.yml - include: update_everything.yml - include: packages.yml - include: make_swap.yml diff --git a/roles/common/tasks/repartition.yml b/roles/common/tasks/repartition.yml new file mode 100644 index 0000000..68b1e8c --- /dev/null +++ b/roles/common/tasks/repartition.yml @@ -0,0 +1,35 @@ +--- +- name: Make sure parted is installed + apt: + name: parted + state: present + update_cache: yes + +- name: Turn off all swap areas + command: swapoff -a + become: yes + +- name: Remove swap partition from /etc/fstab + mount: + path: none + fstype: swap + opts: sw + state: absent + +- name: Remove partition number 5 + command: parted --script /dev/sda rm 5 + become: yes + +- name: Remove partition number 2 + command: parted --script /dev/sda rm 2 + become: yes + +- name: Resize partition number 1 to fill the available space on the disk + command: parted ---pretend-input-tty /dev/sda unit % resizepart 1 yes 100 + become: yes + register: parted_resize + +- name: Resize filesystem on /dev/sda1 to fill the available space on the partition + command: resize2fs /dev/sda1 + become: yes + register: resize2fs