linux 软raid恢复,linux软raid下线后恢复
机器中有数据的话,操作起来必须要非常小心。内部samba服务器访问不了,到了/share(共享目录)下,什么也没有。数据全部都没看到。后来,仔细查看,发现机器有5块硬盘,好像是做了软raid
1.使用fdisk -l命令查看,发现
/dev/sde1 1 60801 488384001 fd Linux raid autodete
2.cat /proc/mdstat,md0,md1全部都是inactive
3.全部下线,考虑了很久,因为有数据,所以不敢做太多的操作,想重新建立应该是没关系的吧
先关闭raid:mdadm -Ss,然后启动raid:mdadm -As
cat/etc/mdadm.conf
DEVICE /dev/sdb1 /dev/sdc1/dev/sdd1 /dev/sde1 /dev/md0 /dev/md1
ARRAY /dev/md0 metadata=1.2 name=file:0 UUID=4bd3bbbb:57305692:6d264713:10028518
ARRAY /dev/md1 metadata=1.2 name=file:1 UUID=190d94c6:7d7754a0:f91a4e70:acfdc372
ARRAY /dev/md2 metadata=1.2 name=file:2 UUID=6662ae21:aa253ded:46ea5e25:9a4559a4
4.启动后,fdisk -l
Disk /dev/sdb: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd87fd87f
Device Boot Start End Blocks Id System
/dev/sdb1 1 38913 312568641 fd Linux raid autodetect
Disk /dev/sdc: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3a563a56
Device Boot Start End Blocks Id System
/dev/sdc1 1 38913 312568641 fd Linux raid autodetect
Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x9fd1c6eb
Device Boot Start End Blocks Id System
/dev/sdd1 1 60801 488384001 fd Linux raid autodetect
Partition 1 does not start on physical sector boundary.
Disk /dev/sde: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xe0150a6e
Device Boot Start End Blocks Id System
/dev/sde1 1 60801 488384001 fd Linux raid autodetect
Partition 1 does not start on physical sector boundary.
Disk /dev/md0: 319.9 GB, 319935873024 bytes
2 heads, 4 sectors/track, 78109344 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xddd48bce
Disk /dev/md0 doesn't contain a valid partition table
Disk /dev/md1: 500.0 GB, 499970801664 bytes
2 heads, 4 sectors/track, 122063184 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Alignment offset: 512 bytes
Disk identifier: 0x00000000
Disk /dev/md1 doesn't contain a valid partition table
Disk /dev/md2: 819.9 GB, 819906215936 bytes
2 heads, 4 sectors/track, 200172416 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Alignment offset: 512 bytes
Disk identifier: 0xe6aa9a8f
Device Boot Start End Blocks Id System
/dev/md2p1 129 200172416 800689152 8e Linux LVM
Partition 1 does not start on physical sector boundary.
5.mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Tue Mar 26 00:10:39 2013
Raid Level : raid1
Array Size : 312437376 (297.96 GiB 319.94 GB)
Used Dev Size : 312437376 (297.96 GiB 319.94 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Thu Apr 3 22:43:39 2014
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : file:0 (local to host file)
UUID : 4bd3bbbb:57305692:6d264713:10028518
Events : 16408
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
2 8 33 1 active sync /dev/sdc1
就是两个磁盘做raid1,然后md0和md1做raid0
6.看了上面的输出,有使用率,说明数据还在,稍微放了一下心
直接mount /dev/md2p1 /share,提示mount: unknown filesystem type 'LVM2_member'
--- Logical volume ---
LV Name /dev/vgmd2/lvshare
VG Name vgmd2
LV UUID hN0kGI-5yBU-3ABH-rkU2-fPGi-JfX8-D1C0DQ
LV Write Access read/write
LV Status NOT available
LV Size 256.00 GiB
Current LE 16384
Segments 1
Allocation inherit
Read ahead sectors auto
--- Logical volume ---
LV Name /dev/vgmd2/lvnfs
VG Name vgmd2
LV UUID PRKkOr-zzJd-O0di-GT8W-0lsf-wtN3-1bFShN
LV Write Access read/write
LV Status NOT available
LV Size 10.00 GiB
Current LE 640
Segments 1
Allocation inherit
Read ahead sectors auto
vgchange -ay后,lvdisplay
--- Logical volume ---
LV Name /dev/vgmd2/lvshare
VG Name vgmd2
LV UUID hN0kGI-5yBU-3ABH-rkU2-fPGi-JfX8-D1C0DQ
LV Write Access read/write
LV Status available
# open 0
LV Size 256.00 GiB
Current LE 16384
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 254:4
--- Logical volume ---
LV Name /dev/vgmd2/lvnfs
VG Name vgmd2
LV UUID PRKkOr-zzJd-O0di-GT8W-0lsf-wtN3-1bFShN
LV Write Access read/write
LV Status available
# open 0
LV Size 10.00 GiB
Current LE 640
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 254:5
mount -t ext4 /dev/vgmd2/lvshare /share
7.最后用samba用户名和密码登陆,可以进去,没有提示无权限错误,操作要小心。
最后写入/etc/fstab
总结就是一下几步
#!/bin/bash
mdadm -Ss
mdadm -As
mdadm --detail /dev/md0
vgchange -ay /dev/vgmd2
mount -t ext4 /dev/vgmd2/lvshare /share
linux 软raid恢复,linux软raid下线后恢复相关推荐
- sd卡不小心格式化怎么恢复,sd卡格式化后恢复数据
当你的sd卡数据丢失了你知道要怎么找回吗?当sd卡遇到误删.格式化.病毒攻击.剪切失败.传输失败.断电等情况造成的数据丢失,sd不小心格式化了怎么恢复数据呢?sd卡的数据可重要可不重要,如果丢失的是重 ...
- 研发工程师玩转Kubernetes——Node失效后恢复的实验
在<研发工程师玩转Kubernetes--Node失效后的Pod的调度实验>中我们看到Kubernetes会一直等待Node状态恢复.这节我们将做实验,看看Node恢复后Kubernete ...
- linux 软raid恢复,Linux软RAID部署系统分区之恢复攻略
Linux软RAID部署系统分区之恢复攻略 软RAID部署系统分区之恢复攻略 ChinaUnix网友:Jerrywjl 作为在几乎所有Linux发行版操作系统中所带的逻辑卷管理方式(LVM),其最大的 ...
- linux下使用mdadm组软raid,Linux下使用mdadm创建和管理软raid
Linux下使用mdadm创建和管理软raid 注:本次操作以RHEL4为例,但应该可以应用到其它大部分的distro上(guess). mdadm的几个常用参数 -C 创建Raid,后面跟参数,代表 ...
- Linux之RAID介绍、软RAID5实操配置(失望攒够了就放手,不打扰是我最后的温柔)
目录 一.什么是RAID(独立冗余磁盘阵列) 二.RAID物理分类 2.1 硬RAID 2.2 软RAID 三.RAID逻辑分类 3.1 RAID0 3.2 RAID1 3.3 RAID5 3.4 R ...
- linux软raid 修复,Linux下软RAID维护 | 聂扬帆博客
上一篇文章配置软RAID中配置好Raid之后,还需要进行日常的维护操作,比如其中一块物理硬盘损坏,我们需要进行更换故障磁盘的操作,下面我们将模拟raid1中磁盘损坏来讲解软RAID的维护操作. 一.硬 ...
- Linux:raid技术及软raid管理命令mdadm详解
RAID技术及软raid管理mdadm详解 RAID是什么,常见的RAID有哪些? 软RAID实现,mdadm创建RAID实操 RAID是什么,常见的RAID有哪些? RAID: 磁盘阵列(Redun ...
- linux 权限管理 lvm,Linux系统中RAID及LVM管理
本节索引 一.RAID概念及管理 二.LVM逻辑卷的介绍及使用 Linux系统中如何提高磁盘的读写性能,如何实现磁盘冗余,当磁盘快被占满时,又如何弹性拓展磁盘容量,RAID及LVM技术可以帮你轻松解决 ...
- linux操作系统下载gLINUX数据恢复及RAID数据恢复解决方案(组图
企事业单位的IT主管.CTO们工作中最最关心的问题莫过于保存在服务器.存储设备.员工的工作PC.苹果电脑以及用于移动存储的硬盘里的数据的安全了,企事业单位内部有很多核心部门以及核心领导,他们使用的数据 ...
最新文章
- 限量!“Java成长笔记”Spring Boot/Sentinel/Nacos高并发
- 什么时候是找工作的最佳时期? | 原力计划
- 继续说说美国互联网版权监管法案(SOPA)
- mysql触发器查询别的表_Oracle触发器查询统计本表
- 图片爬取数据解析数据持久化
- 今早服务器出现的问题
- layui时间选择30分钟为单位_如何集中注意力,不妨试试番茄工作法 | 五色时间管理法...
- ManyToManyField的注意事项和如何建立索引
- Introspector内存溢出的原理解析
- Java 高阶 —— native 关键字与 JNI
- iOS开源项目周报1229
- copy linux file to mac,Mac Linux互相传递文件
- python3.6 numpy下载_numpy下载安装 NumPy MKL v1.13.1 cp36 for Python3.6 官方安装版 64位 下载-脚本之家...
- 一文看懂什么是车规级芯片
- Java知识复习清单
- 迁移学习与小样本学习
- 电大php考试,电大考试搜题神器免费
- 几款常见开源php博客体验
- [论文笔记] SSE-PT: Sequential Recommendation Via Personalized Transformed
- 条件随机场(CRF)原理和实现
热门文章
- 推荐几个比较好的游戏引擎
- 计量地理-求中值频率频数
- 马来酰亚胺聚乙二醇叠氮,MAL-PEG-N3,Maleimide-PEG-Azide
- MC9S12XEP100的IIC模块(IICV3)
- 聊天突然尬住?教你用Python一键获取斗图表情包,各种表情包轻松化解尴尬
- python编程400例_ZH奶酪:编程语言入门经典100例【Python版】
- Go语言实战:二级缓存框架-欧阳桫-专题视频课程
- 计算机上没有office2010,电脑装上office2010后,新建里面没有,该怎么处理
- 程序猿和星座之间不可不谈的事
- 有限状态机FSM详解(1)——最简单的FSM