在國產晶片伺服器(海之舟伺服器+作業系統)上建立軟Raid
本次在海之舟伺服器上建立raid 1,sda+sdb
root@bigdataA:/home/zs# fdisk -l //列出磁碟。
....
Disk /dev/sda: 7.5 GiB, 8069677056 bytes, 15761088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 15761087 15759040 7.5G fd Linux raid autodetect
Disk /dev/md2: 15 GiB, 16128147456 bytes, 31500288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disk /dev/sdb: 7.5 GiB, 8069677056 bytes, 15761088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00018971
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 15761087 15759040 7.5G 7 HPFS/NTFS/exFAT
root@bigdataA:/home/zs#fdisk /dev/sda
Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sda: 7.5 GiB, 8069677056 bytes, 15761088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 15761087 15759040 7.5G fd Linux raid autodetect
Command (m for help): d //刪除分割槽
Selected partition 1
Partition 1 has been deleted.
Command (m for help): n //新建分割槽
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1):
First sector (2048-15761087, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-15761087, default 15761087):
Created a new partition 1 of type 'Linux' and of size 7.5 GiB.
Command (m for help): m
Help:
DOS (MBR)
a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag
Generic
d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)
Script
I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file
Save & Exit
w write table to disk and exit
q quit without saving changes
Create a new label
g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table
Command (m for help): t //改變分割槽屬性為fd
Selected partition 1
Partition type (type L to list all types): fd
Changed type of partition 'Linux' to 'Linux raid autodetect'.
Command (m for help): w //儲存
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
root@bigdataA:/home/zs#
root@bigdataA:/home/zs# fdisk /dev/sdb //對三sdb進行分割槽,詳細略.
....
root@bigdataA:/home/zs# mdadm --create --verbose /dev/md1 -l 1 -n 2 -x 0 /dev/sdb /dev/sda
mdadm: /dev/sda appears to be part of a raid array:
level=raid0 devices=2 ctime=Sat Sep 21 17:24:12 2019
mdadm: partition table exists on /dev/sda but will be lost or
meaningless after creating array
mdadm: /dev/sdb appears to be part of a raid array:
level=raid0 devices=2 ctime=Sat Sep 21 17:24:12 2019
mdadm: partition table exists on /dev/sdb but will be lost or
meaningless after creating array
Continue creating array? y
mdadm: Fail create md1 when using /sys/module/md_mod/parameters/new_array
mdadm: Defaulting to version 1.2 metadata
root@bigdataA:/home/zs# mkfs -t ext4 /dev/md1 //格式化md1
mke2fs 1.43.4 (31-Jan-2017)
/dev/md1 contains a ext4 file system
last mounted on /md2 on Sat Sep 21 22:37:45 2019
Proceed anyway? (y,N) y
Creating filesystem with 3937536 4k blocks and 985424 inodes
Filesystem UUID: 41c965ce-3deb-45fb-be12-c7f29a05e5b3
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information:
done
root@bigdataA:/home/zs#
root@bigdataA:/home/zs# mkdis /md1
root@bigdataA:/home/zs# mkdir md1
root@bigdataA:/home/zs# mdadm -Ds >/etc/mdadm.conf //設定開機自動掛載
root@bigdataA:/home/zs# tail -n 1 /etc/mtab >> /etc/fstab
root@bigdataA:/home/zs#fdisk -l
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 196608 3137535 2940928 1.4G 83 Linux
/dev/mmcblk0p2 3137536 250085375 246947840 117.8G 83 Linux
Disk /dev/sdb: 7.5 GiB, 8069677056 bytes, 15761088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00018971
Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 15761087 15759040 7.5G 7 HPFS/NTFS/exFAT
Disk /dev/sda: 7.5 GiB, 8069677056 bytes, 15761088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 15761087 15759040 7.5G fd Linux raid autodetect
Disk /dev/md1: 7.5 GiB, 8064401408 bytes, 15750784 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@bigdataA:/home/zs#
root@bigdataA:/home/zs# cd /md1
root@bigdataA:/md1# touch aa
root@bigdataA:/md1# ls
aa
......
常用命令:
mdadm -Ds 檢視陣列
mdadm -D /dev/md0 檢視陣列
元件raid時,如顯示mdadm: ddf: Cannot use /dev/sdb1: Device or resource busy,則需先停閉
mdadm -S /dev/md0 停止陣列,停止前,需先執行umount
mdadm -A /dev/md0 /dev/sdb1 /dev/sda1 重新裝配陣列
mdadm /dev/md0 -f /dev/sda1 模擬損壞
mdadm /dev/md0 -r /dev/sda1 移除損壞的磁碟:
mdadm /dev/md0 -a /dev/sda1 新增新的硬碟到已有陣列,時間較長。
root@bigdataA:/home/zs# lsblk //檢視磁碟
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 1 7.5G 0 disk
└─sda1 8:1 1 7.5G 0 part
└─md0 9:0 0 7.5G 0 raid1 /mnt
sdb 8:16 1 7.5G 0 disk
└─sdb1 8:17 1 7.5G 0 part
└─md0 9:0 0 7.5G 0 raid1 /mnt
sdc 8:32 1 7.5G 0 disk
└─sdc1 8:33 1 7.5G 0 part
└─md0 9:0 0 7.5G 0 raid1 /mnt
mmcblk0 179:0 0 119.3G 0 disk
├─mmcblk0p1 179:1 0 1.4G 0 part
└─mmcblk0p2 179:2 0 117.8G 0 part
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23102655/viewspace-2659668/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在國產處理器的伺服器+海之舟大資料作業系統上建立網站伺服器大資料作業系統網站
- 國產處理器伺服器作業系統安裝(海之舟伺服器作業系統安裝說明)伺服器作業系統
- 國產處理器伺服器上搭建mysql(MariaDB)+jsp(java)開發平臺,基於海之舟1.0A作業系統伺服器MySqlJSJava作業系統
- 在伺服器作業系統上使用TeamViewer伺服器作業系統View
- 中興新支點Linux伺服器作業系統與兆芯國產晶片完成相容認證Linux伺服器作業系統晶片
- ,中興新支點國產作業系統釋出伺服器模式作業系統伺服器模式
- 在普通PC上建立Linux作業系統(轉)Linux作業系統
- 伺服器常用的作業系統伺服器作業系統
- 在國產晶片伺服器上構建postgresql-xl的大資料平臺晶片伺服器SQL大資料
- 統信軟體何以登上國產作業系統“鐵王座”?作業系統
- 在Mac上建立SVN伺服器Mac伺服器
- 在銀河麒麟高階伺服器作業系統V10上安裝docker伺服器作業系統Docker
- 國產作業系統學習作業系統
- 在海之舟大資料平臺上搭建mysql+php開發平臺大資料MySqlPHP
- 雲伺服器選什麼作業系統伺服器作業系統
- 美國伺服器,美國伺服器常用的作業系統介紹伺服器作業系統
- 騰訊雲伺服器作業系統——Tencent Linux 伺服器作業系統Linux
- 【知識分享】伺服器作業系統有哪些伺服器作業系統
- 作業系統1—作業系統概論(上)作業系統
- Linux系統中資料盤建立軟RaidLinuxAI
- 在Linux系統中建立SSH伺服器別名Linux伺服器
- 國產作業系統如何追趕windows?作業系統Windows
- 國產作業系統的生態之路作業系統
- 國產作業系統迎來最好時代作業系統
- 在國產處理器伺服器上配置DNS 輪詢伺服器DNS
- 在作業系統上把ORACLE程式刪掉作業系統Oracle
- 雲伺服器裡面的作業系統怎麼選?伺服器作業系統
- 網站伺服器常用的作業系統介紹網站伺服器作業系統
- 常用的8個Linux伺服器作業系統!Linux伺服器作業系統
- 如何選擇阿里云云伺服器ECS作業系統阿里伺服器作業系統
- MySQL伺服器硬體和作業系統優化MySql伺服器作業系統優化
- 企業實踐 | 國產作業系統之光? 銀河麒麟KylinOS-V10(SP3)高階伺服器作業系統基礎安裝篇作業系統伺服器
- 軟體作業系統作業系統
- 雲伺服器管理平臺 雲伺服器作業系統選擇說明伺服器作業系統
- 伺服器資料恢復-RAID資訊丟失導致伺服器作業系統無法啟動的資料恢復案例伺服器資料恢復AI作業系統
- 核心替換國產作業系統是否可行?作業系統
- 在國產處理器伺服器上做HAProxy負載均衡伺服器負載
- 點贊,中興新支點國產作業系統社群即將上線作業系統