5.1.2. File System Model

 Back  Linux  Next


If it is shown during the time that the existing disk resources too small to be physically add the new disk. Through the Virtual PC disk will be created and will be added by selecting the Debian virtual machine through Virtual PC options selection program support /Action/-/Settings/-|Hard disk 2| via wizard ||Virtual disk Vizard|| is shown below. In this Debian computer must not be active.

 One active disk drive in the VPC
Figure* 5.1.3 Adding a new disk in Virtual PC. ( + / - )

When you are making a new drive, in this example, arbitrarily named [Debian_hdb.vhd], it should be added to the system selection ||Virtual hard disk file:|| and by ||Browse...||| window choose the wizard to create a virtual disk file. The process of adding a virtual disk operating system is not connected to its creation. These are completely separate actions; first create and then add a virtual disk. This is pure 'physical' operation that the Virtual PC environment performed as described. When the virtual machine is restarted it does not mean that this extra disk operating system immediately seen as possible is added as a record in the corresponding .VMC file.

Drive is attached but not formatted or partitioned into partitions. When the Debian virtual machine through the console as user 'root' task of command ' cat /etc/fstab ' annexed to see that there is no disk. The command ' fdisk - l ' gives the following cycle:

 List of the disk partitions
Figure* 5.1.4 List of the partition table before and after adding a new disk. ( + / - )

In Figure 5.1.4a the last row shows that the new disk attached to the name [hdb] but it is unusable. Besides the ' fdisk ' command for this purpose are available commands ' cfdisk ' (powerful, affordable and stable version) and ' sfdisk ' (complex and inaccessible hacker version).

The process of preparing the disc begins with creating partitions command ' fdisk /dev/hdb ', followed by a request that you use the ' fdisk ' command. It is well before using any of these options carefully read all entering ' fdisk ' commands by option ' m ' for help. Due to the need for expansion of resources at different places disk is divided into one primary partition and one extended partition with two logical partitions in it. First, offer the possibility of creating primary and extended partitions, and by creating an extended partition still have the option of creating a primary and logical partitions, which is fine because it is a 'container' for logical partitions prepared and can no longer be seen. When everything is set to write a new partition table, when a new startup partition can see the command ' fdisk -p ', but in [fstab] no because they are not hooked up anywhere (MOUNT). According to the above are available [hdb1], [hdb5] and [hdb6] as shown in Figure 5.1.4b.

When installing the operating system, all logical partitions are hooked (edited) for the top-root filesystem and accessible as a directory of the same name [/var], [/home] and analogously for the other. Other directories are built into the system with the usual method of making the directory and added to the appropriate place. Added a new disk partitions defined by the procedure described in the attached table partition and its partitions need for something to attach (mount) in order to be reachable. You need to specify the location in the file system, which was initially built on the [hda] drive, which will be annexed to the partition [hdb] disk attach (mount) - Mount Point (MP). Let's plan for expansion of resources according to the following table:

Disk partition Expand Mount Point - MP Forbidden MP
hdb1 home /xxxx/home /home
hdb5 usr /xxxx/usr /usr
hdb6 var /xxxx/var /var

But there are no more file system because they are not prepared to accept data, and should be formatted for a possible solution, apropos BUILD file system by support of command ' mkfs '. How to get detailed instructions on using the command?

           # mkfs -t ext3 /dev/hdb1 
           # mkfs -t ext3 /dev/hdb5
           # mkfs -t ext3 /dev/hdb6

Is created in the process an SUPERBLOCK for each partition. The command ' mount ' allows the created file systems on track to join the Mount Point (point of attachment). Command without arguments and options will show what is by now 'hooked' for the available disk partitions. New partitions are appended to the command:

           # mount /dev/hdb1 /xxxx/home
           # mount /dev/hdb5 /xxxx/usr
           # mount /dev/hdb6 /xxxx/var

For each of the partitions [/xxxx/...] symbolizes directory (MP) in which the additional partitions mounted and which must be made before installing if you do not already exist. For the three additional partitions is not necessarily to be the same directory. MP can be the same name as an existing partition, but can not be mounted in the same place where it is already mounted partition or directory with the same name. Otherwise, the new empty partition overwrite existing same name facilities. Usually it takes to mount from the system created directory [/mnt]. Repeat the command ' mount ' without options and arguments will now show the added content.

Of course, the command has its various options and set their simplest use. The command ' df -k ' will show that there are two directory [/home], one in [hda] and another on [hdb], but the command ' ls -al ' show different content for each [/home] is shown below.

 Directories and associated partitions
Figure 5.1.5 Overview of the original and its associated partition.

