mercredi 7 janvier 2015

Why do we need to mount on Linux


I am new to Linux so apologies about the easy question.


I understand what mounting is in linux, and I understand device files. However I do not understand WHY we need to mount.


For example, as explained in the accepted answer of this question, using this command:



mount /dev/cdrom /media/cdrom


We are mounting the CDROM device to /media/cdrom and eventually are able to access the files of CDROM with the following command



ls /media/cdrom


Which will list the content of the CDROM.


My question, why not skip mounting altogether, and do the following



ls /dev/cdrom


and have the content of the CDROM Listed. I expect one of the answers to be: "This is how Linux is designed". But if so, then why was it designed that way? Why not access the /dev/cdrom directory directly? Whats the real purpose of mounting?



Aucun commentaire:

Enregistrer un commentaire