linux 多路径 parted,multipath多路径存储配置

:检查存储盘

[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

:检查存储配置文件

[root@b28-backup

~]# cd /etc/

[root@b28-backup

~]# ls –l multipath.conf

此配置文件如果不存在可以从centos上拷贝过来

:修改配置文件

[root@b28-backup

~]# vi multipath.conf

blacklist {

devnode "*"

}

注释掉:#  devnode

"*"

:启动服务

[root@b28-backup

~]# chkconfig multipathd on

Start multipathd:

[root@b28-backup

~]# service multipathd start

List multipath

devices:

:配置过程

[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.

:格式化磁盘

[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

:挂载存储盘

[root@b28-backup

mapper]# mount  /dev/mapper/mpath1p1

/data

:存储随机启动设置

[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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值