LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   why do OS use File systems ? (https://www.linuxquestions.org/questions/linux-newbie-8/why-do-os-use-file-systems-382996/)

naveenrajn 11-14-2005 07:28 AM

why do OS use File systems ?
 
hi,

Why do operating systems use file systems? In case of linux we use /boot, /usr , /root etc.. why couldnt all files reside in 1 place say "/" . Is it bcos of any hardware limitation of the HDD or some thing else?

meranto 11-14-2005 07:37 AM

Re: why do OS use File systems ?
 
Quote:

Originally posted by naveenrajn
hi,

Why do operating systems use file systems? In case of linux we use /boot, /usr , /root etc.. why couldnt all files reside in 1 place say "/" . Is it bcos of any hardware limitation of the HDD or some thing else?

Even if you would only work with "/" you would still have a filesystem.

The reason why not everything is placed in "/" is that you can't use the same filename twice, so in the end you would have terribly long weird filenames.

How about trying to find a document while scanning trough 90000+ files if you don't know the exact name (because you had to make up a weird name to prevent duplicate filenames)

okmyx 11-14-2005 07:39 AM

With a multiuser system its easier to configure access/security based on folders rather than configuring every single file individually.

blindcoder 11-14-2005 09:38 AM

Re: Re: why do OS use File systems ?
 
Quote:

Originally posted by meranto
The reason why not everything is placed in "/" is that you can't use the same filename twice, so in the end you would have terribly long weird filenames.
Of course you can!
Code:

blindcoder@ceres:~/tmp$ ls -lR
.:
total 4
drwxr-xr-x  2 blindcoder users 4096 Nov 14 16:35 a
-rw-r--r--  1 blindcoder users    0 Nov 14 16:35 foo

./a:
total 0
-rw-r--r--  1 blindcoder users 0 Nov 14 16:35 foo

There are simple reasons for this:
If you put /home on its own partition, you can later reinstall the system WITHOUT LOSING ALL YOUR CONFIGURATIONS AND DATA!
If you put /boot on its own partition, you can for example put / on a RAID or encrypt it.
If you put /var on its own partition, you can mount it via NFS and store your logfiles and other "var"iable stuff on a remote machine.

The possibilities here are endless.


Greetings,
Benjamin

purelithium 11-14-2005 09:46 AM

http://en.wikipedia.org/wiki/Filesystem

Read that, it may clear up your confusion.

sundialsvcs 11-14-2005 12:22 PM

The arrangement of files into a hierarchy of folder-names anchored with "/" is a logical arrangement of information that is used throughout all Unix variants. This may or may not correspond to the physical arrangement of the data.

In many systems, it does correspond: the various top-level directories such as /usr, /boot, /opt, /temp may well reside on different devices and/or partitions, and all of the information under that particular directory reside on the same physical volume. This can be done for several reasons, such as: protection against device failure; ease of upgrading; physical location and/or type of media.

But... it ain't necessarily so. Subsystems like LVM (Logical Volume Management) are commonly used on severs. (See for example this very complete two-part article from IBM. Part two is here. The LVM HOWTO from The Linux Documentation Project (TLDP) is here.)

In this scenario, each "logical" volume is stored on one or several physical volumes. Space can be added, reallocated, and removed if necessary, all without rebooting the system. Files can be distributed among several physical volumes at the same time, perhaps to gain the advantage of distributing the I/O load among different devices instead of creating a bottleneck of continuous access against just one. Some LVM management systems are quite sophisticated, with the ability to maintain backup copies of the same file on different volumes at once; to migrate frequently-used files to faster volumes; to take a "system-wide" view in cases where more than one computer-system in a cluster is accessing the same information.

redhatrosh 11-15-2005 12:17 PM

Generally, the purpose of a file system is to structure the storing and retrieving (and sometimes protecting/controlled access) to files.

It is not just purely names or the file itself, but the entire system has applications that need to work with it so it has to be designed and made in a format so that the Operating System can access files easily and provide it to the applications when required.


All times are GMT -5. The time now is 05:25 PM.