Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Wednesday 30 August 2017

Disk Management Concept on Linux (Redhat or CentOS 6)


View All Existing Disk Partitions Using fdisk -l

Before you create a new partition, or modify an existing partition, you might want to view all available partition in the system.

Use fdisk -l to view all available partitions as shown below.
  device info will present under /dev

     ide ------------------   /dev/had

    sata------------------   /dev/sda

For Creating a Partition

[root@bsrtech sysusers]# fdisk   /dev/sda

Options:- 
     m – To get  the help
     p  -  To print the partition table
     n  -  To create a Partition
     d – To delete a   Partition
     w  -  To save the modification
     q  - To quit without save
     n : for new partition

(if we want to create a new primary partition already existing primary partitions will be deleted.
so we will go for logical partitions)
     l : logical
(we can't able to specify space in inodes )
press enter
(provide size of partition)
+200M(here our partition size is 200 mb)
   w: to save partition and write to partition table

partx: is the command to update kernel with out reboot.
  (partx -a /dev/sda)

To format a partition ( linux file system is ext4)
    mkfs.ext4 /dev/
       ex: mkfs.ext4 /dev/sda5

df  -Th : is the command to view mounted partitions along with mount points & free space

Mounting : 

           mounting is a process to create a logical way to enter a partition
mkdir /redhat (mount point for drive)

mount :is the command use to view mounted partitions & to create mounting.

syntax: mount

ex: mount /dev/sda5   /redhat

umount : is the command to clear mounting way.

    syntax: umount < mountpoint>

    ex: umount /redhat

To mount a partiton permanently, we have to edit configuration file
   /etc/fstab

# vi /etc/fstab
add a line at the end

       
  
  fsck: filesystem consistency check
  if fsck is 1 1 only root can access
  if fsck is 1 2 any body can access
  if fsck is 0 0 only system can access

ex:

       /dev/sda5      /redhat          ext4              defaults                  1  2
         |                          |                    |                     |                      |
         |                          |                    |                     |                      |
     partition    mountpoint   file system    permissions             fsck

No comments:

Post a Comment