On 19/08/17 15:12, Anssi Johansson wrote:
for pkg in $packages_to_be_removed do rpm -ql $pkg | while read file do if [ -f $file ] then shred -n0 -uz $file fi done done rpm --erase $packages_to_be_removed
This would eliminate the need of having to use dd. Obviously some
packages may want to run an uninstallation script at uninstall time, which may (or may not) cause errors if some critical executables have vanished. rpm's --noscripts may help in that case, if running the uninstallation script is not actually necessary.
Some of these packages might need to be reinstalled after the box is created, either by the user or as dependencies of other packages (e.g. the kernel depends on linux-firmware, but putting the latter in yum's exclude list was ignored by Anaconda - no idea if that would be respected by yum during normal operation, there was no newer kernel when I tested). We might break things by not uninstalling packages the way they were meant to. I think using a hypothetical zerofree for XFS would be the right way to do it (we could switch the Vagrant images back to ext4, but there's some opposition to this due to the fixed number of inodes in ext4).
With the dd step removed, enlarging the file system size should be
easier, if desired.
Indeed. I'd have no objection to the increase in the maximum disk size of the Vagrant images if the dd problem would disappear.