Cov txheej txheem:

Yuav Ua Li Cas Raid-1 Cia: 9 Kauj Ruam
Yuav Ua Li Cas Raid-1 Cia: 9 Kauj Ruam

Video: Yuav Ua Li Cas Raid-1 Cia: 9 Kauj Ruam

Video: Yuav Ua Li Cas Raid-1 Cia: 9 Kauj Ruam
Video: Sib Hawm Dhau (Time Passed) Music Video by: Deeda/Dib Xwb 2024, Kaum ib hlis
Anonim
Yuav Ua Li Cas Raid-1 Cia
Yuav Ua Li Cas Raid-1 Cia

Dab tsi yog RAID1 hauv cov lus yooj yim nws

: Disk mirroring. Qhov ua tau zoo tshaj plaws rau Redundancy thiab xav tau tus lej tsawg kawg ntawm 2 tsav

Dab tsi yog RAID1 hauv cov ntsiab lus nyuaj nws

: Nws suav nrog daim ntawv theej (lossis daim iav) ntawm cov ntaub ntawv ntawm ob lossis ntau daim disk; classic RAID 1 tsom iav khub muaj ob daim disk. Qhov kev teeb tsa no tsis muaj qhov sib npaug, kab txaij, lossis nthuav dav ntawm thaj chaw disk hla ntau lub disks, txij li cov ntaub ntawv tau nthuav tawm ntawm txhua lub disks uas yog ntawm pawg, thiab cov kab tuaj yeem tsuas yog loj li cov tswv cuab me tshaj plaws. Cov txheej txheem no muaj txiaj ntsig zoo thaum nyeem kev ua tau zoo lossis ntseeg tau yog qhov tseem ceeb tshaj li kev sau ntawv ua tiav lossis cov txiaj ntsig khaws cia cov ntaub ntawv.

(Wikipedia piav qhia qhov no zoo heev)

Dab tsi yog qhov zoo thiab dab tsi nws txaus ntshai ntawm

Kev ua tau zoo heev; Kev tiv thaiv cov ntaub ntawv siab heev; Kev nplua tsawg heev ntawm kev sau ntawv.

Tsis muaj zog: Cov nqi rov ua dua tshiab ntau dua qub; Vim tias txhua cov ntaub ntawv raug theej, yuav tsum muaj peev xwm khaws tau ob zaug.

Koj yuav xav tau dab tsi

Yam tsawg kawg 2 USB sticks lossis hard drive koj tuaj yeem ntxiv ntau ntxiv los ntawm kev siv 4, 6 thiab 8

Txhua tus lej yog Italic

Kauj Ruam 1: Txhim Kho Mdadm

Txhim kho Mdadm
Txhim kho Mdadm

Thawj qhov: Koj yuav tsum tau txais RAID software. Koj yuav tsum rub tawm thiab teeb tsa mdadm los ntawm koj lub software repository. Nws zoo nkauj heev, yog li qhib lub davhlau ya nyob twg thiab ntaus cov lus txib hauv qab no:

sudo apt-tau nruab mdadm

Kauj Ruam 2: Txheeb Xyuas Peb Cov Disk Drives

peb yuav tsum tshuaj xyuas peb lub disk seb puas muaj twb tau tsim kho lawm.

Siv cov lus txib hauv qab no:

mdadm -E /dev /sd [b -c]

Kauj Ruam 3: Tsav faib rau RAID

Tsav faib rau RAID
Tsav faib rau RAID
Tsav faib rau RAID
Tsav faib rau RAID

peb siv tsawg kawg ob ntu /dev /sdc1 thiab /dev /sdb1 rau kev tsim RAID1. Cia peb tsim kev faib tawm ntawm ob lub zog siv 'fdisk' hais kom ua thiab hloov hom mus rau kev tua thaum lub sijhawm muab faib.

Siv cov lus txib no

fdisk /dev /sdc1

ces ua raws cov lus qhia no

  1. Nias 'n' txhawm rau tsim kev faib tshiab.
  2. Tom qab ntawv xaiv 'P' rau Thawj qhov muab faib. Tom ntej no xaiv tus lej faib ua 1.
  3. Muab lub neej ntawd puv loj los tsuas yog nias ob zaug Nkag mus.
  4. Tom ntej no nyem 'p' txhawm rau luam tawm qhov faib faib.
  5. Nias 'L' txhawm rau teev txhua hom muaj.
  6. Ntaus 't' los xaiv cov faib.
  7. Xaiv 'fd' rau Linux tua pib thiab nias Enter kom thov.
  8. Tom qab ntawd siv dua 'p' los luam qhov kev hloov pauv uas peb tau ua.
  9. Siv 'w' los sau cov kev hloov pauv.

