Skip to content

virtualbox shared storage create on linux

virtualbox shared storage create on linux published on Комментариев к записи virtualbox shared storage create on linux нет

create shared storage:
data:

for i in {1..10};do vboxmanage createhd --filename asm_$i --size 10240 --format VDI --variant Fixed; done

OCR:

for i in {1..3};do vboxmanage createhd --filename vote_$i --size 1200 --format VDI --variant Fixed; done

make disk shareable:

for i in `ls -1 *.vdi`; do vboxmanage modifyhd $i --type shareable; done

add disk to virtual machine

c=1; for i in `ls rac*.vdi -1` ; do c=$((c+=1)) echo vboxmanage storageattach oel6-1 --storagectl "SATA" --port $c --type hdd --medium $i --mtype shareable; done
c=1; for i in `ls rac*.vdi -1` ; do c=$((c+=1))  vboxmanage storageattach oel6-1 --storagectl "SATA" --port $c --type hdd --medium $i --mtype shareable; done

make disk partitions:
1. generate create partion table :

fdisk -l | grep GB | awk '{ print "parted -s " $2 " mklabel  gpt"}' | sed 's/://g

need to automate create partition script

 echo -e "-1" | (parted -a optimal /dev/sdb mkpart primary 1 ) 

no free vm to test

2. generate create asm disk:

[root@oel6-1 ~]# fdisk -l | grep 10.7 | awk '{ print "oracleasm createdisk RAC_ASM"NR " " $2 "1"  }' | sed 's/://g'
oracleasm createdisk RAC_ASM1 /dev/sdb1
oracleasm createdisk RAC_ASM2 /dev/sdc1
oracleasm createdisk RAC_ASM3 /dev/sdd1
oracleasm createdisk RAC_ASM4 /dev/sde1
oracleasm createdisk RAC_ASM5 /dev/sdf1
oracleasm createdisk RAC_ASM6 /dev/sdg1
oracleasm createdisk RAC_ASM7 /dev/sdh1
oracleasm createdisk RAC_ASM8 /dev/sdi1
oracleasm createdisk RAC_ASM9 /dev/sdj1
oracleasm createdisk RAC_ASM10 /dev/sdk1
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM1 /dev/sdb1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM2 /dev/sdc1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM3 /dev/sdd1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM4 /dev/sde1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM5 /dev/sdf1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM6 /dev/sdg1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM7 /dev/sdh1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM8 /dev/sdi1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM9 /dev/sdj1
Writing disk header: done
Instantiating disk: done
[root@oel6-1 ~]# oracleasm createdisk RAC_ASM10 /dev/sdk1
Writing disk header: done
Instantiating disk: done

Normal storage how to:

 for i in {1..5};do vboxmanage createhd --filename stdb1_asm_$i --size 10240 --format VDI ; done
 c=1; for i in `ls stdb1_asm*.vdi -1` ; do c=$((c+=1))  vboxmanage storageattach stdb1 --storagectl "SATA" --port $c --type hdd --medium $i ; done

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *

Primary Sidebar

Яндекс.Метрика