![mdadm命令詳解及實(shí)驗(yàn)過程_第1頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/10/df47997b-9923-4965-ab07-42c864874bbc/df47997b-9923-4965-ab07-42c864874bbc1.gif)
![mdadm命令詳解及實(shí)驗(yàn)過程_第2頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/10/df47997b-9923-4965-ab07-42c864874bbc/df47997b-9923-4965-ab07-42c864874bbc2.gif)
![mdadm命令詳解及實(shí)驗(yàn)過程_第3頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/10/df47997b-9923-4965-ab07-42c864874bbc/df47997b-9923-4965-ab07-42c864874bbc3.gif)
![mdadm命令詳解及實(shí)驗(yàn)過程_第4頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/10/df47997b-9923-4965-ab07-42c864874bbc/df47997b-9923-4965-ab07-42c864874bbc4.gif)
![mdadm命令詳解及實(shí)驗(yàn)過程_第5頁](http://file2.renrendoc.com/fileroot_temp3/2021-11/10/df47997b-9923-4965-ab07-42c864874bbc/df47997b-9923-4965-ab07-42c864874bbc5.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、mdadm命令詳解及實(shí)驗(yàn)過程款標(biāo)準(zhǔn)的軟件raid管理工具”作者是neil brownmdadm 是 multiple devices admin 的簡稱 z 它是 linux 下的二特點(diǎn)mdadm能夠診斷、監(jiān)控和收集詳細(xì)的陣列信息mdadm是一個單獨(dú)集成化的程序而不是一些分散程序的集合,因此對不同raid管理翁令有共通的語法mdadm能夠執(zhí)行幾乎所有的功能而不需要配置文件(也沒有默認(rèn)的配置文件)三作用(引用)在linux系統(tǒng)中目前以md(multiple devices)虛擬塊設(shè)備的方式實(shí)現(xiàn)軟件raid利用多個底層的塊設(shè)備虛擬岀一個新的虛擬設(shè)備,并且利用條帶化(stripping)技術(shù)將數(shù)據(jù)塊
2、均勻分布到多個磁盤上來提高虛擬設(shè)備的讀寫性能,利用不同的數(shù)據(jù)冗祭算法來保護(hù)用戶數(shù) 據(jù)不會因?yàn)槟硞€塊設(shè)備的故障而完全丟失,而且還能在設(shè)備被替換后將丟失的數(shù)據(jù)恢復(fù)到新的設(shè)備上.目前 md 支持 iinearlmultipath/raid0(stripping)/raidl(mirror)/raid4/raid5/raid6/raidl0 等不同的冗余級別和級成方式,當(dāng)然也能支持多個raid陳歹啲層疊組成raidl ozraid5 1等類型的陳列四實(shí)驗(yàn)試題:建立4個大小為1g的磁盤,并將其中3個創(chuàng)建為raid5的陣列磁盤,1個為熱備份磁盤。測試熱備份磁盤替換陣列中的磁 盤并同步數(shù)據(jù)。移除損壞的磁盤,
3、添加一個新磁盤作為熱備份磁盤。最后要求開機(jī)自動掛載。4.1創(chuàng)建磁盤rootxiao # fdisk /dev/sdawarning: dos-compatible mode is deprecated. it's strongly recommended toswitch off the mode (command 'c') and change display units to sectors (command u).comma nd (m for help): nfirst cylinder (10486-13054, default 10486):using de
4、fault value 10486last cylinder, + cylinders or +sizek,m/g (10486-13054, default 13054): +1gcommand (m for help): nfirst cylinder (10618-13054, default 10618):using default value 10618last cylinder, + cylinders or +sizekzmzg (10618-13054, default 13054): +1gcommand (m for help): nfirst cylinder (1075
5、0-13054, default 10750):using default value 10750last cylinder, + cylinders or +sizek,m/g (10750-13054, default 13054): +1gcomma nd (m for help): nfirst cylinder (10882-13054, default 10882):using default value 10882last cylinder, + cylinders or +sizek,m/g (10882-13054, default 13054): +1gcommand (m
6、 for help): tpartition number (1-8): 8hex code (type l to list codes): fdchanged system type of partition 8 to fd (linux raid autodetect)command (m for help): tpartition number 7hex code (type l to list codes): fdchanged system type of partition 7 to fd (linux raid autodetect)comma nd (m for help):
7、tpartition number 6hex code (type l to list codes): fdchanged system type of partition 6 to fd (linux raid autodetect)command (m for help): tpartition number 5hex code (type l to list codes): fdchanged system type of partition 5 to fd (linux raid autodetect)command (m for help): pdisk /dev/sda: 107.
8、4 gbz 107374182400 bytes255 heads, 63 sectors/track, 13054 cylindersunits = cylinders of 16065 * 512 = 8225280 bytessector size (logical/physical): 512 bytes / 512 bytesi/o size (minimum/optimal): 512 bytes / 512 bytesdisk identifier: 0x0008ed57device bootstartendblocks idsystem/dev/sdal *126204800
9、83linuxpartition 1 does not endon cylinder boundary./dev/sda2261022581920000 83 1linux/dev/sda31022510486209715282linux swap / solaris/dev/sda41048613054206332795exte nded/dev/sda510486106171058045fdlinux raid autodetect/dev/sda610618107491060258+fdlinux raid autodetect/dev/sda710750108811060258+fdl
10、inux raid autodetect/dev/sda810882110131060258+fdlinux raid autodetectcomma nd (m for help): wthe partition table has been altered!calling ioctl() to re-read partition table.warning: re-reading the partition table failed with error 16 the kernel still uses the old table. the new table will be used t
11、he next reboot or after you run partprobe(8) or kpartx(8) syncing disks.4.2加載內(nèi)核rootxiao # partx/dev/sda5 /dev/sdarootxiao # partx/dev/sda6 /dev/sdai:設(shè)備或資源忙.atrootxiao # partx -a /dev/sda7 /dev/sdarootxiao # partx -a /dev/sda8 /dev/sda43創(chuàng)建raid5及其熱備份盤rootxiao # mdadm -c /dev/mdo -i 5 -n 3 -x 1 /dev/sd
12、a567,8mdadm: /dev/sda5 appears to be part of a raid array:ievel = raid5 devices=3 ctime=wed dec 17 00:58:24 2014mdadm: /dev/sda6 appears to be part of a raid array:ievel = raid5 devices=3 ctime=wed dec 17 00:58:24 2014mdadm: /dev/sda7 appears to be part of a raid array:ievel=raid5 devices=3 ctime=we
13、d dec 17 00:58:24 2014mdadm: /dev/sda8 appears to be part of a raid array:ievel = raid5 devices=3 ctime=wed dec 17 00:58:24 2014continue creating array? ymdadm: default!ng to version 1.2 metadatamdadm: array /dev/mdo started.4.4初始化時間和磁盤陣列的讀寫的應(yīng)用相關(guān),使用cat /proc/mdstat信息查詢raid陣列當(dāng)前重構(gòu)的速度和預(yù)期的完成時間。rootxiao
14、# cat /proc/mdstatpersonalities : raidl raido raid6 raid5 raid4mdo : active raid5 sda74 sda83(s) sda6l sda502113536 blocks super 1.2 level 5, 512k chunk, algorithm 2 3/2 uu二二二二二二二二二recovery 二 45.5% (482048/1056768) finish=0.3min speed = 30128k/sec unused devices: <none> rootxiao # cat /proc/md
15、statpersonalities : raidl raido raid6 raid5 raid4mdo : active raid5 sda74 sda8(s) sda6l sda5o2113536 blocks super 1.2 level 5, 512k chunk, algorithm 2 3/3 uuuunused devices: <none>4.5 掛載 raid 到/mnt錄下,并查看是否正常(顯示lost+found為正常)rootxiao # mount /dev/mdo /mntrootxiao # is /rrint lost+fo und4.6查看rai
16、d陣列的詳細(xì)信息 rootxiao # mdadm d /dev/mdo/dev/mdo:version : 1.2creation time : wed dec 17 03:38:08 2014raid level: raid5array size : 2113536 (2.02 gib 2.16 gb)used dev size : 1056768 (1032.17 mib 1082.13 mb)raid devices : 3total devices : 4persistenee : superblock is persistentupdate time : wed dec 17 03
17、:55:11 2014state : cleanactive devices : 3working devices : 4failed devices : 0spare devices : 1layout: left-symmetricchunk size : 512kname : xiao:0 (local to host xiao)uuid : bcell0f2:34f3fbfl:8de472ed:633a374fevents:18numbermajorminorraiddevice state0850active sync/dev/sda51861active sync/dev/sda6
18、4872active sync/dev/sda7388spare /dev/sda84.7模擬損壞其中的_個磁盤,這里我選擇/dev/sda6磁盤rootxiao # mdadm /dev/mdo -fail /dev/sda6mdadm: set /dev/sda6 faulty in /dev/mdo 4.7查看raid陣列詳細(xì)信息,發(fā)i®/dev/sda8自動替換了損壞m/dev/sda6磁盤。rootxiao # mdadm -d /dev/mdo /dev/mdo:version : 1.2creation time : wed dec 17 03:38:08 2014ra
19、id level : raidsarray size : 2113536 (2.02 gib 2.16 gb)used dev size : 1056768 (1032.17 mib 1082.13 mb)raid devices : 3total devices : 4persistenee : superblock is persistentupdate time : wed dec 17 04:13:59 2014state : clean, degraded, recoveringactive devices : 2working devices : 3failed devices :
20、 1spare devices : 1layout: left-symmetricchunk size : 512krebuild status : 43% completename : xiao:0 (local to host xiao)uuid : bcell0f2:34f3fbfl:8de472ed:633a374fevents : 26number major minor raiddevice state0 active sync /dev/sda51 spare rebuilding /dev/sda872 active sync /dev/sda718 6faulty /dev/
21、sda6rootxiao # cat /proc/mdstatpersonalities : raidl raido raid6 raid5 raid4 mdo : active raid5 sda74 sda83 sda6l(f) sda502113536 blocks super 1.2 level 5, 512k chunk, algorithm 2 3/3 uuu#正常的情況會是uuu,若第個磁7盤損壞則顯示4.8移除損壞的硬盤 rootxiao # mdadm /dev/mdo -r/dev/sda6 mdadm: hot removed /dev/sda6 from /dev/md
22、o4.9添加一個新硬盤作為熱備份盤 rootxiao -# fdisk /dev/sdawarning: dos-compatible mode is deprecated. ifs strongly recommended to switch off the mode (command 'c') and change display units to sectors (command u).comma nd (m for help): nfirst cylinder (11014-13054, default 11014):using default value 11014l
23、ast cylinder, + cylinders or +sizek,mzg (11014-13054, default 13054): +1gcommand (m for help): tpartition number (1-9): 9hex code (type l to list codes): fdchanged system type of partition 9 to fd (linux raid autodetect)command (m for help): pdisk /dev/sda: 107.4 gbz 107374182400 bytes255 heads, 63
24、sectors/track, 13054 cylindersunits = cylinders of 16065 * 512 = 8225280 bytessector size (logical/physical): 512 bytes / 512 bytesi/o size (minimum/optimal): 512 bytes / 512 bytesdisk identifier: 0x0008ed57device boot start end blocks id system/dev/sdal *126204800 83 linuxpartition 1 does not end o
25、n cylinder boundary./dev/sda31022510486209715282linux swap / solaris/dev/sda41048613054206332795extended/dev/sda510486106171058045fdlinux raid autodetect/dev/sda610618107491060258+fdlinux raid autodetect/dev/sda710750108811060258+fdlinux raid autodetect/dev/sda810882110131060258+fdlinux raid autodet
26、ect/dev/sda9110141114510602584-fdlinux raid autodetect/dev/sda2261022581920000 83 linuxcommand (m for help): wthe partition table has been altered!calling ioctlq to re-read partition table.warning: re-reading the partition table failed with error 16 the kernel still uses the old table. the new table
27、 will be used the next reboot or after you run partprobe(8) or kpartx(8) syncing disks.rootxiao # partx -a /dev/sda9 /dev/sdarootxiao # mdadm /dev/mdo add /dev/sda9 mdadm: added /dev/sda9rootxiao # mdadm -d /dev/mdo/dev/mdo:version : 1.2creation time : wed dec 17 03:38:08 2014i:設(shè)備或資源忙.atraid level:
28、raid5array size : 2113536 (2.02 gib 2.16 gb)used dev size : 1056768 (1032.17 mib 1082.13 mb)raid devices : 3total devices : 4persistenee : superblock is persistentupdate time : wed dec 17 04:39:35 2014state : cleanactive devices : 3working devices : 4failed devices : 0spare devices : 1layout: left-s
29、ymmetricchunk size : 512kname : xiao:0 (local to host xiao)uuid: bcell0f2:34f3fbfl:8de472ed:633a374fevents : 41numbermajorminorraiddevice state0850active sync/dev/sda53881active sync/dev/sda84872active sync/dev/sda7589spare /dev/sda95開機(jī)自動掛閨b®、etc、fsab 第'dev'mdoext3 defau-ts 0 0 wq6mdadm
30、&><manuu-迪)w-fimmi mdadm3ode 二 optionsmode 一47 罟assemb_e -bui-d - bui-d a -egacy array、a->desce 那血 superbockscreate -些腳->03科5=ah>desce»asuperbocksmanage :管理陣歹i,比如add或removemisc :允許單獨(dú)對陣列中的某個device做操作,比如抹去superblocks或 終止在用的陣列。follow or monitor:監(jiān)控 raid 145,6 和 multipath 的狀態(tài)grow :改變raid容量或陣列中的device數(shù)目可用的options:-az -assemble :加入一個以前定義的陣列b,build : build a legacy array without superblocks.c, -create :創(chuàng)建個新的陣列q query :查看一個device ,判斷它為一個md device或是一個md陣列的一咅0分d, detail :打印一個或多個md device的詳細(xì)信息-ez examine :打印 device 上的 md superblock 的內(nèi)容-f, foll
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025車輛抵債合同書
- 2025煉化工程建設(shè)總承包合同
- 2025油漆工程承包合同
- 2024-2025學(xué)年新教材高中語文 第七單元 16.2 登泰山記說課稿(1)部編版必修上冊
- 2024-2025學(xué)年高中地理 第1章 旅游和旅游資源 第2節(jié) 旅游資源的類型說課稿 中圖版選修3
- 二手房交易時合同范例
- 飲料公司組建方案
- 《 負(fù)數(shù)》(說課稿)-2023-2024學(xué)年六年級下冊數(shù)學(xué)人教版
- 石材礦山起料方案
- 鑄造企業(yè)整治方案制定
- 油氣儲運(yùn)節(jié)能優(yōu)化方案
- 物流公司員工守則以及管理制度
- 2024人形機(jī)器人產(chǎn)業(yè)半年研究報告
- 購買演唱會門票的合同模板
- 【基于現(xiàn)金流的企業(yè)財(cái)務(wù)風(fēng)險探究文獻(xiàn)綜述4100字】
- 燃燒爆炸理論及應(yīng)用 課件 第1-3章 緒論、燃燒及其災(zāi)害、物質(zhì)的燃燒
- 事業(yè)單位網(wǎng)絡(luò)安全知識培訓(xùn)
- 2024年山東省第三屆中小學(xué)生海洋知識競賽試題及答案(初中組)
- 克羅恩病肛瘺診斷和治療
- 2024年山東省春季高考技能考試汽車專業(yè)試題庫-上(單選題匯總)
- 《活著》讀書分享課件
評論
0/150
提交評論