-   Linux - General (
-   -   Data loss under Linux (

sajreborn 05-11-2020 12:49 AM

Data loss under Linux
I work under linux debian buster.
This morning I worked as usual and my PC crashed. I forced it to shut down and when I restarted, it presents the terminal with initramfs (if I'm not mistaken) by inviting me to do an fsck.
This is not the first time this has happened to me. I usually do an fsck -y / dev / sda1 then fsck -y / dev / sda3 for my root and home partition.
But this morning, after crashing, when I did that, he scrolled through several messages quickly, and that worried me. At the end I restarted my PC and voila, I can no longer find my work folder. In fact, I have a folder containing two other folders. Hey there is only one visible folder left. All of my shortcuts to the missing folder no longer works.
When I make a df -h, the size appears as if the file is present, but impossible to see it. It is not in / lost + found
I have a global search in my home, and nothing
I can no longer work, all my work was there, I have a 1 month old backup, but good.
If really really, you have a solution, please I'm desperate.
My disk is partitioned into 4 including 3 for linux and one for ntfs
Thank you

fatmac 05-11-2020 05:15 AM

First thing to ask yourself is why is it crashing - as on a regular basis suggests that maybe your disk is going bad, & will soon fail completely.

Check your dmesg & log files for clues to what is going on.

(A monthly back up is good for a normal user, but if this is for a business, you really ought to back up on a daily incremental weekly back up, & rotate them.)

sajreborn 05-11-2020 07:05 AM

too happy
I found my data.
What made me have 0.5% of hope (I must admit I was at the edge of the window with the pc and looking for my data one last time), was the size of my partition. When I right click on home and I look at the size I have 31go, and with a
df -h
and as a result:
/ dev / sda3 192G 95G 87G 53% / home

or 95 GB of used, compared to 31 GB above, so where are the 60 GB?
Before the problem, I was around 95 GB in size.

It is true that several messages including the word inode or node (I do not remember) with numbers quickly appeared during fsck -y

Someone suggested I take a look at / home / lost + found, and when I did, I saw nothing. But when I logged in as root in a terminal, then "cd / home" and ls lost + found ", I saw numbers like # 13032 # 13036 # 1181667, and a folder with the number # 4703. So I made a "chmod 777 -R lost + found" in order to be able to access it via my account (simple user account). Once the command was executed and after a few minutes, I opened / home / lost + found via a "nemo" file explorer and TADAM, all my data was there.
Iíve done SEVERAL SAVINGS and vowed not to trust fsck -y anymore, even though itís a great tool, but Iíll use it with caution.

syg00 05-11-2020 07:12 AM

Note the advice above re the disk. And check your data - the files you rescued may be fragments or truncated files. Or if you're really lucky they may be complete.

Also note fsck is for making the filesystem consistent. That may maintain files, or maybe not. It did its job - otherwise you wouldn't have got any files back. If I have a major event, I treat the filesystem as compromised and restore the entire filesystem.

Turbocapitalist 05-11-2020 07:18 AM

Indeed. If it is crashing there is a real problem with the hardware. Look at the smartmontools package, or equivalent, for your distro to see what is really going on with your hard drive. If the drive is failing, but it does not get physically replaced with a new drive, you will lose your data.
But the smartmontools will show what is going on from the hardware side.

sajreborn 05-11-2020 09:40 AM

All my data is restored, I checked and tested

ondoho 05-11-2020 11:57 PM

You need a new disk.
fsck, as said earlier, checks the filesystem. It does not perform magic on the hardware.
Also, you should start making backups. Yes, even with a brand new disk.

All times are GMT -5. The time now is 01:30 AM.