I have a testing server set up in /var/www, and a mySQL database somewhere, and I recently have been having problems where X won't load. The only suggestion so far is to reinstall. Normally, that wouldn't be a problem, since I have a different drive mapped to /home, but I'm scared that reinstalling will wipe /var/www and other directories where I have much-needed config files.

  • If you start by making a backup of those files what do you see as a problem? – Rinzwind Jan 6 '13 at 18:01
  • @Jon, would you mind sharing the partition table of the system – Ankit Jan 6 '13 at 18:20
  • /home gets its own drive, but everything else is on one drive. So it's Drive 1: ~20 gig partition for system files, ~4 gig partition for swap, and Drive 2: one ~500 gig partition for /home. The next time I do this I should probably make /var/www its own partition. – Jonathan Jan 6 '13 at 18:43

It depends on how you partitioned your hard drive. But, if /var was not given its own partition, reinstalling Ubuntu will wipe /var.

Not only would you need to backup /var/www, but you would also need to backup /var/lib/mysql, where your MySQL database lives.


Starting with Ubuntu 18.04, a server install insists on wiping /var. This takes out /var/www (thats your website gone); /var/spool/mail (your emails are toast) and quite a bit else.

This is regardless of whether /var was on a different partition.

How do I know? Well, I just changed the MB on my aging server and lost the lot. Welcome to a day of restoring backups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.