# How to undo unlink operation



## mukembo (Jan 2, 2009)

The other day while punching away at the keyboard, an interruption from a relative resulting in my executing "rm -r /*".

I've found that that unlinked most of my file system from the root.

I run the command while in sudo mode hence as part of the wheel group.

Any suggestions on how to undo this operation? I've tried undelete, rm -r -W and loads others but none seemed to function.

Its urgent as this was a live machine on which I was doing regular maintenance on a separate application.


----------



## trev (Jan 2, 2009)

The only 'undo' operation in this sort of case is called BACKUPS. I hope yours were current.


----------



## mukembo (Jan 3, 2009)

Trev,

I did have some backups but given that my only current access method to the server is SSH (servers and I are about 900miles apart), I've got to find a way to undo this while bypassing the backup restoration.

Since I've got a full backup of the system, though about 2 months old, can I attempt an upgrade from my current version 6.2 Stable to say 7?! Will that, with proper pre-installation configuration, restore the linkages?


----------



## Djn (Jan 3, 2009)

Basically: No. The unlinked files are lost, unless you use something like what's discussed here to recover them - and even if you do, the success rate isn't that good.

If you didn't lose any data you don't have backed up, I'd start reinstalling (or restoring from backups).
If you did, try to recover it with some of those tools first, and good luck.


----------



## trev (Jan 4, 2009)

If you're going to upgrade from 6 stable to 7.1 stable, this posting will be invaluable:

http://people.freebsd.org/~rse/upgrade/freebsd-upgrade-6x-7x.txt

Good luck.


----------

