vmdk of pfsense esxi is much larger then the actual space used
-
Hi,
I had installed pfsense for openvpn in esxi. i recently took its backup in vmware and its size was around 60GB. but when i looked pfsense using df -h it was not using this much space as shown below. i checked on various sites. they recomend to zero out the unused space in the guest vm and then use vmwar tools to shrink vmdk file.What tool should i use in pfsense to zero out unused space so that i can reduce the vmdk size.
df -h Filesystem Size Used Avail Capacity Mounted on pfSense/ROOT/default 172G 1.1G 171G 1% / devfs 1.0K 0B 1.0K 0% /dev pfSense/var 171G 368K 171G 0% /var pfSense/tmp 171G 300K 171G 0% /tmp pfSense/home 171G 196K 171G 0% /home pfSense/var/log 171G 44M 171G 0% /var/log pfSense/var/cache 171G 96K 171G 0% /var/cache pfSense/var/tmp 171G 128K 171G 0% /var/tmp pfSense/var/db 171G 89M 171G 0% /var/db pfSense/ROOT/default/cf 171G 2.6M 171G 0% /cf pfSense/ROOT/default/var_cache_pkg 171G 380M 171G 0% /var/cache/pkg pfSense/ROOT/default/var_db_pkg 171G 5.5M 171G 0% /var/db/pkg tmpfs 4.0M 136K 3.9M 3% /var/run devfs 1.0K 0B 1.0K 0% /var/dhcpd/dev
-
@Snailkhan
I have found this post
https://supratim-sanyal.blogspot.com/2016/12/zero-out-free-disk-space-on-virtual.htmldoes this code to zero out disk looks good ?
pfSense (freeBSD)On my pfSense open-source router virtual machine, I run this script:
#!/bin/sh -x # # --- # zerofree.sh (pfSense) # # Zeroes Out Ununsed Disk Space for subsequent compacting of virtual hard disk # Tested on pfSense 2.3 / FreeBSD 10.3 # To execute: nice -19 ./zerofree.sh # # Supratim Sanyal - supratim at riseup dot net # See http://supratim-sanyal.blogspot.com/2016/12/zero-out-free-disk-space-on-virtual.html # --- # cd / cat /dev/zero > zero.delete-me rm -v zero.delete-me
-
Do you have SWAP enabled? What size is it if so?