在虛擬機器上VM 添加一塊共用磁碟方法 支援Oracle 10g RAC

來源:互聯網
上載者:User

因為原先的ASM共用磁碟容量小,無法裝下歸檔日誌和備份檔案.所以決定增加一塊磁碟.

1 在節點1增加一塊虛擬磁碟 放在原來的共用目錄上 取名為ASM4

選擇SCSI 1:5  注意放在SCSI匯流排1號上面排在其他盤後面,否則容易發生盤符改變

mode=independent->Persistent

2  關閉虛擬機器檔案,然後用UEDIT開啟 Red Hat Enterprise Linux 4.vmx 在檔案最後

scsi1:5.present = "TRUE"
scsi1:5.fileName = "F:\sharkdisk\asm4.vmdk"

scsi1:5.mode = "independent-persistent"

可以看到成功添加了ASM4

在原來後面的共用磁碟添加一條

disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
-- scsi1.sharedBus = "VIRTUAL"  這條其他人添加的共用匯流排, 本人沒有添加這行,也行!
scsi1:0.deviceType = "disk"
scsi1:1.deviceType = "disk"
scsi1:2.deviceType = "disk"
scsi1:3.deviceType = "disk"
scsi1:4.deviceType = "disk"
scsi1:5.deviceType = "disk"


3 節點2 添加已經存在的虛擬磁碟,在編輯機器上,選擇磁碟,選擇已經存在的磁碟 在共用目錄上找到ASM4 並且設定下 SCSI 1:5 和independent=Persistent

4 關閉虛擬機器檔案,然後用UEDIT開啟 Red Hat Enterprise Linux 4.vmx  添加 scsi1:5.deviceType = "disk"

5 啟動節點1 切換到ROOT 使用者下 fdisk 新磁碟

 [root@node1 ~]# fdisk -l

Disk /dev/sdh: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdh doesn't contain a valid partition table

 [root@node1 ~]# fdisk /dev/sdh

[root@node1 ~]# fdisk /dev/sdh
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 1044.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n                                                                              --建立分區
Command action
   e   extended
   p   primary partition (1-4)
p                                                                                                                              --主要磁碟分割
Partition number (1-4): 1                                                                                    --分區號 1
First cylinder (1-1044, default 1): 1                                                                   --從柱面1開始
Last cylinder or +size or +sizeM or +sizeK (1-1044, default 1044): 1044   --到最後1個柱面
Command (m for help): w                                                                                   --儲存分區
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@node1 ~]# 

[root@node1 ~]# /etc/init.d/Oracleasm createdisk VOL4 /dev/sdh1
Marking disk "VOL4" as an ASM disk:                        [  OK  ]

[root@node1 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4

6 啟動節點2 分區被發現,同時ASM盤已經被找到了

[root@node2 ~]# fdisk -l
Disk /dev/sdh: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdh1               1        1044     8385898+  83  Linux

[root@node2 ~]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
VOL4

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.