Community discussions

MikroTik App
 
justtim
just joined
Topic Author
Posts: 10
Joined: Wed Nov 04, 2020 3:54 pm

Accidentally removed Lost+Found folder from file system

Thu Jan 27, 2022 11:19 pm

When cleaning up some of the old The Dude files and folders, I clicked delete once too many in Winbox and accidentally removed the Lost+Found folder.
Is there any way to restore this? It did not restore automatically upon reboot.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10216
Joined: Mon Jun 08, 2015 12:09 pm

Re: Accidentally removed Lost+Found folder from file system

Fri Jan 28, 2022 12:11 am

You probably have the Dude files on a USB stick?
I have a Dude server on CHR with the Dude files on the local filesystem and there is no such folder.
Anyway, it should not be that important to have. When you want it back, ftp to the router and mkdir it in the place where it was.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 2993
Joined: Mon Apr 08, 2019 1:16 am

Re: Accidentally removed Lost+Found folder from file system

Fri Jan 28, 2022 12:18 am

There is nothing in Lost+Found , until a disk check program is looking for files that are not listed in some directory, and finds some.
(This is a filesystem inconsistency due to crash or power cut when active, or removing the disk without eject)
That check program will create the Lost+Found folder, to give the orphaned files a directory entry. If all is OK, nothing will be in the Lost+Found folder.

No idea how to trigger the check program in RouterOS. Maybe software ejecting the disk (/disk) and removing and re-inserting will start that check program. (Just guessing).
But again, I see no need for doing this.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11587
Joined: Thu Mar 03, 2016 10:23 pm

Re: Accidentally removed Lost+Found folder from file system  [SOLVED]

Fri Jan 28, 2022 10:32 am

Most linux installations perform file system checks periodically (at boot time) ... I think the periodicity is around 1,5 years. Which means lost+found is re-created then. I've no idea how ROS does the file system checks.

As @bpwl already explained the role of lost+found, normally it's not needed and if fsck finds some lost files (and thus needs the directory), it'll create it anyway. However, if missing lost+found bothers somebody too much, then I guess it is possbile to do things right as follows:
  • properly unmount USB disk
  • plug it to normal linux machine
  • execute fsck -- -f <USB block device> to forcibly run file system check (without "-- -f" it won't run if FS otherwise seems to be clean)
  • move USB stick back to router
 
justtim
just joined
Topic Author
Posts: 10
Joined: Wed Nov 04, 2020 3:54 pm

Re: Accidentally removed Lost+Found folder from file system

Fri Jan 28, 2022 8:37 pm

I did not realise the folder must have been on the SD card instead of on the local storage.
In that case it should indeed be totally fine, I will eject the SD since I was only using it for The Dude.
Thanks all for helping out!

Who is online

Users browsing this forum: Grumpy, Majestic-12 [Bot], panayi and 72 guests