United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
# rmmod LVM-mod # rmmod multipath # modprobe xample1000 # devlabel add -d /dev/sda /dev/exampleName --multipath SYMLINK: /dev/exampleName_multipath0 -> /dev/sda Added /dev/exampleName_multipath0 to /etc/sysconfig/devlabel # devlabel add -d /dev/sdb /dev/exampleName --multipath SYMLINK: /dev/exampleName_multipath1 -> /dev/sdb Added /dev/exampleName_multipath1 to /etc/sysconfig/devlabel # devlabel add -d /dev/sdc /dev/exampleName --multipath SYMLINK: /dev/exampleName_multipath2 -> /dev/sdc Added /dev/exampleName_multipath2 to /etc/sysconfig/devlabel # devlabel add -d /dev/sdd /dev/exampleName --multipath SYMLINK: /dev/exampleName_multipath3 -> /dev/sdd Added /dev/exampleName_multipath3 to /etc/sysconfig/devlabel
command.mdadm --create /dev/md0 --level=multipath --raid-devices=4 /dev/exampleName_multipath0 /dev/exampleName_multipath1 /dev/exampleName_multipath2 /dev/exampleName_multipath3
mke2fs -j /dev/vg0/lv0
# mdadm --create /dev/md0 --level=multipath --raid-devices=4 \
> /dev/exampleName_multipath0 \
> /dev/exampleName_multipath1 \
> /dev/exampleName_multipath2 \
> /dev/exampleName_multipath3
mdadm: array /dev/md0 started.
# vgscan
vgscan -- reading all physical volumes (this may take a while...)
vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created
vgscan -- WARNING: This program does not do a VGDA backup of your volume group
# pvcreate /dev/md0
pvcreate -- physical volume "/dev/md0" successfully created
# vgcreate vg0 /dev/md0
vgcreate -- INFO: using default physical extent size 32 MB
vgcreate -- INFO: maximum logical volume size is 2 Terabyte
vgcreate -- doing automatic backup of volume group "vg0"
vgcreate -- volume group "vg0" successfully created and activated
# lvcreate -L 1G -n lv0 vg0
lvcreate -- doing automatic backup of "vg0"
lvcreate -- logical volume "/dev/vg0/lv0" successfully created
# mke2fs -j /dev/vg0/lv0
mke2fs 1.32 (09-Nov-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131072 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
8 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
# mount /dev/vg0/lv0 /mnt/test
# touch /mnt/test/test_file
# ls /mnt/test
test_file
# mdadm --assemble /dev/md0 \ > /dev/sandisk_multipath0 \ > /dev/sandisk_multipath1 \ > /dev/sandisk_multipath2 \ > /dev/sandisk_multipath3 mdadm: /dev/md0 has been started with 1 drive and 3 spares. # modprobe lvm-mod # vgscan vgscan -- reading all physical volumes (this may take a while...) vgscan -- "/etc/lvmtab" and "/etc/lvmtab.d" successfully created vgscan -- WARNING: This program does not do a VGDA backup of your volume group # mount /dev/vg0/lv0 /mnt/whereeverYou may run into trouble (as noted at the beginning of this FAQ) if you are also using LVM volumes for the rest of your system. Under some circumstances, the vgscan will scan the physical devices and exit with an error before even looking at the md? device. If this is the case, you will probably not be able to use LVM for both your system filesystems and your SAN filesystems. This issue among others will likely be fixed in future releases or updates.
#!/bin/bash
#
# chkconfig: 235 70 30
# activate in runlevels 2, 3, and 5
# start with a priority of 70 and stop with 30
# description: Start up multipath SAN device
# processname: sanstart
# source function library
. /etc/init.d/functions
RETVAL=0
start() {
echo -n $"Starting multipath SAN devices: "
mdadm --assemble /dev/md0
/dev/sandisk_multipath0 \
/dev/sandisk_multipath1 \
/dev/sandisk_multipath2 \
/dev/sandisk_multipath3
let "RETVAL += $?"
modprobe lvm-mod
let "RETVAL += $?"
vgchange -ay
let "RETVAL += $?"
vgscan
let "RETVAL += $?"
mount /dev/vg0/lv0 /mnt/whereever
let "RETVAL += $?"
return $RETVAL
}
stop() {
echo -n $"Shutting down multipath SAN devices: "
umount /mnt/whereever
let "RETVAL += $?"
vgchange -an
rmmod lvm-mod
let "RETVAL += $?"
mdadm --stop /dev/md0
let "RETVAL += $?"
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $RETVAL