I have done something stupid and messed up my Debian Squeeze installation. Now, the problem is I have enough data and sowftware installations which I don't want to repeat; is it possible to reinstall the OS and still somehow save and maintain data on my box?
I have still not tinkered with the installation, I am just frustrated with issues and lack of time.

- 67,283
- 35
- 116
- 255

- 259
-
Where in the filesystem did you do your changes? – tshepang Apr 12 '11 at 06:59
-
most of the stuff is in home dir, so one thing that comes to my mind is to backup home dir, but I have installed and configured stuff like Apache so thats the trouble part :( – Kumar Apr 12 '11 at 07:54
-
2If you told us what you actually messed up (or maybe I missed what you messed), maybe... well, I've yet to reinstall Debian just because I "messed up" (and I did make my share of mistakes). – Jürgen A. Erhard Apr 12 '11 at 20:16
-
1@jae: I was about to say the same thing! :-) Actually, I was about to suggest to the poster that he try to fix his system rather than reinstalling. He'd learn so much more that way... If I reinstalled every time I broke my system, I'd spend even more time on sysadmin than I do now. :-) – Faheem Mitha Apr 12 '11 at 20:33
-
@kumar, I would try reinstalling all the packages... but idk the easyness of that... and maybe it's a config gone bad. – xenoterracide Apr 13 '11 at 00:08
-
Actually am frustrated, most of the missing pieces are fixed, have problem with mouse which I am managing, other issues including my root partition is just 10GB, java eats up everything, sound behaves weirdly & on top of it, am running out of time :( – Kumar Apr 13 '11 at 04:34
3 Answers
If you don't mind acting like a cowboy (and I have never tried this):
- Back up your
/etc
and/home
directories (and next time, put your homedir in a separate partition). Do the same with anything else you changed outside those two directories. - Do a fresh install.
- Restore your backups. The system-wide config dir,
/etc
, should be overwritten by this action. As for home, there's no risk at all restoring, assuming you are going to be logging in as the same username (and assuming that this was the first user you created during both installations).

- 65,642
-
-
1That makes things easier then, meaning no need to back it up. Just install to the current root partition. Ensure that you select the Advanced option during the partitioning stage, and choose your
/home
to point to where your homedir is, and make sure you leave it marked K (i.e. keep the data). I never lost data doing this on Debian through dozens of installations, but YMMV, so you might wanna back your home regardless :) – tshepang Apr 12 '11 at 11:11 -
-
-
-
@Kumar: Another thing you may want to keep is the list of installed packages. See my answer to a related question. – Gilles 'SO- stop being evil' Apr 12 '11 at 19:21
-
With
Restore your backups
are you referring to running a command likesudo ~/backup/etc /etc
? How exactly do you restore and does that work in practice? – mYnDstrEAm Oct 12 '22 at 15:18
The other alternative if you previously used the Debconf package configuration questions to configure things would be to get the preseed information and use that to do your fresh install. You would retain your previously configured answers. You would likely still want to backup anything in /etc
that may have been modified locally after debconf configuration. If you have /home
as a separate partition you can just tell the installer not to re-format that partition and simply mount it as is as /home
and your information will be retained as well.

- 111
Before you jump on a reinstall, please check if you're using the unstable
tree and recently updated udev
. See this bug report for details, but essentially a major bug in udev managed to sneak by the maintainer that rendered most peripherals unusable; updating udev again should fix it.

- 31,260