Tag Archives: Linux

How to Install LLVM & Clang on Oracle Linux

1) Install CMake.

2) Install G++.

3) Install Subversion.

4) Checkout the LLVM & Clang projects:

svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
svn co http://llvm.org/svn/llvm-project/cfe/trunk llvm/tools/clang

5) Configure, build and install them:

cmake . llvm
cmake --build .
cmake --build . --target install

You can find more details here.

Advertisements

How to Convert an Oracle Linux Guest VM from HVM to PVM in Oracle VM

1) Connect to the guest VM.

2) Create a new initial ramdisk image with the PV drivers:

dracut --add-drivers "xen-blkfront xen-netfront" -f /boot/initramfs-$(uname -r).img $(uname -r)

3) Edit the /boot/grub/grub.conf file to boot the PV kernel by default:

default=<PV Kernel Entry Number>

4) Open the Oracle VM Manager console.

5) Switch to the “Servers and VMs” tab.

6) Select the server pool, server and guest VM.

7) Click on the “Edit” button.

8) Select the “Xen PVM” domain type.

9) Restart the guest VM.

How to Resize a Virtual Disk of an Oracle Linux Guest VM in Oracle VM

W/ New Partition

1) Open the Oracle VM Manager console.

2) Switch to the “Servers and VMs” tab.

3) Select the server pool, server and guest VM.

4) Click on the “Stop” button.

5) Click on the “Edit” button.

6) Switch to the “Disks” tab.

7) Select a virtual disk.

8) Click on the “Edit a Virtual Disk” button.

9) Enter the new size in the “Size (GiB)” field.

10) Click on the “OK” button twice.

11) Click on the “Start” button.

12) Connect to the Oracle Linux guest VM.

13) Run fdisk:

fdisk /dev/xvda

14) Enter “n” to add a new partition.

15) Enter “p” to select the primary partition type.

16) Select a partition number.

17) Enter “w” to write changes and exit.

18) Restart the guest VM.

19) Create a new physical volume from the partition:

pvcreate /dev/xvda3

20) Add the physical volume to the default volume group:

vgextend vg_samplevm /dev/xvda3

21) Extend a logical volume by the free size of the volume group:

lvextend -l +100%FREE -r /dev/vg_samplevm/lv_root

W/o New Partition

1) Open the Oracle VM Manager console.

2) Switch to the “Servers and VMs” tab.

3) Select the server pool, server and guest VM.

4) Click on the “Stop” button.

5) Click on the “Edit” button.

6) Switch to the “Disks” tab.

7) Select a virtual disk.

8) Click on the “Edit a Virtual Disk” button.

9) Enter the new size in the “Size (GiB)” field.

10) Click on the “OK” button twice.

11) Click on the “Start” button.

12) Connect to the Oracle Linux guest VM.

13) Run fdisk:

fdisk /dev/xvda

14) Enter “d” to delete the existing partition.

15) Enter “n” to add a new partition.

16) Enter “p” to select the primary partition type.

17) Select a partition number.

18) Enter “w” to write changes and exit.

19) Restart the guest VM.

20) Resize the existing physical volume:

pvresize /dev/xvda2

21) Extend a logical volume by the free size of the volume group:

lvextend -l +100%FREE -r /dev/vg_samplevm/lv_root

How to Setup OCFS2 on Oracle Linux

1) Install the ocfs2-tools package.

2) Create a cluster:

o2cb add-cluster cluster

3) Add nodes to the cluster:

o2cb add-node cluster host1 --ip 192.168.56.1

 

o2cb add-node cluster host2 --ip 192.168.56.2

4) Add a disk-based heartbeat to the cluster:

o2cb add-heartbeat cluster /dev/sdb

5) Configure the stack:

service o2cb configure

6) Start the stack:

service o2cb online

7) Create a volume:

mkfs.ocfs2 /dev/sdb

8) Mount a file system

You can find more details here.