Skip to main content

Moving most consuming directory to the separate disk

In my case, one directory is consuming most of disk space dedicated for the system.

Stop the service.

Rename directory

export src="/var/ossec"
mv ${src} ${src}.backup

Attach new disk

Configure LVM, mount disk to the location

Move files from backup to new destination

sudo rsync -avAXH --progress ${src}.backup ${src}

Once happy, remove source

rm -rf ${src}.backup