You are not logged in.

#1 2018-05-05 15:18:56

ad4ms3
Member
From: Bradford, UK
Registered: 2018-01-19
Posts: 95

[SOLVED] missing files?

I had my lesson. Wrong command has destroyed enitre system. Shame to admit, I wanted to clean pkg folder from installation files after an update. I navigated into this folder, opened Terminal via Dolphin and typed "rm -rf /*". Needlessly to say... everything within couple of seconds disappeared. Lesson learned.

So I reinstalled arch. However, all files on other partitions became unavailable. I sorted fstab, I have physical access to these partitions, "properties" does show that several GBs is taken. However, files are not there! It is even a greater surprise, cause terminal on freshly reinstalled system somehow "remembers" the very last command that anihilated arch.
Here is my fstab:

# <file system> <dir> <type> <options> <dump> <pass>
# UUID=d9240d67-6aa9-43e5-85ab-e3474f488f1f
/dev/sda1           	/         	ext4      	rw,relatime,data=ordered	0 1
# UUID=34149f9c-4454-4bb0-bba1-0b627f882c37
/dev/sda2              /home            ext4            defaults                     0 0
# UUID=3968e6af-9bf0-4f86-8330-cf1097d4e3e5
/dev/sda4              /media           ext4            defaults                      0 0

Any other "live" system does not "see" files too.  I do not worry much about sda4, cause I have a backup on external hard drive. But sda2 is the one that matters.
Any advice highly appreciated. Thank you

Last edited by ad4ms3 (2018-05-06 07:33:59)

Offline

#2 2018-05-05 16:17:26

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] missing files?

Did you interrupt the rm command or let it finish? If "terminal" remembers the command history, then that means that you shell history file is probably intact. Depending upon how you ran the rm command, it might be under /root or /home/<user>.

Have you tried using a terminal (instead of a GUI file manager) to see if the files are there in you $HOME or not? If the files are really deleted, you still might be able to recover some/most of them depending on how much data has been written to the /dev/sda2 partition after the incident. Give photorec a try for recovery.

Offline

#3 2018-05-06 07:32:47

ad4ms3
Member
From: Bradford, UK
Registered: 2018-01-19
Posts: 95

Re: [SOLVED] missing files?

Unbelievable! Photorec recovered documents, photos, pdfs and other things I forgot about their existence! They were years old. How was that possible if disk partitions were changed several times throughout laptops life? This 250GB partitions did not exist long time ago, but photos were recovered. How recovery tool managed to restore something that should not be restored (files were written to this partition many times, paritions were changing, etc)?

But it did not recover my daughters' leoCAD projects.....

Last edited by ad4ms3 (2018-05-06 22:49:48)

Offline

#4 2018-05-06 18:38:17

c00ter
Member
From: Alaskan in Washington State
Registered: 2014-08-28
Posts: 421

Re: [SOLVED] missing files?

Unless you are doing a destructive, low-level format then most 'formatting' consists of overwritten file descriptors. Still, that is pretty incredible! Congrats on recovering your data. I could never be so lucky. wink

Last edited by c00ter (2018-05-06 18:39:04)


UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn

Offline

#5 2018-05-06 22:58:14

ad4ms3
Member
From: Bradford, UK
Registered: 2018-01-19
Posts: 95

Re: [SOLVED] missing files?

It recovered almost 700 000 (yes, seven hundred thousands) files! Most of it was a usless junk (some txt, h and class files) but also it showed how much rubbish web browser saves without our knowledge. I dare to think what will happen when I touch 600GB partition. I let it run overnight smile

Offline

#6 2018-05-07 05:59:28

ryanmusante
Member
From: USA
Registered: 2016-09-14
Posts: 3

Re: [SOLVED] missing files?

It isn't fixed until you remedy for future problems. Create an alias:

rm='rm -I --preserve-root'

Offline

#7 2018-05-07 15:39:54

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] missing files?

Better yet, use trash-cli and send your deleted files to the XDG standard Trash directory, from where it can be restored if you quickly decide it was a bad idea smile or emptied later on.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#8 2018-05-07 16:32:03

ad4ms3
Member
From: Bradford, UK
Registered: 2018-01-19
Posts: 95

Re: [SOLVED] missing files?

Perfect, thank you all for your advices;) I will follow them. And will not not type anything insane in terminal:D
Arch is back waiting for my free time to set it up.
This time with xfce. Have already encountered Linux specific problems, but most of them solved thanks to wiki.

Offline

Board footer

Powered by FluxBB