Results 1 to 3 of 3

Thread: Complete Linux File System

  1. #1
    Join Date
    Nov 2005
    Posts
    709

    Complete Linux File System

    A file system is a way to organize and store a tree on a carrier (disk, diskette, CD ...). Each proprietary OS has developed its own organization. You can do multiple systems coexist in the same disk partition. Linux has a system called ext2 but can manage others. The list is provided in /proc/filesystems. The user can therefore access to other Linux file systems such as DOS, vfat,from a device or imported by the network. As with everything the user file, all filesystems regardless of physical location must be integrated into the unique logical tree of the Linux system. This tree can be built (and changing) from various partitions can be on multiple discs. This makes integration and further apart than in the Windows world where the partitions and drive that are assigned the letters A: C: D: remain separate entities. Of course the partition where is located the root plays a special role.

    A file system will be best used as a shelf in front of very many cases. At each of these there are other boxes that can themselves contain smaller boxes. The smallest boxes are the size of the block size of the file system, in most cases, that is 4 KB. Standing in front of the shelf and now has the task to stow something in it, you must decide, in which case you simply put it. A strategy is a box to pack as much as possible to fill up, then the next and so on. Another approach would be to have to open as few boxes as possible. To help you find the items stowed as soon as possible, then write a crate, for example, "Lego" or "pencils". The information, what is where, is called metadata, the Lego bricks correspond to the data.

    The file system is struggling with similar problems, it puts file fragments in so-called trees. Traditional file systems overwrite when saving a file, the data blocks. Changes while the size of a file, the file system free blocks used in the immediate vicinity. Depending on how much time passed between the first save and overwrite, this "close proximity" to be quite far away - thus the read head must travel longer distances. Modern file systems write data up to a free place, so every time you save a new copy created. This mechanism is called copy-on-Write. COW brings more performance, as the read head can read the data, usually at a time, and provides useful function is a version control system: The original data are still available.

    Linux File System

    Attempt at standardization, in the meantime many Linux distros have to: File System Hierarchy Standard. This is an absolutely necessary guidance, for an average Linux system, the latest SuSE distribution has ever slightly more than 170,000 files.

    Tree structure of files and directories.
    • Root directory: /
    • Directories contain directories or files.
    • File systems are on media such as hard disk, Zip, floppy disk, CDROM, DVD, etc
    • Several file systems per disk possible (partitioning).
    • A file system can spread over more than one hard disk. LVM (Logical Volume Manager), RAID
    • File systems are mounted to a specific location of the file tree (hung).
    • Others' computers, file systems can be integrated.

    File Categories
    regular file –
    • Text: mail, sources of programs, scripts, configuration
    • Executables: programs in binary code

    Directory File
    • container files that contain references to other files.
    • real structure of the tree, they can organize files by categories

    Special Files
    • located in /dev , what are the access points prepared by the system peripherals. The assembly will make a match of these special files to their home directory "mountpoint". For example, the file /dev/hda can access and loading of the first IDE disk

    symlinks files
    • These are files that contain a reference (pointer) to another file. This allows using the same file under different names without having to duplicate it to disk.

    File system types:
    • ext2, ext3, linux
    • JFS Journaled file system, AIX
    • UFS Unix File System, SUN
    • CDRFS, CDROM File System
    • NFS, Network File System, originally SUN
    • SAMBA, SMB File Server, NTFS (NT, Windows/2000),

    System Tree

    The root is the top of the hierarchy of directories. This is a logical tree, independent of the physical location of the various sub-directories, which can span multiple partitions included on one or more disks, and even on network drives. Its structure is standard, with extensions imposed by the distributions. Any modification is within the exclusive competence of the administrator, with the exception of directories in / home. It is recommended to meet this standard architecture

  2. #2
    Join Date
    Nov 2005
    Posts
    709

    Re: Complete Linux File System

    List of main directories :
    • / Root directory
    • / Bin executable files (in binary) (+ system initialization commands essential)
    • / Boot the kernel vmlinuz and boot files
    • / Dev directory device files, which serve as channels of communication with peripheral devices (disks, network adapters, sound cards, etc. ...)
    • / Etc files system setup and key setup scripts
    • / Etc / rc.d startup scripts the system
    • / Etc/X11 scripts X server configuration
    • / Etc / sysconfig Device Configuration
    • / Etc / cron job description to make periodic
    • / Etc / skel copied files in the dir. staff of a new user
    • / Root home directories of users
    • / Lib libraries and kernel modules
    • / Mnt the mount points root file system or external devices (cd, floppy, nfs ..).
    • / Opt instead of installing additional applications (such as StarOffice, Java ..)
    • / Root directory of the root user
    • / Sbin executables for system administration
    • / Tmp temporary files
    • / Usr programs accessible to all users; its structure mirrors that of the root /
    • / Var variable data related to the machine (print files, trace http connections, smb .. / var / log)
    • / Proc pseudo-directory that contains an "image" of the system ( /proc/kcore is the image of the RAM
    • Starting from the root directory / you will find the following directories:
    • / Bin - Contains the main user and administrator programs that are needed for system maintenance. All other programs should be / usr / bin be.
    • / Boot - Contains everything necessary to boot.
    • / Cdrom - Not part of the standard, but often the mount point of the CDROM drive.
    • / Dev - Contains the device files.
    • / Etc - Parameter files that describe the individual computer and configure, make up his individuality, so to speak.
    • / Floppy - Not part of the standard, but often the mount point of the floppy drive.
    • / Home - Contains the local user directories (home directories). Does not common for computer cluster with distributed file systems.
    • / Lib - important system and kernel libraries (see: / bin).
    • / Lost + found - Not part of the standards is part of the internal management of the file system.
    • / Mnt - Temporary mount point for file systems.
    • / Opt - Additional optional software such as Netscape, KDE and Gnome.
    • / Proc - Not part of the standard. Virtual file system that can be read from the pseudo-file status information of the kernel.
    • / Root - Home directory of the root - Users (System Administrator).
    • / Sbin - Utilities for the system administrator. Not part of the overall program search path.
    • / Tmp - Temporary files. writable for everyone.
    • / Usr - Here is (almost) all installed software. Read-Only. In principle, a copy of several computers for simultaneous use.
    • / Var - Data range for variable data: mail, print spooler, accounting, logging, etc.



    File name
    • are limited to 255 characters long,
    • distinguish uppercase and lowercase letters,
    • must be unique within a directory
    • should not contain spaces. Already umlauts are problematic, but the use of - / "'*, - & #? () [] @ ~! $ {}> <. Because these signs of a reserved meaning in shell and thus the problems of Linux commands commanding lead.

    Directories

    Work Directory - The directory where you are. Cd (change directory), you can change the working directory and pwd (print working directory) to let's, in which directory you are currently located.
    Home Directory - The directory in which you are under the sign.
    • . (The working directory)
    • .. (The parent directory (parent directory) )
    • ~ (The home directory)
    • ~ User (The home directory of the user user)
    • ~- (After a change directory to the previous working directory)

    Path
    • relative pathname - The starting point of the episode list is the current directory, eg .. / .. / g / grote / .profile. Syntactically a relative path name starts without a slash "/".
    • absolute pathname - The starting point of the episode list is the root directory such as / dfs / u / g / grote / .profile
    • Path name cannot be longer than 1023 characters.

    Typical directory names
    • am - binary. The directory contains binary files, usually callable programs.
    • boot - to boot: To load and initialize the operating system on a machine.
    • dev - device. Device files
    • lib - library. Directory of subroutine libraries
    • mnt - mount. Mount point for a file system
    • opt - optional. Optional, that is optionally installable software
    • sbin - binary system. Directory of programs for the system administrator
    • tmp - temporary. Directory for temporary files.
    • usr - user. Software to users.
    • var - variable. Directories with variable data.
    • local - Locally installed software
    • share - In principle, together in a usable copy of software and information.
    • include - Header files of the C programming language
    • misc - Miscellaneous.

    Commands to get Directory List
    • ls - control general access to information files dir. current try ls, then successively ls-l ls-a. ls dir
    • cd path - the path can be absolute (signposted from the root) or relative (from dir. current)
    • cd - shortcut to the rep. Staff
    • file - information on the nature of the contents of the file
    • pwd - gives the full name of the rep. current
    • mkdir dir - to create a sub-frame of current rep
    • rmdir dir - to delete a sub-rep empty

    Inodes

    Each file system maintains a table of file descriptors used by the operating system to access files. This table consists of each file, called an inode entry, marked by an index called the inode number. The list of file systems supported by Linux is visible in / proc / filesystems. There is a tool to check and repair systems: fsck, which takes place on a system or subsystems, a rep. Compulsorily dismantled.

    For example, to check the rep. of users: fsck / home. Special files /dev contains the attribute b (block) or c (character mode)

  3. #3
    Join Date
    Nov 2005
    Posts
    709

    Re: Complete Linux File System

    Permissions

    If one wants to access a file, so you the permission for the file and the path must have. There are three different access rights:
    • read - The right to be able to view the file contents. For directories: To view the list of files and their attributes.
    • write - The right to be able to change the file content. For a directory, it is the right to be able to create and delete files. If one has the write permission on a directory, you can delete a file even if based on the file has no rights!
    • execute - Marks a file as executable and regulates who is allowed to run the program. In the search, only files which may also be have granted this right. For a directory: The right to be used in a path.
    • Linux is a multiuser system. So it must be possible (groups) to access files on individual limit users. File access rights are granted for three user groups:
    • owner - The owner (owner) of a file is the only the right to assign access rights.
    • group - A user belongs to a group or groups. File access is controlled for just one particular user group.
    • other - Regulates the access right for all those non-owners and non-file party members.

    What is new in ext4

    Ext3, for years the standard file system for Linux, has come in the years. Modern mass storage are its limits are approaching, and the block-based data management is no longer current file size requirements. Time for an update. In view of rapidly increasing amounts of data is increasingly clear that Ext3, the current standard Linux file system is reaching its limits. A maximum file system size and thus volume of 16 terabytes of RAID can be used in large-Linked pinch right now, but more is just not with the 32 bit block numbers of Ext3 data in 4 KB blocks of size inside. A major renovation is at also.

    The kernel developers have taken the ext4 code in the kernel 2.6.19 to leave him there to mature. Up to version 2.6.27, ext4 was marked as experimental, since Linux 2.6.28 is the new file system to be stable - which by no means excludes that the code can not contain more bugs or surprises. The current Ubuntu 9.04 can be installed on ext4 already, the upcoming Fedora 11 is already the default file system to use ext4.

    Ext4 is working with 48-bit signal block numbers with a standard block size, as before, 4 KB. This allows a file system size of up to 2 48 blocks of 4 KB, which is a Exabyte (1024 PByte) instead of the 16 TB of Ext3. Why not 64-bit signal block numbers? The developers call in an article a very pragmatic reason: 1 EByte is long enough to - and even on one file system of this size would be a complete e2fsck run with the currently available hardware) over 100 years before (. Before one even comes close to this limit, we must therefore address all other issues that would require much larger changes in the file system as 64-bit signal block numbers. In addition, the 48-bit signal block numbers fit better in the old ext3 data structures.

    In Ext3 32bit i_blocks value in the inode that contains the number of occupied by a file blocks, was equally matched in two respects to the larger block numbers: First, it no longer counts as of yet in Ext3, in hard drive sector 512 byte size, but in the block size of the file system, so usually 4 KB. A flag in the inode indicates how the value is interpreted, which is important when upgrading from ext4 to ext3, as it can occur even old ext3 inodes, the sectors are. Second, it uses two bytes in the inode not previously used to store the upper 16 bits of the 48-bit signal block number. The file system feature huge_file indicates that file system with 48-bit signal block numbers, the works and inodes in file system blocks that can count. Individual files can presently not be larger than 16 TB, despite the 48-bit signal block numbers, as it can with the current structure of the extents not handle larger files - more on that.

    Compared with the other filesystems in the kernel ext4 competes primarily with XFS - IBM's JFS has found so far not too many supporters in the Linux world, and Reiser 4 is still not integrated into the kernel. As a result, the advantages over XFS ext4 developers leaner code base to (about 30,000 lines in 900 KByte versus 100,000 lines in 3.2 MB), the ability to convert an ext3 file system for ext4, and the large proportion of code taken over one of the sophisticated and thoroughly tested Ext3 has.

    The most important internal improvement in ext4 is the use of extents used in place of the ext3 indirect block addressing. In the latter stores an inode numbers of up to twelve 4-Kbyte blocks. If a file is larger than 48 Kbytes, first come indirectly addressed blocks (up to 4 MB), then twice (up to 4 gigabytes) and then three times indirectly addressed blocks are used, which as a block number in the inode on a block by block numbers on blocks with block numbers refer to the blocks with the block numbers of data points to (Ext3 details can be found here ). This classic addressing scheme of the Unix world proves itself in small or highly fragmented files, as well as sparse files does, but for large files an increasing administrative overhead with it.

    Drive Mount

    Before you can use any device with its own filesystem (eg CD-ROM, floppy, tape, network share windows, nfs directory, fat32 partition a hard disk ...) it must be formatted and mounted in a subdirectory of the root ( /). Once the filesystem is mounted, and programs accessible to users in a transparent and becomes part of the directory tree under /. After use the file system can be removed (operation needed to eject a CD-ROM or a floppy). The directory on which is mounted a filesystem can not be empty, but when there is a mounted file system, the information contained therein are no longer visible until you do the umount.

    The management of different file systems within the same directory tree (the root: /) allows the abstraction of the hardware device by the operating system: for programs and users that access to certain files is not important to know or know what kind of device they reside and can access and manage all files with the same tools, regardless of the hardware on which they are registered.

    The drives , however small they may be, contain millions of bits, it is necessary to organize data in order to locate information, the purpose of the file system. A hard drive is, let us recall , consists of several circular plates rotating about an axis. The tracks (concentric written on either side of a plate) are divided into pieces called sectors (with a size of 512 bytes). The logical formatting of a disk to create a filesystem on the disk, which will allow an operating system ( DOS , Windows 9x , UNIX , ...) to use the disk space to store and use files. The file system is based on the management of clusters (in French "allocation unit"), that is to say the smallest unit of disk that the operating system can handle. A cluster consists of one or more sectors, as well as the size of a cluster, the lower the operating system entities will manage.

    In return, given an operating system knows that managing entire allocation of units, that is to say that a file occupies a whole number of cluster, the waste is all the greater that 'there are sectors per cluster. We now understand the importance of the choice of file system. When several operating systems coexist on the same machine, the problem of choosing the file system is at its peak. Indeed, the file system is closely linked to the operating system, and when there are multiple operating systems, you must choose for each of them the operating system taking into account the fact that it is possible that one has to access data from one another. One solution is to use FAT partitions for all systems, making sure to only use partitions larger than 2GB. The best solution is to use for each system partition whose file system is best, and to dedicate a partition to FAT16 data destined to be shared by different operating systems.

Similar Threads

  1. which one is the best file system for linux?
    By Schulz in forum Operating Systems
    Replies: 5
    Last Post: 07-05-2011, 07:46 AM
  2. Best Linux File System of All
    By Pakhi in forum Software Development
    Replies: 8
    Last Post: 28-02-2011, 08:41 PM
  3. The Linux File System Encryption API
    By Arrosa in forum Software Development
    Replies: 4
    Last Post: 24-11-2010, 12:26 AM
  4. Mounting file system in Linux
    By Garlands in forum Operating Systems
    Replies: 5
    Last Post: 15-02-2010, 10:43 PM
  5. File system for Linux
    By shivinder in forum Operating Systems
    Replies: 4
    Last Post: 08-11-2008, 01:14 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,854,967.29855 seconds with 17 queries