1

There's a way to manage these system folders?

I am struggling with some folders that are automatically created at boot, by system on the SD card, but I don't want them!

The folders are especially the following: LazyList, LOST.DIR

Into the latter I have found several, also big, files, and I don't want to waste the storage, maybe, with duplicated or deleted files. There's a way to better manage, or even better, completely avoid it?

Thank you... as always!

1
  • LOST.DIR is created by FAT family of filesystems when filesystem check performs a recovery. LazyList might be created by some apps for image caching. Both cannot be avoided. Commented Apr 8, 2021 at 9:58

1 Answer 1

1

EUREKA! I have found a way!

After some deep "Guru meditations" I have had a "flash of a genius"... and found the way!

It relates to the file system itself. The rule is that where it is a file with a given name in a folder, there cannot coexist a folder with the same name, so, if you, after the deletion of the folder, create a file with the same name, that folder cannot be created anymore!

.

So, if you want to get rid of an auto creating folder, just create a file,

and if you want to get rid of an auto creating file, just create a folder,

with the same name, in the same path.

.

The file or folder will substitute one the other, and voilà, you could avoid the creation of the almost useless folders, even included LazyList and LOST.DIR, and whatever else you want!

Man vs Filesystem: 1-0

6
  • It's good that it worked for you. But the entity creating the file/folder may simply run rm -rf before creating the new one, unless you make the file/folder immutable some way. Commented Apr 11, 2021 at 15:20
  • It is possible, but why to literally format a card using that command and deleting Everything, since it happens in the root directory? Commented Apr 15, 2021 at 15:28
  • I meant rm -rf LOST.DIR or rm -rf LazyList, not deleting everything. I thought that's understood. And I'm not talking about a person deleting those directories. The app or the fileaystem driver which is creating a directory (by calling mkdir) can also simply delete that file (by calling unlink) before creating the new one, unless the file is made immutable. Commented Apr 15, 2021 at 19:10
  • Sorry for my misunderstanding, sir. I'm a newbie here, accept my apologies. Please help me to better understand: if that entity calls, in order: chattr -i name --- rm -rf name --- mkdir name, we have lost our battle for sure? Thanks! Commented Apr 17, 2021 at 10:25
  • No need to apologize, everyone is learning here. No. The correct statement is: "if that entity calls, in order: rm -rf name; mkdir name, we have lost our battle for sure". If we have set immutable flag by running chattr +i name, then rm -rf name won't succeed. Instead chattr -i name; rm -rf name; mkdir name would be required to create new file/directory. Commented Apr 17, 2021 at 12:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .