raid

磁盘操作

=========================

要求:8块裸盘,按要求处理

1. 两块做单盘raid 0

2. 两块做raid 1

3. 剩下的做 raid 10

4. 大盘分成两个分区,使用gpt分区表

5. 磁盘挂载到目录,重启自动挂载

6. 文件系统,一个ext3,一个xfs,剩下的全部ext4

步骤:

##1.RAID 控制器识别

**sudo lspci | grep -i raid**

03:00.0 RAID bus controller: **LSI** Logic / Symbios Logic MegaRAID SAS 2208 [Thunderbolt] (rev 05)

可以看到是RAID控制器是LSI系列的,那么我们将使用megacli进行处理,megasasctl/megactl工具能比较直观的获取到Enclosure Device ID和Slot 

Number信息,这两个信息就是盘阵信息和插槽信息。

##2.获取磁盘信息

**sudo megasasctl**

a0      PERC H710P Mini          encl:2 ldrv:1  batt:good

a0d0       465GiB RAID 1   1x2  optimal

unconfigured:  a0e32s2   a0e32s3   a0e32s4   a0e32s5   a0e32s6   a0e32s7   a0e32s8   a0e32s9 

a0e32s0     465GiB  a0d0  online  

a0e32s1     465GiB  a0d0  online  

a0e32s2     838GiB        ready   

a0e32s3     838GiB        ready   

a0e32s4     838GiB        ready   

a0e32s5     838GiB        ready   

a0e32s6     838GiB        ready   

a0e32s7     838GiB        ready   

a0e32s8     838GiB        ready   

a0e32s9     838GiB        ready  

我们需要做的就是将ready的裸盘变成逻辑盘

* 将a0e32s2和a0e32s3做成__单盘raid 0__

 eg:  

 **sudo  megacli -CfgLdAdd -r0[32:2] -a0**

    Adapter 0: Created VD 1

    

    Adapter 0: Configured the Adapter!!

   Exit Code: 0x00

    

    **sudo magasasctl**

    a0       PERC H710P Mini          encl:2 ldrv:2  batt:good

a0d0       465GiB RAID 1   1x2  optimal

a0d1       837GiB RAID 0   1x1  optimal

unconfigured:  a0e32s3   a0e32s4   a0e32s5   a0e32s6   a0e32s7   a0e32s8   a0e32s9 

a0e32s0     465GiB  a0d0  online  

a0e32s1     465GiB  a0d0  online  

a0e32s2     838GiB  a0d1  online  

a0e32s3     838GiB        ready   

a0e32s4     838GiB        ready   

a0e32s5     838GiB        ready   

a0e32s6     838GiB        ready   

a0e32s7     838GiB        ready   

a0e32s8     838GiB        ready   

a0e32s9     838GiB        ready 

   可以看到a0e32s2已经online了,说明成功了。

 

*将a0e32s4 和a0e32s5 做成__raid1__

     

   **sudo megacli -CfgLdAdd -r1[32:4,32:5] -a0**

                                     

   Adapter 0: Created VD 2

  Adapter 0: Configured the Adapter!!

  Exit Code: 0x00

  **sudo megasasctl**

 

a0       PERC H710P Mini          encl:2 ldrv:3  batt:good

a0d0       465GiB RAID 1   1x2  optimal

a0d1       837GiB RAID 0   1x1  optimal

a0d2       837GiB RAID 1   1x2  optimal

unconfigured:  a0e32s3   a0e32s6   a0e32s7   a0e32s8   a0e32s9 

a0e32s0     465GiB  a0d0  online  

a0e32s1     465GiB  a0d0  online  

a0e32s2     838GiB  a0d1  online  

a0e32s3     838GiB  a0d3  online

a0e32s4     838GiB  a0d2  online  

a0e32s5     838GiB  a0d2  online  

a0e32s6     838GiB        ready   

a0e32s7     838GiB        ready   

a0e32s8     838GiB        ready   

a0e32s9     838GiB        ready   

* 将剩下的四块盘做成__raid 10__

**sudo megacli -CfgSpanAdd -r10 -Array0[32:6,32:7] -Array1[32:8,32:9] -a0**

 

Adapter 0: Created VD 4

Adapter 0: Configured the Adapter!!

Exit Code: 0x00

**sudo megasasctl**

a0       PERC H710P Mini          encl:2 ldrv:5  batt:good

a0d0       465GiB RAID 1   1x2  optimal

a0d1       837GiB RAID 0   1x1  optimal

a0d2       837GiB RAID 1   1x2  optimal

a0d3       837GiB RAID 0   1x1  optimal

a0d4      1675GiB RAID 10  2x2  optimal

a0e32s0     465GiB  a0d0  online  

a0e32s1     465GiB  a0d0  online  

a0e32s2     838GiB  a0d1  online  

a0e32s3     838GiB  a0d3  online  

a0e32s4     838GiB  a0d2  online  

a0e32s5     838GiB  a0d2  online  

a0e32s6     838GiB  a0d4  online  

a0e32s7     838GiB  a0d4  online  

a0e32s8     838GiB  a0d4  online  

a0e32s9     838GiB  a0d4  online  

##3.查看新增加的逻辑盘:

**ls /dev/sd*| grep -v sda**

/dev/sdb

/dev/sdc

/dev/sdd

/dev/sde

**sudo parted /dev/sde print**

Model: DELL PERC H710P (scsi)

Disk /dev/sde: 1799GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

通过parted print可以知道,/dev/sde是大盘,将此划分成两个分区

**sudo parted -s /dev/sde mkpart gpt**

**sudo parted -s /dev/sde mkpart primary 0 50%**

sudo parted -s /dev/sde mkpart primary 0 -1s

 

**sudo parted /dev/sde print**

Model: DELL PERC H710P (scsi)

Disk /dev/sde: 1799GB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number  Start   End    Size   File system  Name     Flags

 1      17.4kB  900GB  900GB  ext3         primary

**sudo parted -s /dev/sde mkpart primary 900G 1799G**

**sudo parted /dev/sde print**

Number  Start   End     Size   File system  Name     Flags

 1      17.4kB  900GB   900GB  ext3         primary

 2      900GB   1799GB  900GB  xfs          primary

 

 再将/dev/sdb,sdc,sdd划分成一个分区,使用cfdisk

 使用fdisk -l 看一下分区有没有生成,再使用partprobe/partx -a重读分区表

 

 ##4.格式化分区

 

使用 sudo mkfs.文件类型

 ##5.新建挂载点

 根据用户指定的挂载点创建,如果用户没有指定挂载点,默认挂载点为 /srv/data/0 , /srv/data/1,依次下去

 

 sudo mkdir -p /srv/data{0,1,2,3,4}

 ##6.写/etc/fstab

 fstab 里面用UUID(eg:blkid  /dev/sdb1)挂载,挂载参数用 noatime ,取消开机自检。参考格式,"UUID=64603f91-f25f-4ba0-acc8-c9335fcec8fb /srv/nbs/0 ext4 noatime 0 0"。

 

 mount -a 

看有无报错信息

df -hT

看挂载有无成功

##现在将以上配置还原

umount 挂载点

df -hT看是否成功

还原/etc/fstab,再mount -a

使用cfdisk将/dev/sd{b,c,d}删除分区

使用sudo parted /dev/sde rm {1,2}

再sudo ls /dev/sd*| grep sda看一下是否还在

__比较重要的是如何删除硬阵列__

sudo megasasctl 

a0       PERC H710P Mini          encl:2 ldrv:5  batt:good

a0d0       465GiB RAID 1   1x2  optimal

a0d1       837GiB RAID 0   1x1  optimal

a0d2       837GiB RAID 1   1x2  optimal

a0d3       837GiB RAID 0   1x1  optimal

