Thursday, January 5, 2017

Disk Management 1

Disk Management 1

Disk Partition and File System

Disk partitioning allows multiple file systems to be created on a disk. Each logical disk partition hosts a file system. A file system allows files to be stored in a directory in an order. Definitions for required cataloging (required for quick access, location indicators, etc.) and access control (which file and how accessible) can also be performed on a file system basis.

Very different file systems have been developed and used for different purposes. File systems developed for multitasking systems often have different attributes than those developed for single-tasked operating systems. In a multitasking system it may be necessary to define special mechanisms at the file system level because of the possibility of processing the same file for more than one process at the same time. Similarly, file systems developed for multi-user systems are quite different from file systems designed and developed for single-user systems. The infrastructure that will allow access control rules to be defined in multi-user systems is provided by the file system.

An example of a file system is:
In Windows: NTFS (New Technology File System), FAT
In Linux: ext2, ext3, ext4...

File Systems

Many different file systems have been developed with the different needs that arise. The most common file systems for Linux are ext2, ext3 and raiserfs file systems. Besides, it can be used under Linux with up to 20 file systems including fat, vfat, ntfs, is9660 filesystems.

Ext3 and raiserfs file systems are based on transaction logging as well as advanced database management systems. Due to these attributes, these file systems have high reliability. It is not possible to lose data easily. In the event of power failures and unexpected shutdowns, the file system correctly and successfully stores information that can restore itself to its last good state.

Many current Linux distributions, including Suse Linux, use the ext3 file system by default.

File systems should be checked for consistency before use. Often, boot scripts automatically do this for file systems that are used at boot time.
 
 


File size and file system limits can be inspected from figure below:

Disk Partitioning

One of the applications that can be used for partitioning under Linux is fdisk. Another widely-used alternative to fdisk is DiskDruid. These applications are basically used to separate multiple logical partitions of a physical disk.

The fdisk program runs briefly and gives a brief usage information. A disk device file must be supplied to fdisk. The disk device files are "/dev/hd[abcd]" for the IDE interface and /dev/sd[abcdefgh] for the SCSI interface.

Mounting File Systems

Once a partition is defined and a file system is installed through the mkfs program, this file system can be used by connecting to any directory in the UNIX directory tree structure. The so-called mounting is to use the files in the specified file system when attempting to reach a particular directory.  

The mount program is used to link file systems. From the moment a directory is linked to a file system, every user that goes through this directory will see the files provided by the new file system. If there are saved files in this directory before linking, these files become invisible / unreachable. When the connected file system leaves (unmount) the files will be accessible again. 

A file system that is actively used (for example, the file in which it is being read or written) can not be separated from the directory structure. Programs that use the file system must be terminated.

Some of the current distributions come with an integrated Linux kernel patch called 'supermount' or 'automount'. With this application, removable media can be mounted or unmounted at the time of access. For example, when a user inserts a CD media into the CD-ROM drive of the system, the drive is automatically connected, and when the eject button is pressed, the connection is resolved.

Disk Usage Information

The occupancy information of file systems and files/directories can be accessed through the df and du programs.   

Example usage of df command is given in the figure below:
df (Disk Free) - Indicates occupancy information of all connected file systems. In the example, the "-k" option is used to display the values in KB units.

du - Estimates file space usage.

To read my previous article: File Permissions and Access Rights 2

No comments :

Post a Comment

Comments system

Disqus Shortname