To the original location [/home] located at [hda9] joined optional part should serve coupler (link) in the directory [/xxxx/home] to [hdb1] that 'looking' at the directory in the original location and reverse but there is no automatic coupler distributed content, but it must be done by an administrator. The right extension can be achieved in a way that the data is copied from the old location to the new and larger then the old place 'unmounts' and in its place 'mounted' major new, or to make a copy of data of the whole system and to re-install the operating system with the distribution of total resources adapted to the added physical resources. There is still the possibility that after unmounting and mounting partitions, or to reassign the space in a new way, to carry out a merger or expansion of the partition in the specified tools - a powerful 'Disk Manager', but they were not part of the core distribution will not be described here.

When the composition filesystem and not a partition disks, [/home] is the only one and unique, which means that in terms of capacity can not be increased by pairing literally resources. Partitions must be made 'hook' for any directory in the system, because otherwise 'invisible'. Thus, the partition associated directory, and the file system is responsible for all data and does not matter as much as any disks and partitions, supports and consolidates.

But all of this will have no effect if the changes do not write to be read and applied in the next turn-on your computer. You need to edit the file /etc/fstab to add the verses that refer to the new partition and their MP as shown in Figure 5.1.6a. When a file is edited, and saved so that it contains written, that shows ' cat /etc/fstab ' command ' init ' in the image associated with the argument used by the aforementioned list of modes of operation of the repeated start the computer without turning off.

 Initial mount table
Figure* 5.1.6 Initial mount table (fstab) and view all the partitions. ( + / - )

Command to view the partition ' df ' gives the result as shown in Figure 5.1.6b. So they are now added to the partition permanently mounted. The display is different compared to Figure 5.1.1.


Example II

Schedule disk server resources of an institution, which were consolidated in a RAID 5 array.

Command to view the partitions and their availability in a form comprehensible to man ' df -kh '. Report by this command with appropriate options to:

drago@mak:~$
drago@mak:~$ df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             494M  136M  334M  29% /
tmpfs                1014M     0 1014M   0% /lib/init/rw
udev                   10M  676K  9.4M   7% /dev
tmpfs                1014M  4.0K 1014M   1% /dev/shm
/dev/sda3              12G  3.5G  7.8G  31% /var
/dev/sda5             5.0G  1.3G  3.5G  28% /usr
/dev/sda6             1.5G   33M  1.4G   3% /tmp
/dev/sda7             182G   13G  169G   7% /home
drago@mak:~$
drago@mak:~$
 

SCSI drives are the types of facilities is approximately 37 GB per unit, integrated into a RAID array using a single volume control that is completely unique firmware solution, and the operating system sees them as one [sda] disk RAID controller so as presents. RAID 5 disk array to preserve the data and functionality of the system in case of failure of one of the physical disks. This example can serve as a guide on how to divide the disk partition for an web mail server with hundreds of active users.

The character ' | ' in Figure 5.1.5 applied and the command line used for chaining commands and the previous figure descriptive would mean the following: read all the file system disk partitions (df), and from that list select and display only rows that contain the term 'home '. Thus, the command ' grep ', at Figure 5.1.5, stands out for her and sent the results to its arguments is followed by its KW (keyword), only desired.

The entire procedure described above can be vividly shown as follows:

 Joining of partitions
Figure 5.1.7 Joining an additional disk partitions to system.

Mechanism of attachment not only applies to disk partitions. That [hdb] already had a file system with its own structure, all that is on it became available to the subdirectory in the directory [hda] which is attached. This means that the already built one file system can join either the entire disk or its partitions regardless of where the initial media file system on your computer. So that the computer starts with a self-starting CD / DVD media on which the Linux (KNOPPIX - Live Linux Filesystem On CD), join him damaged partition existing drives and repairs. Also a way to change forgotten root password. Looks like BartPE.

Directory can be made-delete with commands ' mkdir ' - ' rmdir ', a file is created or some editor, compiler, and deletes the command ' rm '. Deleted Items can not be returned. If you mistakenly deleted a directory, can sometimes be 'back' by creating the same in the same place immediately after removal, provided that nothing else is done in the meantime. Not a rule but it is sometimes possible. File can not be that way 'back'. One should be very careful with recursive deletion, when the command is executed through all the directories that are hierarchically below where is the default.

To effectively use the file system needs to know, or rather, a directory structure that is used. No matter what type of file system, a directory structure that supports the Linux operating system is almost the same in all versions, and describes the subsequent pages.

NOTE: Forcing shutdown computer can corrupt the file system.


 Back
 Search
 Next

 Content - Home
 Content  Informatics Alphabet
 
Citing this page:
Radic, Drago. " IT - Informatics Alphabet " Split-Croatia.
{Date of access}. <http://www.informatics.buzdo.com/>.
Copyright © by Drago Radic. All rights reserved. | Disclaimer