a0d4      1675GiB RAID 10  2x2  optimal

a0e32s0     465GiB  a0d0  online  

a0e32s1     465GiB  a0d0  online  

a0e32s2     838GiB  a0d1  online  

a0e32s3     838GiB  a0d3  online  

a0e32s4     838GiB  a0d2  online  

a0e32s5     838GiB  a0d2  online  

a0e32s6     838GiB  a0d4  online  

a0e32s7     838GiB  a0d4  online  

a0e32s8     838GiB  a0d4  online  

a0e32s9     838GiB  a0d4  online

 其中a0d0是我们系统盘的,不删除,从a0d0到a0d4依次为**L0~L4**

 使用如下命令:现在想删除a0d4的阵列

 

**sudo megacli -CfgLdDel -L4 --force -a0**

                                     

Adapter 0: Deleted Virtual Drive-4(target id-4)

Exit Code: 0x00

**sudo megasasctl **

a0       PERC H710P Mini          encl:2 ldrv:4  batt:good

a0d0       465GiB RAID 1   1x2  optimal

a0d1       837GiB RAID 0   1x1  optimal

a0d2       837GiB RAID 1   1x2  optimal

a0d3       837GiB RAID 0   1x1  optimal

unconfigured:  a0e32s6   a0e32s7   a0e32s8   a0e32s9 

a0e32s0     465GiB  a0d0  online  

a0e32s1     465GiB  a0d0  online  

a0e32s2     838GiB  a0d1  online  

a0e32s3     838GiB  a0d3  online  

a0e32s4     838GiB  a0d2  online  

a0e32s5     838GiB  a0d2  online  

a0e32s6     838GiB        ready   

a0e32s7     838GiB        ready   

a0e32s8     838GiB        ready   

a0e32s9     838GiB        ready   

其他的同上删除

转载于:https://www.cnblogs.com/clovn/p/4844929.html

一、数据采集层:多源人脸数据获取 该层负责从不同设备 / 渠道采集人脸原始数据,为后续模型训练与识别提供基础样本,核心功能包括: 1. 多设备适配采集 实时摄像头采集: 调用计算机内置摄像头(或外接 USB 摄像头),通过OpenCV的VideoCapture接口实时捕获视频流,支持手动触发 “拍照”(按指定快捷键如Space)或自动定时采集(如每 2 秒采集 1 张),采集时自动框选人脸区域(通过Haar级联分类器初步定位),确保样本聚焦人脸。 支持采集参数配置:可设置采集分辨率(如 640×480、1280×720)、图像格式(JPG/PNG)、单用户采集数量(如默认采集 20 张,确保样本多样性),采集过程中实时显示 “已采集数量 / 目标数量”,避免样本不足。 本地图像 / 视频导入: 支持批量导入本地人脸图像文件(支持 JPG、PNG、BMP 格式),自动过滤非图像文件;导入视频文件(MP4、AVI 格式)时,可按 “固定帧间隔”(如每 10 帧提取 1 张图像)或 “手动选择帧” 提取人脸样本,适用于无实时摄像头场景。 数据集对接: 支持接入公开人脸数据集(如 LFW、ORL),通过预设脚本自动读取数据集目录结构(按 “用户 ID - 样本图像” 分类),快速构建训练样本库,无需手动采集,降低系统开发与测试成本。 2. 采集过程辅助功能 人脸有效性校验:采集时通过OpenCV的Haar级联分类器(或MTCNN轻量级模型)实时检测图像中是否包含人脸,若未检测到人脸(如遮挡、侧脸角度过大),则弹窗提示 “未识别到人脸,请调整姿态”,避免无效样本存入。 样本标签管理:采集时需为每个样本绑定 “用户标签”(如姓名、ID 号),支持手动输入标签或从 Excel 名单批量导入标签(按 “标签 - 采集数量” 对应),采集完成后自动按 “标签 - 序号” 命名文件(如 “张三
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值