Shrink guest on hosted platform: Difference between revisions
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
yum clean | yum clean | ||
Next, | Next, shut down any services that depend on enough available disk space to run. | ||
The reason we are doing this | The reason we are doing this is that we are going to write out zero's to the file system until the file system is full and we do not want any application - for example a database system like mySQL or postgreSQL - to run out of disk space while we are zeroing out the file system. If mySQL would try to write when your disk is full you risk a corrupted database. So this step is important! | ||
Next run: | |||
cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill | cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill | ||
Line 29: | Line 25: | ||
to fill the unused space with zeros. | to fill the unused space with zeros. | ||
As this command writes out zero's to the disk until it runs out of disk space, you will get an error "No space left on the device". This is expected | As this command writes out zero's to the disk until it runs out of disk space, you will get an error "No space left on the device". This is expected. | ||
==== Zero out unused space on a Windows VM ==== | ==== Zero out unused space on a Windows VM ==== |