4) Disk Management



DISK MANAGEMENT
___________________________________________________________________________


  • Some location point for diskpart in Linux
                   /dev/sd  for SATA or iSCSI  hardisk.
                   /dev/hd → for IDE harddisk.

 Note: In the last sd/hd , “a, b, c or d” will be written then show hard disk name.


*   a → First device (Primary master)
*   b → Secondry device (Primary master)
*   c → Third device (Secondry master)
*   d → Fourth device (Secondry master)

                                      #  fdisk ɸ -l → show add hardisk.
                      #  reboot or init ɸ 6 → for restart to system.
                      #  partprobe → for update.

 Disk partition action point
     #        fdisk ɸ /dev/sdb

Command action
·         Press “a”  → toggle a bootable flag
·         Press “b”  edit bsd disklabel
·         Press  c” → toggle the dos compatibility flag
·         Press  d” → delete a partition
·         Press “l” → list known partition types
·         Press “m” → print this menu
·         Press “n” → add a new partition
·         Press “o” → create a new empty DOS partition table
·         Press “p” → print the partition table
·         Press “q” → quit without saving changes
·         Press “s” → create a new empty Sun disklabel
·         Press  t” → change a partition's system id
·         Press  u” → change display/entry units
·         Press “v” → verify the partition table
·         Press “w” → write table to disk and exit
·         Press “x” → extra functionality (experts only)

 Format partition
#        mkf.ext +4 ɸ /dev/sdb1 (for  format partition)
#        mkdir ɸ / (directory name)
#        mount ɸ /dev/sdb1/ ɸ (directory name)    (for mounting to partition name) 
#        df ɸ - Th ɸ /(directory name)   (show create new partition)


 Create volume

 Create physical volume
#        pvcreate ɸ /dev/sdb ɸ /dev/sdc ɸ /dev/sdd
#        pvs
#        pvsdisplay

 Create group volume
#        vgcreate ɸ group name ɸ /dev/sdb ɸ /dev/sdc ɸ /dev/sdd
#        vgs
#        vgsdisplay

 Create logical volume
#        lvcreate ɸ -L ɸ +2g ɸ Vg1
#        lvs
#        lvdisplay

Resize volume

  Shrink volume
#        lvreduce ɸ - L ɸ - 1G ɸ /dev/vg1/lvolo
#        lvs
#        lvdisplay

 Extended volume
#        lvextend ɸ - L ɸ +2G ɸ /dev/vg1/lvolo
#        lvs
#        lvdisplay

  Reset root password

·         Restart system

·         Press “Esc” key during boot process.
·         Press “E” to edit the grub file.
·         Search “rhgb ɸ quit” and replace it with “init = /bin/bash”.
·         Press ctrl + X.
·         # mount ɸ - o ɸ remount,rw ɸ /
·         # passwd ɸ root
·         (type new password)
·         # exit


Comments