Tam sim no peb tab tom yuav zoo ib yam rau sdb1

fdisk /dev /sdb1

Yog li ua raws cov kauj ruam tseeb ib yam li sdc1

Kauj Ruam 4: Txheeb Xyuas Kev Hloov

Txheeb xyuas qhov hloov pauv
Txheeb xyuas qhov hloov pauv
Txheeb xyuas qhov hloov pauv
Txheeb xyuas qhov hloov pauv

Thaum ob qho kev faib tawm tau ua tiav, txheeb xyuas qhov kev hloov pauv ntawm ob qho sdb & sdc usb tsav siv tib 'mdadm' hais kom ua thiab nws tseem yuav lees paub RAID hom

Siv cov lus txib:

mdadm -E /dev /sd [b -c]

peb tuaj yeem siv tib lo lus txib tab sis ntxiv ib qho kawg

mdadm -E /dev /sd [b -c] 1

Kauj Ruam 5: Tsim RAID1 Devices

Tsim RAID1 Devices
Tsim RAID1 Devices
Tsim RAID1 Devices
Tsim RAID1 Devices
Tsim RAID1 Devices
Tsim RAID1 Devices
Tsim RAID1 Devices
Tsim RAID1 Devices

Tom ntej tsim RAID1 Ntaus hu ua '/dev/md0' lossis koj tuaj yeem siv '/dev/md127' siv cov lus txib hauv qab no thiab ua raws nws.

mdadm --create /dev /md0-qib = daim iav-ntshai-khoom = 2 /dev /sd [b-c] 1

miv /proc /mdstat

los yog

mdadm --create /dev /md127-qib = daim iav-ntshai-khoom = 2 /dev /sd [b-c] 1

miv /proc /mdstat

Tom ntej no txheeb xyuas cov cuab yeej tua phom hom thiab tua kab siv cov lus txib hauv qab no.

mdadm -E /dev /sd [b -c] 1

mdadm --detail /dev /md0 LOS YOG mdadm --detail /dev /md127

Los ntawm cov duab saum toj no, koj yuav tsum tau txais ntau dua lossis tsawg dua nkag siab tias raid1 tau tsim thiab siv /dev /sdb1 thiab /dev /sdc1 faib thiab koj tseem tuaj yeem pom cov xwm txheej zoo li rov ua dua. Via cov

mdadm --detail /dev /md0 lossis mdadm --detail /dev /md127 hais kom ua

Kauj Ruam 6: Tsim Cov Ntaub Ntawv Txheej Txheem ntawm RAID Device

Tsim Cov Ntaub Ntawv Txheej Txheem ntawm RAID Device
Tsim Cov Ntaub Ntawv Txheej Txheem ntawm RAID Device
Tsim Cov Ntaub Ntawv Txheej Txheem ntawm RAID Device
Tsim Cov Ntaub Ntawv Txheej Txheem ntawm RAID Device
Tsim Cov Ntaub Ntawv Txheej Txheem ntawm RAID Device
Tsim Cov Ntaub Ntawv Txheej Txheem ntawm RAID Device

Tsim cov ntaub ntawv kaw lus siv ext4 rau md0 lossis md127 thiab teeb tsa hauv qab /mnt /raid1. Cov kauj ruam no tseem ceeb.

Siv qhov hais kom ua

mkfs.ext4 /dev /md0 lossis mkfs.ext4 /dev /md127

Tom ntej no, teeb tsa cov txheej txheem tsim tshiab hauv qab '/mnt/raid1' thiab tsim qee cov ntaub ntawv thiab txheeb xyuas cov ntsiab lus hauv qab taw tes.

Siv cov lus txib no

mkdir /mnt /raid1

mount/dev/md0/mnt/raid1/

kov /mnt/raid1/tecmint.txt

ncha "tecmint raid teeb tsa"> /mnt/raid1/tecmint.txt

miv /mnt/raid1/tecmint.txt

miv proc/mdstat

