TECH SOLUTION

TECH SOLUTION

Saturday, 19 October 2013

LINUX DISK MANAGEMENT( THEORY )



Linux Disk Management

Disk Partitioning

To see how your Linux disks are currently partitioned and what file systems are on them, look at the /etc/fstab file.

Ø Partitioning an x86 machine
1.     When partitioning an x86 PC, you need to be mindful of the limitations present in the x86 architecture.

2.     You are allowed to create 4 primary partitions, Primary partitions are the only partitions that are bootable.

3.      You can create more partitions if you make logical partitions, Logical partitions are set into a primary partition.

4.     So if you choose to make logical partitions, you are allowed to make only three primary partitions for operating system use, and the fourth partition is dedicated to hosting the logical partitions.

Ø Mounting other OS partitions/slices

1.     Not only can Linux read other operating systems’ file systems, it can also mount disk drives from other systems and work with their partition tables.

2.     However, it is necessary to compile two options into the kernel to do this.

3.     You must have the file system support and the file partitioning support turned on in the kernel.

4.     Usually file system support is compiled as a module by default, but disk partition support usually has to be explicitly compiled.

5.     Some common partitioning schemes that Linux supports are: x86 partitions, BSD disklabel, Solaris x86, Unixware, Alpha, OSF, SGI, and Sun.

6.     Mounting other operating systems’ partitions is helpful if you need to put a Sun hard disk into a Linux machine, for example. You may need to do this if the original Sun system has gone bad, and you need to recover the information that was on its disk, or if it’s the target of a forensic computer crime investigation, and you need to copy the disk contents to another machine to preserve evidence.

7.     This method takes advantage of the fact that copying a large amount of data is much faster across a SCSI connection than across a network.

8.     If you need to copy a large amount of raw disk data across a network, you can use the Network Block Daemon, which enables other machines to mount a disk on your machine as if it were on their machine.

When running the Network Block Daemon,make sure that you have the appropriate partition support compiled into the kernel.

LOGICAL VOLUMES MANAGER

1.     Logical Volume Manager (LVM) enables you to be much more flexible with your disk usage than you can be with conventional old-style file partitions.

2.     Normally if you create a partition, you have to keep the partition at that size indefinitely.

3.     For example, if your system logs have grown immensely, and you’ve run out of room on your /var partition, increasing a partition size without LVM is a big pain. You would have to get another disk drive, create a /var mount point on there too, and copy all your data from the old /var to the new /var disk location.

4.     With LVM in place, you could add another disk, and then assign that disk to be part of the /var partition. Then you’d use the LVM file system resizing tool to increase the file system size to match the new partition size.

5.     Normally you might think of disk drives as independent entities, each containing some data space but when you use LVMs, you need a new way of thinking about disk space.

6.     First you have to understand that space on any disk can be used by any file system. A Volume Group is the term used to describe various disk spaces (either whole disks or parts of disks) that have been grouped together into one volume.

7.     Volume groups are then bunched together to form Logical volumes.

8.     Logical volumes are akin to the historic idea of partitions. You can then use a file system creation tool such as fdisk to create a file system on the logical volume.

9.     The Linux kernel sees a logical volume in the same way it sees a regular partition.

10. Some Linux tools for modifying logical volumes are pvcreate for creating physical volumes, vgcreate for creating volume groups, vgdisplay for showing volume groups, and mke2fs for creating a file system on your logical volume.

Commonly used RAID Structures in Linux
1)   RAID 1 IN SOFTWARE

i)       RAID stands for Redundant Array of Independent Disks. RAID 1, known as disk mirroring, is a redundant RAID disk mode.

ii)    A mirror of the first disk is kept on the other disks.

iii)  If all disks crash but one, all data can still be recovered.

iv)   To work properly, RAID1 needs two or more disks, and zero or more spare disks.




2)   RAID 5 IN SOFTWARE

i)       RAID 5 combines the ability to use a large number of disks while still maintaining some redundancy.

ii)    It uses three or more disks, and spare disks are optional.

iii)   The final RAID 5 array contains the combined file size of all disks except one.

iv)   The equivalent of one disk’s worth of space is taken up by the parity information, which is written evenly across all the disks.

v)     A RAID 5 array can survive one disk loss, but if more than one disk fails, all data is lost.

3)   RAID IN HARDWARE

i)       The principles of the software RAID levels also apply to hardware RAID setups.

ii)    The main difference is that in hardware RAID the disks have their own RAID controller with built-in software that handles the RAID disk setup, and I/O.

iii)  To Linux, the hard RAID interface is transparent, so the hardware RAID disk array looks like one giant disk.

4)   STORAGE AREA NETWORKS

i)       A Storage Area Network (SAN) is a high availability, high performance disk storage structure that enables several systems to store their partitions on the same large disk array.

ii)    A server handles this large disk array and also such things as disk failover and regular information backup.

iii)  This system provides reliable storage and fast access, since the servers are connected to the disk array through a SCSI link or through a fiber channel.

No comments:

Post a Comment