Why if I delete a file or folder from root (/) it comes back when I reboot? I have a rooted Samsung S4 mini(Android 4.4.4), I noted that there are certain files/folders(for example /dev) that when I delete them they come back when I reboot the phone. Why? Is it possible to delete them permanently?

I know that this is very risky and may brick my phone, but:


I'm very curious about this.
It is my guinea pig device.
I can re-flash it(I did it several times ;-)).
While GiantTree explained parts of the folder structure, he missed one "mount point": / aka "the root file system". This is created on boot, from contents of the "boot image" – which is a so-called "initial RAM disk" or, in short, Initrd. As it's created from the very same source at each boot, you can delete the stuff as often as you want – it will always return (until you "accidentally" delete that boot image itself – and are lost if you don't have a backup). Only after that, the other file systems are mounted – which GiantTree listed a few examples from (more details e.g. in my answer here).



Let me add an urgent warning: Never touch what you don't know what it's for (delete the wrong thing, and your device no longer starts up). Always create a good backup (see e.g. nandroid) before you start "playing" with system files. Far too many people end up here with having things deleted and not being able to get them back: without a proper backup, you can have a very hard time (especially with an exotic device that has no ROMs for download anywhere).