1:检查存储盘
[root@b28-backup ~]# cd /dev/mapper/
[root@b28-backup mapper]# ls -l
total 0
crw------- 1 root root 10, 62 May 30 11:02 control
brw-rw---- 1 root disk 253, 0 May 30 11:33 mpath0
brw-rw---- 1 root disk 253, 2 May 30 11:40 mpath0p1
brw-rw---- 1 root disk 253, 1 May 30 11:37 mpath1
brw-rw---- 1 root disk 253, 3 May 30 11:37 mpath1p1
2:检查存储配置文件
[root@b28-backup ~]# cd /etc/
[root@b28-backup ~]# ls –l multipath.conf
此配置文件如果不存在可以从centos上拷贝过来
3:修改配置文件
[root@b28-backup ~]# vi multipath.conf
blacklist {
devnode "*"
}
注释掉:# devnode "*"
4:启动服务
[root@b28-backup ~]# chkconfig multipathd on
Start multipathd:
[root@b28-backup ~]# service multipathd start
List multipath devices:
5:配置过程
[root@b28-backup ~]# parted /dev/mapper/mpath1
GNU Parted 1.8.1
Using /dev/mapper/mpath1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) show print
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [free|NUMBER|all] display the partition table, a partition, or all devices
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version displays the current version of GNU Parted and copyright
information
Model: Linux device-mapper (dm)
Disk /dev/mapper/mpath1: 5995GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) mklabel gpt
Warning: The existing disk label on /dev/mapper/mpath1 will be destroyed and all data on this disk
will be lost. Do you want to continue?
parted: invalid token: gpt
Yes/No? yes
New disk label type? [gpt]? gpt
(parted) show print
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [free|NUMBER|all] display the partition table, a partition, or all devices
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version displays the current version of GNU Parted and copyright
information
Model: Linux device-mapper (dm)
Disk /dev/mapper/mpath1: 5995GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) mkpart primary 1 5995GB
(parted) show print
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [free|NUMBER|all] display the partition table, a partition, or all devices
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition NUMBER
unit UNIT set the default unit to UNIT
version displays the current version of GNU Parted and copyright
information
Model: Linux device-mapper (dm)
Disk /dev/mapper/mpath1: 5995GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 17.4kB 5995GB 5995GB primary
(parted) quit
Information: Don't forget to update /etc/fstab, if necessary.
6:格式化磁盘
[root@b28-backup ~]# cd /dev/mapper/
[root@b28-backup mapper]# ls -l
brw-rw---- 1 root disk 253, 0 May 30 11:33 mpath0
brw-rw---- 1 root disk 253, 2 May 30 11:40 mpath0p1
brw-rw---- 1 root disk 253, 1 May 30 11:37 mpath1
brw-rw---- 1 root disk 253, 3 May 30 11:37 mpath1p1
[root@b28-backup mapper]# mkfs.ext3 /dev/mapper/mpath1p1
7:挂载存储盘
[root@b28-backup mapper]# mount /dev/mapper/mpath1p1 /data
8:存储随机启动设置
[root@b28-backup etc]# vi fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SW-cciss/c0d0p2 swap swap defaults 0 0
增加
/dev/mapper/mpath1p1 /data_backup ext3 defaults 0 0
9:reboot重启检查
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14507784/viewspace-759065/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14507784/viewspace-759065/