Don't ever, ever, ever run the following command

Matthew Nuzum —  — Leave a comment

Don’t ever, ever, ever run the following command on your redhat/fedora box:
rpm -qa | xargs rpm -e
Especially if what you meant to run was:
rpm -qa | grep postg | xargs rpm -e

I was trying to clean off my server. I wanted to leave it in a runing condition, I just wanted to get rid of my working data. I thought I’d uninstall the postgres rpms before wiping out the /var/lib/pgsql folder to avoid boot errors.

Let’s just say the server is now, ahem, clean.

By the way, when I want a clean wipe of all freespace on a drive I do this:
dd if=/dev/zero of=/tmp.txt bs=1024 count=1840268
where 1840268 is the “available” column from df
/dev/hda3 2063536 118444 1840268 7% /
end result is
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda3 2063536 1960516 0 100% /

I know, this won’t keep the CIA from finding my old data but it does make things a little more difficult. Do the above steps for each filesystem making sure to put tmp.txt in the folder that the partition is mounted on.

If it helped, please share!Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+

Matthew Nuzum

Posts Twitter Facebook

Web guy, big thinker, loves to talk and write. Front end web, mobile and UX developer for John Deere ISG. My projects: @dsmwebgeeks @tekrs @squaretap ✝