ISCSI存储-数据恢复【CENTOS6.5】
1、原服务器恢复OK:
安装客户端 yum install iscsi-initiator-utils
iscsiadm -m discovery -t sendtargets -p 192.168.122.192
iscsiadm -m node -T iqn...lvm-test -p 192.168.122.192 -l
pvcreate /dev/sda
vgcreate vg-test /dev/sda
lvcreate -L 960 -n lv-test vg-test
mkfs.ext4 /dev/mapper/vg--test-lv--test
mount /dev/mapper/vg--test-lv--test /mnt/lv-test
原系统断网、umount重启系统后的ISCSI存储LVM恢复:
iscsiadm -m session、PV、VG、LV信息都在,但/dev/mapper/无映射,/dev/dm*也没有设备。
运行vgchange -ay vg-test后,/dev/dm*有设备了,/dev/mapper/下映射也恢复了。挂回原来位置,文件全在。
mount /dev/mapper/vg--test-lv--test /mnt/lv-test
具体:centos6.5-64
[root@dg1 ~]# yum install iscsi-initiator-utils
Loaded plugins: fastestmirror, refresh-packagekit, security
Determining fastest mirrors
* base: mirrors.163.com
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:02
extras | 3.4 kB 00:00
extras/primary_db | 27 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 2.4 MB 00:02
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package iscsi-initiator-utils.x86_64 0:6.2.0.873-27.el6_9 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
========================================================
Package Arch Version Repository Size
=======================================================
Installing:
iscsi-initiator-utils x86_64 6.2.0.873-27.el6_9 base 732 k
Transaction Summary
============================================================
Install 1 Package(s)
Total download size: 732 k
Installed size: 2.5 M
Is this ok [y/N]: y
Downloading Packages:
iscsi-initiator-utils-6.2.0.873-27.el6_9.x86_64.rpm | 732 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : iscsi-initiator-utils-6.2.0.873-27.el6_9.x86_64 1/1
Verifying : iscsi-initiator-utils-6.2.0.873-27.el6_9.x86_64 1/1
Installed:
iscsi-initiator-utils.x86_64 0:6.2.0.873-27.el6_9
Complete!
[root@dg1 ~]# iscsiadm -m discoveryy -t sendtargets -p 192.168.122.192
Try `iscsiadm --help' for more information.
[root@dg1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.122.192
Starting iscsid: [ OK ]
192.168.122.192:3260,1 iqn.2006-01.com.openfiler:tsn.lvm-test
192.168.122.192:3260,1 iqn.2006-01.com.openfiler:tsn.JustTestIscsi
192.168.122.192:3260,1 iqn.2006-01.com.openfiler:tsn.ea38368c6e0e
[root@dg1 ~]# iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.lvm-test -p 192.168.122.192 -l
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.lvm-test, portal: 192.168.122.192,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.lvm-test, portal: 192.168.122.192,3260] successful.
[root@dg1 ~]# iscsiadm -m session
tcp: [1] 192.168.122.192:3260,1 iqn.2006-01.com.openfiler:tsn.lvm-test (non-flash)
[root@dg1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg_dg1 1 2 0 wz--n- 39.51g 0
[root@dg1 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_dg1 lvm2 a-- 39.51g 0
[root@dg1 ~]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv_root vg_dg1 -wi-ao---- 35.57g
lv_swap vg_dg1 -wi-ao---- 3.94g
[root@dg1 ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg-test" using metadata type lvm2
Found volume group "vg_dg1" using metadata type lvm2
[root@dg1 ~]# vgimport vg-test
Volume group "vg-test" is not exported
[root@dg1 ~]# pvscan
PV /dev/sdb VG vg-test lvm2 [956.00 MiB / 56.00 MiB free]
PV /dev/sda2 VG vg_dg1 lvm2 [39.51 GiB / 0 free]
Total: 2 [40.44 GiB] / in use: 2 [40.44 GiB] / in no VG: 0 [0 ]
[root@dg1 ~]# pv
pvchange pvcreate pvmove pvresize pvscan
pvck pvdisplay pvremove pvs pv.sh
[root@dg1 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 vg_dg1 lvm2 a-- 39.51g 0
/dev/sdb vg-test lvm2 a-- 956.00m 56.00m
[root@dg1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
vg-test 1 1 0 wz--n- 956.00m 56.00m
vg_dg1 1 2 0 wz--n- 39.51g 0
[root@dg1 ~]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lv-test vg-test -wi------- 900.00m
lv_root vg_dg1 -wi-ao---- 35.57g
lv_swap vg_dg1 -wi-ao---- 3.94g
[root@dg1 ~]# vgchange -ay vg-test
1 logical volume(s) in volume group "vg-test" now active
[root@dg1 ~]# ll /dev/mapper/
total 0
crw-rw----. 1 root root 10, 58 Dec 11 14:30 control
lrwxrwxrwx. 1 root root 7 Dec 11 14:30 vg_dg1-lv_root -> ../dm-0
lrwxrwxrwx. 1 root root 7 Dec 11 14:30 vg_dg1-lv_swap -> ../dm-1
lrwxrwxrwx. 1 root root 7 Dec 11 14:41 vg--test-lv--test -> ../dm-2
[root@dg1 ~]# mkdir /mnt/lv-test
[root@dg1 ~]# mount /dev/mapper/vg--test-lv--test /mnt/lv-test/
[root@dg1 ~]# cat /mnt/lv-test/
lost+found/ test1/ test2/
[root@dg1 ~]# cat /mnt/lv-test/test2/wer.txt
asdgfhj
dgfhg
gsfdgfhg
hfgdfsdgf
hgfsds
fdgfgdfsd
fdgfd
迪浮科技课程服务承诺:
1、免费重修:
学员缺课或者学校效果不理想,可以免费重修,确保课程内容完全掌握。重修过程中绝对不收取任何费用!
2、单独辅导:
如果学生在学习过程中,因各种原因无法跟班级进度同步,公司安排专家讲师一对一辅导,手把手带你成为IT精英!
3、自由实验:
清默网络有先进完善的实验中心,全天开放,实验机时不限,不断提高动手操作能力!
4、考试辅导:
学员考试前先通过清默内部模拟考试,技术确定达到考试要求并提供考前辅导及考试技巧讲解。
如果模拟考试未能通过,专家讲师会给予建议和辅导,合格后再参加正式考试,确保学员能高分通过认证考试。
5、企业实战项目:
即通过先进的设备完全搭建和企业项目完全一致的网络环境,把学习内容融会贯通并在实际项目中加以应用,以达到学员迅速掌握实际技能并弥补经验不足的目的,让学员的学习内容不再纸上谈兵,理论与实战完全吻合
咨询老师:郭老师
咨询电话:15056089769
咨询Q Q :1027831018
- 上一篇:文本编辑器vim的基本指令
- 下一篇:什么是yum仓库?