Verified Commit db60ae04 authored by Kristian Klausen's avatar Kristian Klausen 🎉 Committed by Sven-Hendrik Haase
Browse files

Improve disk compaction by trimming the disk

This only affect the qemu and virtualbox image. I'm not sure how you
enable trim support in VMware and the documentation is spare.

Tested with: packer build -only=qemu local.json
698M	Arch-Linux-x86_64-libvirt-2020-08-01.box <- before
425M	Arch-Linux-x86_64-libvirt-2020-08-01.box <- after

Fix #106
parent 83a7bd38
......@@ -18,6 +18,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"disk_discard": "unmap",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "arch",
......
......@@ -17,6 +17,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"hard_drive_discard": "true",
"guest_os_type": "ArchLinux_64",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
......@@ -54,6 +55,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"disk_discard": "unmap",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
......
......@@ -9,3 +9,6 @@ yes | sudo pacman -Scc
rm /etc/machine-id
# Remove pacman key ring for re-initialization
rm -rf /etc/pacman.d/gnupg/
sync
fstrim --all --verbose
......@@ -16,6 +16,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"hard_drive_discard": "true",
"guest_os_type": "ArchLinux_64",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
......@@ -38,6 +39,7 @@
"memory": 1024,
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_discard": "unmap",
"disk_size": "{{user `disk_size`}}",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment