Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I recover files after 'rm'

337 views
Skip to first unread message

Stephen Marley

unread,
Jul 16, 1996, 3:00:00 AM7/16/96
to

John Yip (joh...@singnet.com.sg) wrote:

: Hi,

: is there a way to recover files after a 'rm' ?

ufsrestore -if <name of backup device>
--
ste...@memex.co.uk

Bill Marcum

unread,
Jul 16, 1996, 3:00:00 AM7/16/96
to

In article <4shm63$1ss...@singnet.com.sg>,

John Yip <joh...@singnet.com.sg> wrote:
>
>Hi,
>
>is there a way to recover files after a 'rm' ?
>
Generally speaking, no there isn't.

--
Bill Marcum bma...@iglou.com
On 22 July, 1996, at 6:00 pm GMT, everyone in the world
just START HUMMING. Those who don't know will freak.


John Yip

unread,
Jul 16, 1996, 3:00:00 AM7/16/96
to

Hi,

is there a way to recover files after a 'rm' ?

thanks.


Andrew J Braithwaite

unread,
Jul 17, 1996, 3:00:00 AM7/17/96
to joh...@singnet.com.sg

I don't believe so. Not on any standard UNIX system that I am aware of.

--
Andrew Braithwaite Email: abra...@ford.com (Work)
Powertrain Control Systems Engineering gf...@dial.pipex.com (Home)
Ford Motor Company Tel: +44 (0)1268 404115
"The opinions expressed are mine and not necessarily those of my employer"


Alan Rollow - Dr. File System's Home for Wayward Inodes.

unread,
Jul 17, 1996, 3:00:00 AM7/17/96
to

In article <4shm63$1ss...@singnet.com.sg>, joh...@singnet.com.sg (John Yip) writes:

>is there a way to recover files after a 'rm' ?

Yes. Restore from backup. Any other answer depends on the
particular system you're running and whether that file system
supports any sort of file recovery. Without a clue as the
particular UNIX being run, I can't offer much more.

>thanks.

You're welcome.

--
Alan Rollow al...@nabeth.cxo.dec.com


Jeff Bewley

unread,
Jul 17, 1996, 3:00:00 AM7/17/96
to John Yip

On 16 Jul 1996 15:22:21 GMT, John Yip (joh...@singnet.com.sg) wrote:

: Hi,
: is there a way to recover files after a 'rm' ?
: thanks.

Well, the bad news is that no, there's usually no way to
recover a file after you've rm'd it. Chances are, your only
option might be to contact your system adminstrator to see if
the file in question was backed up on tape, etc. This would
obviously only be practical if the file was of critical importance.


If you're using the Korn or Bash shell, you may want to consider
setting a shell alias similar to the one below.. it will prompt
you for verification each time you 'rm' a file, which might
cut down on accidental deletions.

alias rm='rm -i'


I hope this helps a bit..

- Jeff

--
*****************************************************************
* Jeff Bewley - wab...@ionet.net - http://www.ionet.net/~wabbit *
* "Hell, Columbus thought Cuba was China." - Jimmy Buffett *
*****************************************************************

Bojan Zdrnja

unread,
Jul 19, 1996, 3:00:00 AM7/19/96
to

John Yip (joh...@singnet.com.sg) wrote:
:
: Hi,
:
: is there a way to recover files after a 'rm' ?

Theoretically it is possible if you binary edit hard drive on which that
files were. However, you need to do immidiately shutdown so it won't get
overwritten. That job of binary searching for files is VERY hard and I
suggest you to keep backup copies and then ufsrestore from them.

Regards, Bojan

--
E-mail: bzd...@zems.fer.hr (world adress)

WHERE DREAMS COME TRUE | URL:
AND MUSIC NEVER STOPS | http://fly.cc.fer.hr/~ld/


Hans_Pattenier

unread,
Jul 24, 1996, 3:00:00 AM7/24/96
to

Jeff Bewley wrote:

> If you're using the Korn or Bash shell, you may want to consider
> setting a shell alias similar to the one below.. it will prompt
> you for verification each time you 'rm' a file, which might
> cut down on accidental deletions.
>
> alias rm='rm -i'

But if you've rm'd your file, you still can't restore it.

If you've enough free space on your harddisk, you could use
something like :

alias del 'mv !* ~/.wastbasket'

This isn't foolproof either, but it gives you a chance.

Hans Pattenier.

Chris Harrison

unread,
Jul 25, 1996, 3:00:00 AM7/25/96
to

> >is there a way to recover files after a 'rm' ?
> >
> Generally speaking, no there isn't.

I suppose you could go and talk nicely to the admin about getting it
restored from the backup tapes. If anyone has a better way (I doubt there
are any _worse_ ways) I would be interested.

--
Chris Harrison http://www.comp.vuw.ac.nz/~charriso
Comp Sci 2nd yr mailto:char...@comp.vuw.ac.nz
--- Dead Men Don't Modem --- M.A.N.T.I.S.

Kuntal M Daftary

unread,
Jul 25, 1996, 3:00:00 AM7/25/96
to

Chris Harrison wrote:

> I suppose you could go and talk nicely to the admin about getting it
> restored from the backup tapes. If anyone has a better way (I doubt > > there are any _worse_ ways) I would be interested.

sure there are worse ways... try talking roughly, badly
and angrily to your admin... :-)

--
bye for now...
kuntal
unhone kahaa thaa woh sapnoN meiN aayeNge
isi umeed meiN huM sote rahe saari umar..

Alan Rollow - Dr. File System's Home for Wayward Inodes.

unread,
Jul 29, 1996, 3:00:00 AM7/29/96
to

>> >is there a way to recover files after a 'rm' ?
>> >
>> Generally speaking, no there isn't.
>

>I suppose you could go and talk nicely to the admin about getting it
>restored from the backup tapes. If anyone has a better way (I doubt there
>are any _worse_ ways) I would be interested.

There are a number of better ways, but it depends on lots of
different things that can vary from system to system; file
system, availability of appropriate tools, etc. Some alternate
solutions of note:

o A particular site may have replaced rm(1) with a command that
saves a copy of the someplace. Such user level packages may
provide the command to retrieve the saved copy.

o The particular file system implementation may directly support
saving the file elsewhere when unlinked with command provided
to retrieve the file. I believe the Advanced File System on
Digital UNIX supports this.

o Backup software that doesn't require system manager intervention
to restore files.

o Most UNIX systems merely deallocate the blocks of a removed file
(as opposed to erasing them for example). While there is little
clue where the a particular file's blocks are now (except for
"free", they may still be around.

Depending on the file system, the space may be allocated in ways
that make guessing where it might be relatively easy. Implementations
of the Berkeley Fast File System are among these. The file system
tries hard to allocate files in the same cylinder groups as their
parent directories. Since the free block bitmaps are arranged by
cylinder group, it is relatively easy to track down the free blocks
of a particular cylinder group and read them.

If the data is easily identified, then it may be possible to recover
a removed file if you can get to the blocks before they are allocated
to somebody else.

The problem with this method is that it requires read access to the
raw device, bypassing most assumptions about data security.

For Digital UNIX and ULTRIX a program to check the free space by
cylinder group, looking for text data can be found at:

gatekeeper.dec.com:/pub/sysadm/recover.tar.Z

Someone sent me diffs for a version that should be work on Solaris,
but I've never had the chance to merge them into my original source.

>Chris Harrison http://www.comp.vuw.ac.nz/~charriso
>
--
Alan Rollow al...@nabeth.cxo.dec.com


Al Aab

unread,
Aug 2, 1996, 3:00:00 AM8/2/96
to

so why are UNIXists down on MS DOS ?
at least MS DOS has Norton utilities, PC Tools, DOS undelete, etc
match those, UNIX (eunoch ?) !


Chris Harrison (char...@comp.vuw.ac.nz) wrote:
: > >is there a way to recover files after a 'rm' ?


: > >
: > Generally speaking, no there isn't.

: I suppose you could go and talk nicely to the admin about getting it
: restored from the backup tapes. If anyone has a better way (I doubt there
: are any _worse_ ways) I would be interested.

: --


: Chris Harrison http://www.comp.vuw.ac.nz/~charriso
: Comp Sci 2nd yr mailto:char...@comp.vuw.ac.nz
: --- Dead Men Don't Modem --- M.A.N.T.I.S.

--


Jeffrey Potoff

unread,
Aug 2, 1996, 3:00:00 AM8/2/96
to

Al Aab wrote:
>
> so why are UNIXists down on MS DOS ?

How long have you got to listen ? :)

> at least MS DOS has Norton utilities, PC Tools, DOS undelete, etc
> match those, UNIX (eunoch ?) !

Why ? Most of us are smart enough not to delete files
we need. If you're really scatter brained I suppose
you could use Windows NT, since it asks you not once, not
twice, but THREE times before it lets you really delete
something !

Jeff

Michel Tugaye

unread,
Aug 4, 1996, 3:00:00 AM8/4/96
to

Hans_Pattenier <patt...@medicine.LeidenUniv.nl> wrote:

: is there a way to recover files after a 'rm' ?

I don't known any good recovering solution for Unix like Norton
utilities for PC or Mac. The unix tool is *fsck*. But it's job is to
recover the entire file system after a crash.

On unix undelete tool does not exist because :
1) the unlink function suppress in the directory the link beetween the
deleted file name and the i-node that point to file itself.
2) the unix file system replace the blocs used by the deleted i-node in
free list.
3) unix is a multi-user operating system; The block of the deleted file
can be reaffected to another file very quikly.

To permit the creation of an undelete command, we must introduce a
concept to place block of deleted file in a temporary state like
"deleted" that will be comming in free state when free list become
empty.

But the backup-restore solution is required in all cases that can not be
recovered from an undelete command.

> > alias rm='rm -i'

When you want to delete 100 files, this alias is very bad. In the 10
year ago, I have seen on Venix another alias (or command ?) named *del*
that proposed the full list of the files to delete before you *confirm
only ONE time*.

> alias del 'mv !* ~/.wastbasket'

I use the following variant :

mkdir poub
mv somefiles poub
... verify or and wait some days ...
rm -rf poub

In the current directory, I create the "poub" directory (poub is an
abreviation for *poubelle* the french word for wastebasket). Then I move
the indesirable(s) file(s) into this poub with the mv command. I can
reverse the operation until I delete the "poub" directory (this is the
only case I use the rm command").

This procedure work wery well and prevent for many cases of accidental
destruction.

---
Michel Tugaye
de Rueil Malmaison en France
mtu...@planete.net

Kevin MacNeil

unread,
Aug 4, 1996, 3:00:00 AM8/4/96
to

mtu...@planete.net (Michel Tugaye) writes:
]Hans_Pattenier <patt...@medicine.LeidenUniv.nl> wrote:

]: is there a way to recover files after a 'rm' ?

]> > alias rm='rm -i'

]When you want to delete 100 files, this alias is very bad. In the 10 year
]ago, I have seen on Venix another alias (or command ?) named *del* that
]proposed the full list of the files to delete before you *confirm only ONE
]time*.

O'Reilly's _Unix Power Tools_ has a neat shellscript (also called del - see
below) which works in roughly the same way. It acts like rm -i for up to
three files; if there are more, it lists them all and asks once if you'd
like to delete them. All the scripts from _Unix Power Tools_ are available
online at ftp.uu.net/published/oreilly/power_tools/unix/upt/oct93.tar.gz.
It's worth checking out, as is _Unix Power Tools_ itself.

#!/bin/sh
#
# del - Asks if you would like to delete each file if there are three
# files or less specified. For more than three files, it displays
# them and asks you once if you wish to delete them all:

case $# in
0) echo "`basename $0`: you didn't say which file(s) to delete"; exit 1;;

# If we're deleting only 1, 2, or 3 files, confirm for each one.
[123]) /bin/rm -i "$@" ;;

# If we're deleting more then 3 files, echo them all, and confirm once.
*) echo "$*"
echo do you want to delete these files\?
read a
case "$a" in
[yY]*) /bin/rm "$@" ;;
esac
;;
esac
--
Kevin MacNeil \ Memorial University of Newfoundland
kmac...@morgan.ucs.mun.ca / English & Philosophy

Sirilak Menakanit

unread,
Aug 7, 1996, 3:00:00 AM8/7/96
to

Al Aab (af...@torfree.net) wrote:
:
: so why are UNIXists down on MS DOS ?
: at least MS DOS has Norton utilities, PC Tools, DOS undelete, etc

: match those, UNIX (eunoch ?) !
:
:
: Chris Harrison (char...@comp.vuw.ac.nz) wrote:
: : > >is there a way to recover files after a 'rm' ?
: : > >

: : > Generally speaking, no there isn't.
:
: : I suppose you could go and talk nicely to the admin about getting it
: : restored from the backup tapes. If anyone has a better way (I doubt there
: : are any _worse_ ways) I would be interested.
: yeah ....i agree. but i give you on advive

ocassionaly maek your own tar file (it's like a backup file) if
you accidently 'rm' your files .. just tar them back from you previous tar
size but becarful of you quota space.. it might be running low if you have
lots of them also .. in AIX and Solaris there is one option call DESKTOP
WINDOWS and OPENWIN which contains trash . .. use it useful! it's
not a FREE WARe
that's all i
reccomend you


: : -- : : Chris Harrison


http://www.comp.vuw.ac.nz/~charriso
: : Comp Sci 2nd yr mailto:char...@comp.vuw.ac.nz
: : --- Dead Men Don't Modem --- M.A.N.T.I.S.
: --

:

--


Rich Kus

unread,
Aug 13, 1996, 3:00:00 AM8/13/96
to

In article <4u9toi$8...@enterprise.netserv.chula.ac.th>,

Sirilak Menakanit <u362...@chula.edu> wrote:
>Al Aab (af...@torfree.net) wrote:
>:
>: so why are UNIXists down on MS DOS ?
>: at least MS DOS has Norton utilities, PC Tools, DOS undelete, etc
>: match those, UNIX (eunoch ?) !
>:
>:
>: Chris Harrison (char...@comp.vuw.ac.nz) wrote:
>: : > >is there a way to recover files after a 'rm' ?
>: : > >
>: : > Generally speaking, no there isn't.
>:
>: : I suppose you could go and talk nicely to the admin about getting it
>: : restored from the backup tapes. If anyone has a better way (I doubt there
>: : are any _worse_ ways) I would be interested.
>: yeah ....i agree. but i give you on advive
>
> ocassionaly maek your own tar file (it's like a backup file) if
>you accidently 'rm' your files .. just tar them back from you previous tar
>size but becarful of you quota space.. it might be running low if you have
>lots of them also .. in AIX and Solaris there is one option call DESKTOP
>WINDOWS and OPENWIN which contains trash . .. use it useful! it's
>not a FREE WARe
>that's all i
>reccomend you
>
in addition there is an archive program called zoo. which also tends
to eat disc space but is useful.

richk

ziggl...@gmail.com

unread,
Feb 27, 2013, 12:20:09 PM2/27/13
to
You can recover files after rm command usage. It really works pretty well, let me know the operating system of your system that I can suggest you the tool.
0 new messages