国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

linux磁盤管理軟RAID的實現原理分析和方法分享

2024-08-28 00:03:46
字體:
來源:轉載
供稿:網友

1 什么是RAID

RAID全稱是獨立磁盤冗余陣列(Redundant Array of Independent Disks),基本思想是把多個磁盤組合起來,組合一個磁盤陣列組,使得性能大幅提高。

RAID分為幾個不同的等級,各個不同的等級均在數據可靠性及讀寫性能做了不同的權衡。實際工作中根據自己的業務需求選擇不同的RAID方案。

2 RAID的實現方式

外接式磁盤陣列:通過擴展卡提供適配能力內接式RAID:主板集成RAID控制器安裝OS前在BIOS里配置軟件RAID:通過OS實現

3 標準的RAID

3.1 RAID0

RAID0稱為條帶化存儲,將數據分段存儲在各個磁盤中,讀寫均可以并行處理,因此讀寫速率為單個磁盤的N倍,沒有冗余功能,任何一個磁盤的損壞就會導致的數據不可用。

3.2 RAID1

RADI1是鏡像存儲,沒有數據校驗,數據被同等的寫入到2個或者多個磁盤中,寫入速度相對慢, 但是讀取速度比較快。

3.3 RAID 4

RADI4在RAID1的基礎上,N個盤用于數據存儲,另外加入了1個磁盤作為校驗盤。一共N+1個盤,任何一個盤壞掉也不影響數據的訪問

3.4 RAID 5

RAID5在RAID4的基礎上,由原來的一個盤來存儲校驗數據,改為每個盤都有數據和校驗信息的。

4 混合RAID

4.1 RAID01

先組成RAID0,然后組成RAID1.

4.2 RAID10

先組成RAID1,然后組成RAID0

5 軟RAID的實現

5.1 RAID5的實現

創建由三塊硬盤組成的可用空間為2G的RAID5設備,要求其chunk大小為256k,文件系統為ext4,開機可自動掛載至/mydata目錄

5.1.1 先看看我們的磁盤情況

[root@centos7 Bash]$ lsblkNAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTsda 8:0 0 200G 0 disk ├─sda1 8:1 0 1G 0 part /boot├─sda2 8:2 0 128G 0 part ├─sda3 8:3 0 48.8G 0 part /├─sda4 8:4 0 512B 0 part └─sda5 8:5 0 19.5G 0 part /appsdb 8:16 0 100G 0 disk sdc 8:32 0 20G 0 disk sdd 8:48 0 20G 0 disk sde 8:64 0 20G 0 disk sdf 8:80 0 20G 0 disk sr0 11:0 1 8.1G 0 rom /run/media/root/CentOS 7 x86_64 

這里我們使用sdb,sdc,sdd,每個盤創建一個主分區1G,構建RADI5.

5.1.2 根據實際情況分區

[root@centos7 Bash]$ fdisk /dev/sdbWelcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0x93d380cf.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): First sector (2048-209715199, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-209715199, default 209715199): +1GPartition 1 of type Linux and of size 1 GiB is setCommand (m for help): tSelected partition 1Hex code (type L to list all codes): fdChanged type of partition 'Linux' to 'Linux raid autodetect'Command (m for help): pDisk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x93d380cf Device Boot Start  End Blocks Id System/dev/sdb1  2048 2099199 1048576 fd Linux raid autodetectCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.[root@centos7 Bash]$ fdisk /dev/sdcWelcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0xc56b90d8.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): First sector (2048-41943039, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +1GPartition 1 of type Linux and of size 1 GiB is setCommand (m for help): tSelected partition 1Hex code (type L to list all codes): fdChanged type of partition 'Linux' to 'Linux raid autodetect'Command (m for help): pDisk /dev/sdc: 21.5 GB, 21474836480 bytes, 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0xc56b90d8 Device Boot Start  End Blocks Id System/dev/sdc1  2048 2099199 1048576 fd Linux raid autodetectCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.[root@centos7 Bash]$ fdisk /dev/sddWelcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.Be careful before using the write command.Device does not contain a recognized partition tableBuilding a new DOS disklabel with disk identifier 0x7e0900d8.Command (m for help): nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): pPartition number (1-4, default 1): First sector (2048-41943039, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +1GPartition 1 of type Linux and of size 1 GiB is setCommand (m for help): pDisk /dev/sdd: 21.5 GB, 21474836480 bytes, 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x7e0900d8 Device Boot Start  End Blocks Id System/dev/sdd1  2048 2099199 1048576 83 LinuxCommand (m for help): tSelected partition 1Hex code (type L to list all codes): fdChanged type of partition 'Linux' to 'Linux raid autodetect'Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 丽水市| 桂林市| 乐安县| 上饶县| 梅河口市| 宜阳县| 塔城市| 乌审旗| 陕西省| 成都市| 乌苏市| 修水县| 泽普县| 收藏| 辽中县| 汽车| 曲周县| 综艺| 灌云县| 镇赉县| 竹山县| 竹北市| 弋阳县| 钟祥市| 弥勒县| 尖扎县| 鸡东县| 萝北县| 肥东县| 泌阳县| 永昌县| 梁河县| 金沙县| 札达县| 通海县| 北安市| 石台县| 云梦县| 淄博市| 阜南县| 普洱|