LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about the filesystem (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-the-filesystem-4175578624/)

andul 04-29-2016 08:09 AM

Question about the filesystem
 
How do the folders like /bin, /boot, etc. work? Do they have some special properties, or are they the exact same as directories made with mkdir?

beachboy2 04-29-2016 08:30 AM

http://www.thegeekstuff.com/2010/09/...tem-structure/

deadstar32 04-29-2016 08:31 AM

The directories like /bin, /boot, /etc are sub-directories of the / directory. With that being said, these directories are the same as any other directory within your file system in the sense that they could be made with the mkdir command (provided you had all the programs that came with your operating system to put in them.) What makes directories like /bin, /etc/, /boot, etc... special is what is inside the folders themselves. /bin contains mostly binary executables that are ready to run. For example ls is one of the executables in /bin. When you type ls your computer searches through a command path, finds /bin and when it sees ls it runs system calls like fork() and exec() that will run ls. /etc is an important customization directory. In /etc you will find all the configuration files (most of them anyway) for your system. /boot is the directory that holds things like the kernel loader files and things related to grub or LILO if you have that stuff. In general the Linux file system is a UNIX-based file system that is arranged in a hierachy structure with / being the directory that holds all other directories. Hence why / is called the "root" directory. /root is the directory for your superuser. If you want more information I would suggest getting the book "How Linux Works" by Brian ward and additionally getting any manuals that come with your particular Linux distribution

yancek 04-29-2016 08:33 AM

The link below explains what the purpose of the various directories and what they contain.

http://www.howtogeek.com/117435/htg-...ure-explained/

andul 04-29-2016 08:50 AM

I'm wondering, is it possible to create the filesystem from scratch? or is that really difficult to do?

keefaz 04-29-2016 09:02 AM

Every system install has to create filesystem from scratch, not difficult, doable but tedious to do by hand (can make typo, forget some dirs)
Check linux from scratch subforums

deadstar32 04-29-2016 10:37 AM

The command mkfs for example: mkfs -t ext4 /dev/sdb1 will make a Linux file system of type ext4 on the block device sdb partition 1. It is totally possible to make a file system as there is a command to do so. If you want to get more in-depth as to make file systems, I suggest that in your spare time you read up on database/information theory and assembly languages.

jpollard 04-30-2016 08:03 AM

Quote:

Originally Posted by andul (Post 5538264)
I'm wondering, is it possible to create the filesystem from scratch? or is that really difficult to do?

As above, the answer is yes.

If you would like some details... Look at/read the LFS (Linux from Scratch) documentation at
http://www.linuxfromscratch.org/lfs/read.html

The specific section on creating directories is at
http://www.linuxfromscratch.org/lfs/...atingdirs.html

And shows the commands used.

sundialsvcs 04-30-2016 04:51 PM

Be aware that there are some "filesystems" ... /proc, /sys ... which do not actually, physically, exist at all! :eek:

They are, in fact, API's to the kernel. When you ls them to "see what files and directories they contain," or when you read (or, if authorized ... write) to a "file" that you see, the kernel actually intercepts the request directly, and generates an appropriate response. These resources do not in fact correspond to any physical location on any storage device.

(P.S. It is the most downright slick, even elegant, operating-system API that I have ever seen. "Anyone and anything can use it," easily, using ordinary commands and interfaces.) :)


All times are GMT -5. The time now is 06:21 PM.