Where are my backup files?

I recently encounted an i/o error on my backup NAS drive, so I ran fsck. It indicated a bad superblock so I ran sudo fsck -b 8193 /dev/sdc1 and answered y to fixes. Now I get this:
pi@rpi4b:~/Downloads/complete $ sudo fsck.ext4 /dev/sdc1
e2fsck 1.44.5 (15-Dec-2018)
NAS8: clean, 22591/244191232 files, 1356495135/1953506304 blocks
pi@rpi4b:~/Downloads/complete $ sudo mount -t ext4 /dev/sdc1 /mnt/NAS
pi@rpi4b:~/Downloads/complete $ ls /mnt/NAS
lost+found
pi@rpi4b:~/Downloads/complete $ sudo ls /mnt/NAS
lost+found
pi@rpi4b:~/Downloads/complete $ sudo ls -a /mnt/NAS
. .. lost+found
pi@rpi4b:~/Downloads/complete $
Where are my missing 22591 files? Can I recover them? I am running updated buster on my raspberry pi 4b w/ 4Gig.
Thanks.
--Steven
Reply to
nelsonse48
Loading thread data ...
They are probably in the lost+found directory.
Their names may be gone, and now named by inode number.
Some of the directory tree may be intact therein.
You probably have a big puzzle ahead of you. Hopefully all the pieces (files) are there.
File system corruption is no fun.
Good luck.
--
Grant. . . . 
unix || die
Reply to
Grant Taylor
...
Try "ls -la /mnt/NAS/lost+found"
and pray you don't have 22591 files with stupid names (e.g. all just the inode number as a name) in one single very flat directory ...
"Good news, I found your files"
"Bad news ... you're going to be doing a lot of renaming ..."
Please say you have a backup ... :(
--
--------------------------------------+------------------------------------ 
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk
Reply to
Mike
/lost+found is normally empty on a clean partition with no disk errors
So, why do you think there are no files or directories on your NAS disk since you apparently haven't run "sudo ls /" or "sudo df -h"?
How many files were you expecting to see? Occupying how many GB? Does "df -h" show anything like you expect? How long is it since your last backup of the NAS disk(s)? How many data/files/directories have you created or changed since your last backup?
How how much irreplaceable stuff would you loose if you: - check the NAS disk partition(s) and replace any that are damaged. Use parted or gparted for this: use parted if you're running the NAS via a terminal console or gparted if you're using a graphical desktop.
- reinstall the NAS OS from scratch
- restore the contents of the /home directory from your last backup
So, have a look at your RPi's filing system as I suggest above, work out how much important stuff stuff you've lost and then work out a recovery plan and execute it.
This is what I do and, since I'm paranoid about making backups and keeping them offline in a firesafe:
- My house server is backed up overnight every night to a permanently connected external USB drive for protection against finger-trouble.
- All my computers and backed up weekly to two generations of USB drives which are kept offline in a firesafe.
As a result I haven't lost any data I care about despite having had several disk drives fail permanently over the last 30 years or so.
I hope this gives you some ideas about what to look at and determine whether the NAS drive is recoverable and, if it is, how to do a partial restore to it.
--
--   
Martin    | martin at 
 Click to see the full signature
Reply to
Martin Gregorie
Correct.
Because "ls /" would show the root filesystem of the machine (irrelevant) and the OP did mount the affected disk on /mnt/NAS, and then did
ls /mnt/NAS
which showed an empty disk has been mounted, save for lost+found (which I suggested they look *inside*, not just squint *at* as they've done so far!)
22591. As per fsck's claim that there are 22591 files in the fscked-up filesystem (hiding!)
Tips about restoring /home etc. may be a red-herring here, as there is no indication there is anything *wrong* with /home, or the / filesystem, proceed with caution.
Make very sure you know WHICH filesystem you are mounting/fscking/wiping/restoring before doing it.
The best time to shoot yourself in the *other* foot, is when you are just recovering from shooting yourself in the first one!
--
--------------------------------------+------------------------------------ 
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk
Reply to
Mike
!)
proceed
restoring > before doing it. > > The best time to shoot yourself in the *other* foot, is when you are just > recovering from shooting yourself in the first one! > -- > --------------------------------------+----------------------------------
--
> Mike Brown: mjb[-at-]signal11.org.uk | http://www.signal11.org.uk 


Thanks to all.  I found all the missing folders in lost+found with #inode-n 
 Click to see the full signature
Reply to
nelsonse48
File system corruption can be caused by a LOT of things. I highly doubt that a new drive is dying.
fsck (file system checking utility) and gparted (partition management utility) do completely different things.
At least I'm not aware of gparted having any fsck capabilities.
--
Grant. . . . 
unix || die
Reply to
Grant Taylor
Be thankful it was just a few folders -- you could have had 22,000+ *files* in that condition!
The more sane equivalent of when DOS used to dump FILECHK.000 FILECHK.001 etc. all over the root of your C:\ Drive.
"Found 1783 lost clusters in 832 chains, convert to files? [Y/N?]"
Bad times ... :(
fsck can check (and repair). It can also sometimes check and destroy, in its attempt to repair. There are no guarantees, so make backups. Someday you'll need it.
Now, go and learn about "smartmon tools" and "smartctl" just to check that the new drive isn't *actually* dying! :)
--
--------------------------------------+------------------------------------ 
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk
Reply to
Mike
use SMART to interrogate it. This really us a useful addition to drives.
I think the linux package is 'smartmontools'
--
Microsoft : the best reason to go to Linux that ever existed.
Reply to
The Natural Philosopher
+10001!!!
--
"Women actually are capable of being far more than the feminists will  
let them."
Reply to
The Natural Philosopher
Glad to see in the thread that you have located & recovered your files
as a side topic another good recovery tool is photorec
it will scan a drive (even if the partitions have been removed) & recover anything that looks like a datafile it recognises - you will unfortunatly loose the file names.
also be very careful who you let have your disk, this app will also recover files you did not want recovering (as one young lady at work discovered when she asked for assistance recovering lost photos), fortunately the engineer who recovered the data for her was a gentleman & they did not go any further.
--
laser, n.: 
	Failed death ray.
Reply to
alister
Better still, keep backups.
(The thread is puzzlingly titled. If they are backup files then instead of trying to recover them, why not just make a new backup?)
--
https://www.greenend.org.uk/rjk/
Reply to
Richard Kettlewell
Pedant.
--
?The urge to save humanity is almost always only a false face for the  
urge to rule it.? 
 Click to see the full signature
Reply to
The Natural Philosopher
Richard was not on his own, I thought the same thing! But I was glad things turned out ok.
A few years ago I lost backup files when my backup disk died. New disk - new backup and no problem.
Reply to
Jim Jackson
I assume you now always run fsck on the backup disk after the backup and that you use a cycle of at least two disks for each set of data that you back up.
-- Martin | martin at Gregorie | gregorie dot org
Reply to
Martin Gregorie
Perhaps it is more of an archive than a backup.
--
Steve O'Hara-Smith                          |   Directable Mirror Arrays 
C:\>WIN                                     | A better way to focus the sun 
 Click to see the full signature
Reply to
Ahem A Rivet's Shot
Exactly what I was thinking.
If it is only a backup, reformat the NAS drive and run a full backup.
el
Reply to
Dr Eberhard W Lisse
Hopefully, not the sort of "backup" as mis-used in the sentence :-
"I moved all my critical work files off my main machine onto my external backup drive, which has now fallen off the desk and is making grinding noises. How do I recover my backup?"
Key word that gives me chills: "moved". Uh oh.
Did you mean copied?
"No, moved, to make space" ...
(Uh oh)^2 ...
--
--------------------------------------+------------------------------------ 
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk
Reply to
Mike
:)
You learn these things two ways.
Other people's near misses and disasters, or your own.
smartmon + RAID has saved my backside more than once when "Pending Sectors" have become "Uncorrectable Sectors" and in one case "Drive? What Drive?"
smartmon (without RAID) has flagged up problems with a disk with loss of two (2) files, both easily recovered from a backup after cloning the failing disk (as a first, fastest-recovery strategy).
smartmon, however, has been utterly unable to prevent or warn about SD cards in a R-Pi dying without warning (once) or Pi USB memory sticks (twice) because that's not in its remit :(
So, back to the backups it is.
--
--------------------------------------+------------------------------------ 
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk
Reply to
Mike
I have to say that I regard SD cards in Pis (or anywhere else for that matter) as 'throw away when they break' devices. The whole thing (Pi + SD card) costs so little. On the other hand I've not managed to actually break either a Pi or an SD card yet! :-)
--
Chris Green
Reply to
Chris Green

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.