Yog li txhawm rau kom pib-nce RAID1 ntawm lub kaw lus rov ua haujlwm, koj yuav tsum nkag mus rau hauv fstab cov ntaub ntawv. Qhib '/etc/fstab' cov ntawv thiab ntxiv cov hauv qab no

/dev/md0/mnt/raid1 ext4 defaults 0 0

nco ntsoov khiav

Khiav 'mount -av' kom pom tias muaj qhov ua yuam kev hauv fstab cov ntaub ntawv txawm hais tias yog cov kauj ruam ua raws tsis muaj qhov ua yuam kev yuav tshwm sim.

Tam sim no cia, txuag kev teeb tsa tua tus kheej rau 'mdadm.conf' cov ntaub ntawv siv cov lus txib hauv qab no.

mdadm --detail -scan --verbose >> /etc/mdadm.conf

Kauj Ruam 7: Txheeb Xyuas Cov Ntaub Ntawv Tom Qab Disk Tsis Ua Haujlwm

Tshawb xyuas cov ntaub ntawv tom qab Disk ua tsis tiav
Tshawb xyuas cov ntaub ntawv tom qab Disk ua tsis tiav
Tshawb xyuas cov ntaub ntawv tom qab Disk ua tsis tiav
Tshawb xyuas cov ntaub ntawv tom qab Disk ua tsis tiav
Tshawb xyuas cov ntaub ntawv tom qab Disk ua tsis tiav
Tshawb xyuas cov ntaub ntawv tom qab Disk ua tsis tiav
Tshawb xyuas cov ntaub ntawv tom qab Disk tsis ua
Tshawb xyuas cov ntaub ntawv tom qab Disk tsis ua

Lub hom phiaj ntawm RAID yog tias ib qho ntawm cov hard disk tsis ua lossis poob peb cov ntaub ntawv xav tau kom muaj. Cia saib dab tsi yuav tshwm sim thaum ib qho ntawm daim disk tsis muaj nyob hauv kab.

peb tuaj yeem pom muaj 2 lub cuab yeej muaj nyob hauv peb RAID thiab Cov Khoom Siv Ua Haujlwm yog 2. Yog li tam sim no tshem tawm ib qho ntawm koj lub zog tsav

ls -l /dev | grep sd ua

mdadm --detail /dev /md0

Peb tuaj yeem pom tias ib qho ntawm peb cov neeg tsav tsheb poob lawm yog li tam sim no cia saib ntawm peb cov ntaub ntawv.

Siv thease txib

cd/mnt/raid1/

miv tecmint.txt

…………………………………..

Puas yog Cov Ntaub Ntawv tseem yuav muaj thiab muaj rau peb txawm tias peb tau coj ib tus tsav tsheb tawm qhov no yog qhov zoo ntawm RAID 1 (daim iav)

Kauj ruam 8: Hais kom ua Index

fdisk: yog cov kab hais kom ua siv hluav taws xob uas muab cov haujlwm faib ua disk.

miv: yog tus txheej txheem Unix kev siv hluav taws xob uas nyeem cov ntawv ua ntu zus, sau lawv mus rau cov qauv tsim tawm.

mount: hais kom ua cov khoom ntim khoom lossis cov ntaub ntawv, ua kom nws nkag tau yooj yim thiab txuas nws mus rau cov npe txheej txheem uas twb muaj lawm.

mkdir: yog siv los ua cov npe tshiab.

kov: yog cov lus txib siv los hloov kho hnub nkag thiab/lossis hloov kho hnub ntawm lub computer cov ntaub ntawv lossis cov npe.

ncha yog cov lus txib uas tso tawm cov hlua nws tau dhau los ua kev sib cav. Nws yog cov lus txib feem ntau siv hauv cov ntawv sau hauv plhaub thiab cov ntaub ntawv cais tawm rau cov ntawv nyeem cov xwm txheej mus rau lub vijtsam lossis cov ntaub ntawv khoos phis tawj, lossis ua ib feem ntawm cov raj xa dej.

Kauj Ruam 9: Tsis Muaj Kauj Ruam Ntxiv

Yog tias koj tau ua qhov kev zoo siab tam sim no vim qhov no coj kuv tag nrho yav tav su kom ua tiav kuv yuav tsum ua qhov no ob zaug muaj tag nrho kuv cov screenshots qhov twg tsis ncaj, Vam tias kuv tuaj yeem pab nrog kev nyuaj ntawm RAID1

Pom zoo: