how to undu "rm *" in root puppy save file

Booting, installing, newbie
Post Reply
Message
Author
pewekodok
Posts: 14
Joined: Fri 24 May 2013, 00:14

how to undu "rm *" in root puppy save file

#1 Post by pewekodok »

two days ago I did silly thing.
I entered 'rm *' command in root directory.
alas all files are gone :(

any alternatives to bring back deleted files on puppy save files?

after I realized my mistake, I shut down improperly (pressing power button longer time)
hoping the deleted files not flush onto puppy save file
then booted up other system puppy 4
mounted puppy save file, no luck every files except folder are gone :(

hope there is any magic to bring back my deleted files
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Re: how to undu "rm *" in root puppy save file

#2 Post by musher0 »

pewekodok wrote:two days ago I did silly thing.
I entered 'rm *' command in root directory.
alas all files are gone :(

any alternatives to bring back deleted files on puppy save files?

after I realized my mistake, I shut down improperly (pressing power button longer time)
hoping the deleted files not flush onto puppy save file
then booted up other system puppy 4
mounted puppy save file, no luck every files except folder are gone :(

hope there is any magic to bring back my deleted files
You should have a virgin copy of /root at
/initrd/pup_ro2/root (general) and at
/initrd/pup_ro4/root (default configurations)

In console, try

Code: Select all

cp -f /initrd/pup_ro2/root/* /root/*
and then

Code: Select all

cp -f /initrd/pup_ro4/root/* /root/*
and keep your fingers crossed? :)

If that doesn't work, try by opening
rox /initrd/pup_ro2/root/ and then rox /root side by side.
Copy everything from the former to the latter.
Same, from rox /initrd/pup_ro4/root/ to rox /root.

BFN.

musher0
~~~~~~~~
PS. Next time, make a back-up before doing anything drastic? ;)
Even better, if the above works, make a back-up to a thumb drive -- now! :)

No offense intended, we all did silly things to our Puppy at some point!
(Luckily, no one told the SPCA!)
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post by musher0 »

Another solution :

Boot from CD/DVD with pfix=ram setting at first prompt.

Once on your desktop, locate your old pupsave file and open it (by double-click).

Then, "pour" whatever is in your CD's /root into
< /mnt/whatever-partition/pupsave-blabla.2fs/root >.

Remove your CD and reboot. Don't save anything.

Upon reboot, you should have the default "virgin" items in your /root.
You'll have to redo your configs, etc., but it's a lesser evil...

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#4 Post by starhawk »

musher0, can he recover his files at all after a hard reboot like he describes...?

Also: rm is roughly the Linux equivalent of He Who Must Not Be Named in the Potter books ;) that's one nasty command to let roam freely through the filesystem...
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#5 Post by Karl Godt »

Code: Select all

rm -r *
rm -fr *
would have deleted also your folders .. haha .
I doubt that it's a user problem , since you could do so also in /home/joe or /root/spot .

musher0 said a few things about to restore files from the pup-4yz.sfs into the pupsave.2fs .

Just click on the pup-4yz.sfs , that should mount it and open a rox filer window .

/root/.xinitrc may be the one that's most important, since without that /usr/bin/xwin would choke and likely error out and would fail to launch xwin .

Puppy's code often does not check files or variables - size and performance may suffer.
User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#6 Post by mikeb »

There is debugfs if you are patient and can fathom its workings...default on linux but not puppy.
ext3 if used tends to be more unfogiving than ext2 when this happens. Ext4...who knows.

Other methods such as sysinternals free recovery or photorec only work with real partitions I believe.

mike
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#7 Post by musher0 »

@starhawk.

I don't know if the person can. I'm too chicken to reproduce the problem on my Puppy.
Just trying to follow some logic.

But the folders are probably untouched. As Karl mentions, it could have been worse.

As to rm itself, it's a dangerous command, but we need it. It has inbuilt safeguards: by
default it will ask if you want to delete the file(s). If you type rm alone, it will print the
message "operand missing" and stop. No harm done.

Was it DOS that had a "wipe" command that erased a file at the byte level....

Is Linux a wiser OS? I don't remember who said: "An OS is only as intelligent as
the person sitting in front of it".

Conversely, you may have only a "P III", but if you're smart and know what you are
doing, it can become a "P VI" ;) But that's another subject, isn't it?

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)
Post Reply