ក្រុមការងារយើងខ្ញុំនិងខិតខំសិក្សារស្រាវជ្រាវចំនេះដឹងបន្ថែមទៀតសំរាប់លោកអ្នក សូមអរគុណសំរាប់ការគាំទ្រ !

Linux Disk Management using Standard(fdisk) & LVM

Linux Disk Management using Standard(fdisk) & LVM
Create partition standard ( fdisk )
New HDD :  Blank => FDISK /LVM   =  4 Partition   
=> parition: 
- Primary: OS, Data   , have limit can use 4 partition    => MBR-BIOS
- Extend: Logical partition:  DATA  : can use 126 partition  => GPT-UEFI
=> HDD:  100GB
                 -60GB = Data /dev/sdb1  = first Primary partition
                            #fdisk /dev/sdb
m = help
n  = create new primary partition
p = primary
w = save
                 -40GB = backup /dev/sdb2  = Second Primary partition

1/ use fdisk : 1/ add HDD 1 new in VM
2/ fdisk -l view partiotion => can view HDD is HDD raw (rol) 
- cd /dev  
- ls  
- reboot  sign in
 - cd /dev or ll /dev/sdb
- fdisk  /dev/sdb  
- m
Command (m for help) 
- n     enter
select (defult p) :
- p
- enter
- enter
command (m for help): m
- w
- ls /dev
- view partition : fdisk -l
 បន្ទាប់ពី create parition ហើយមិនអាច copy file ចូលបានទេ​ ត្រូវ format សិន
- mkfs.xfs /dev/sdb1 
- fdisk -l    : view partition ប្រើ sysetm អី ( linux)
- mkdir /mnt/drive1
- mount /dev/sdb1 /mnt/drive1   ( mount drive)
- cd /
- cat > test.txt -> write testing hdd
- cp test.txt /mnt/drive1/
- ll /mnt/drive1/
view sdb HDD និងមាន Partition ប៉ុន្មាន ?
- fdisk -l /dev/sdb
========================================================================
Create partition LVM

1/ add new disk ( add disk new in VMware ) 
pvcreate /dev/sdc 
yum -y -t install lvm*   ( if os centos don't have lvm need install it )
yum list installed | grep lvm 
yum -y install lvm2.x86_64
1/ pvcreate /dev/sdc    ( Create physical volume )
2/ vgcreate ABC /dev/sdc   ( create volume group )
3/lvcreate -L 5G -n lv1_disk1 ABC  ( create logical volume ABC is name volume group ) )
 lvcreate -L 10G -n lv2_disk2 ABC
- ls /dev
- cd /dev/ABC
- ll

4/ mkfs.xfs /dev/ABC/lv1_disk1   ( format volume with file system )
  mkfs.xfs /dev/ABC/lv2_disk2
- mkdir /mnt/lvm_disk1     ( create drive mount )
- mkdir /mnt/lvm_disk2
5/ mount /dev/ABC/lv1_disk1 /mnt/lvm_disk1 ( Mount volume to directory ) 
-  mount /dev/ABC/lv2_disk2 /mnt/lvm_disk2
-  cd /mnt/lvm_disk1
-  ll
-  cat > file.txt
  testing lvm ( ctrl+D = save )
- ll
==================================================================
View Videos : link 


EmoticonEmoticon