Why the system takes up almost all the storage of iPhone
If you are using iOS 12 beta. You should be submitting a bug report to Apple to check this, no? It might be leftover system files from iOS 11 or a way for you to go back and restore iOS. Point is. It is beta. So this question does not belong here.