Mounting Oracle VM Templates without LVMs in it.

In blog entry "Provisioning your GRID with Oracle VM Templates" I explained how to mount a filesystem from an Oracle VM template that was build on a logical volume. It seems however, that Oracle VM templates are also shipped without logical volumes in it, just plain ext3.

So how would one manage to mount that then ?

First, setup the loop, to see what's in it.


[root@pts05 ] losetup /dev/loop99 /OVS/running_pool/gridnode01/System.img
[root@pts05 ]# fdisk -lu /dev/loop99
Disk /dev/loop99: 6530 MB, 6530871808 bytes
255 heads, 63 sectors/track, 793 cylinders, total 12755609 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/loop99p1 * 63 64259 32098+ 83 Linux
/dev/loop99p2 64260 8562644 4249192+ 83 Linux
/dev/loop99p3 8562645 12739544 2088450 82 Linux swap / Solaris

So, three plain partitions, no logical volumes in it.

What to do next ? it seems NOT possible to inform the kernel about that three partitions:


[root@pts05 p]# partprobe -s /dev/loop99
Error: Error informing the kernel about modifications to partition /dev/loop99p1 -- Invalid argument. This means Linux won't know about any changes you made to /dev/loop99p1 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Error informing the kernel about modifications to partition /dev/loop99p2 -- Invalid argument. This means Linux won't know about any changes you made to /dev/loop99p2 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Error: Error informing the kernel about modifications to partition /dev/loop99p3 -- Invalid argument. This means Linux won't know about any changes you made to /dev/loop99p3 until you reboot -- so you shouldn't mount it or use it in any way before rebooting.
Warning: The kernel was unable to re-read the partition table on /dev/loop99 (Invalid argument). This means Linux won't know anything about the modifications you made until you reboot. You should reboot your computer before doing anything with /dev/loop99.

Okay, since I don't want to reboot, this is not an option.Maybe we need to setup the loop, but with an offset to the partition I need.

Since the sector size is 512 bytes and I start at 64260, my offset will be: 512 * 64260 = 32901120. Why do I start at 64260, since I guess partition one is the /boot partition.


[root@pts05 tools]# losetup /dev/loop98 /OVS/running_pool/gridnode01/System.img -o 32901120
[root@pts05 tools]# losetup -a | grep offset
/dev/loop98: [0811]:6127628 (/OVS/running_pool/gridnode01/System.img), offset 32901120

Yes, there it is ! Mounting is easy now !


[root@pts05 p]# mkdir /tmp/p; mount /dev/loop98 /tmp/p/
[root@pts05 p]# df -m | loop98
/dev/loop98 4013 2071 1901 53% /tmp/p
[root@pts05 p]# ls -l /tmp/p/
total 196
drwxr-xr-x 2 root root 4096 Sep 3 00:03 bin
drwxr-xr-x 2 root root 4096 Mar 25 05:44 boot
drwxr-xr-x 2 root root 4096 Sep 4 09:58 crs
drwxr-xr-x 2 root root 4096 Apr 10 07:14 dev
drwxr-xr-x 96 root root 12288 Sep 10 07:03 etc
drwxr-xr-x 4 root root 4096 Sep 8 21:30 home
drwxr-xr-x 13 root root 4096 Sep 3 00:03 lib
drwx------ 2 root root 16384 Mar 25 05:44 lost+found
drwxr-xr-x 2 root root 4096 Jan 9 2009 media
drwxr-xr-x 2 root root 4096 Jan 21 2009 misc
drwxr-xr-x 3 root root 4096 Sep 4 09:40 mnt
dr-xr-xr-x 2 root root 4096 Sep 8 21:22 net
drwxr-xr-x 4 root root 4096 Sep 9 22:03 opt
drwxr-xr-x 2 root root 4096 Mar 25 05:44 proc
drwxr-x--- 2 root root 4096 Sep 8 22:30 root
drwxr-xr-x 2 root root 12288 Sep 9 22:05 sbin
drwxr-xr-x 2 root root 4096 Mar 25 05:44 selinux
drwxr-xr-x 2 root root 4096 Jan 9 2009 srv
drwxr-xr-x 2 root root 4096 Mar 25 05:44 sys
drwxr-xr-x 3 root root 4096 Apr 10 07:03 tftpboot
drwxrwxrwt 17 root root 4096 Sep 10 14:57 tmp
drwxr-xr-x 2 root root 4096 Sep 2 22:13 u01
drwxr-xr-x 14 root root 4096 Apr 10 07:03 usr
drwxr-xr-x 21 root root 4096 Apr 10 07:05 var

Rene Kundersma
Oracle Technology Services, The Netherlands

Comments:

great site!!! I am so looking forward to seeing more posts :)

Posted by guest on December 12, 2009 at 06:25 AM PST #

Hi Rene,
i'm also confused with the multipath device mapper for BareMetal database servers and ASMLIB. It seems that documents/internet search don't give the same solutions:
I've conclude that ik should use de /dev/mapper/* in the scanorder and make partitions on de /de/mapper/mpathp* devices, like mpath1p1, and use these for oracelasm createdisk.
@do you use this for ASMLIB for RAC and EXADATA also?
regards Cor de Waaij

Posted by Cor de Waaij on December 27, 2009 at 03:01 PM PST #

Hi Cor, I am quoting from my documentation: "in it’s default configuration, asmlib will use the first path it finds to a disk with multiple paths. For a multipath device /dev/multipatha that comprises the devices /dev/sdb and /dev/sdc, this means that asmlib might use /dev/sdb or /dev/sdc instead of /dev/multipatha. This can be prevented by setting the following variables in /etc/sysconfig/oracleasm: ORACLEASM_SCANORDER ORACLEASM_SCANEXCLUDE So for example: ORACLEASM_SCANORDER="multipath sd" means that ASM will look for /dev/multipath* devices first and then /dev/sd* devices. So then it will use the multipath devices first. Or to exclude the single path devices completely from the asmlib scan: ORACLEASM_SCANEXCLUDE="sd" Then again, why would you partition you your ASM disks in the first place ? I wouldn't. Also, Yes, for RAC Asmlib is recommended. And no for Exadata we do not use ASMlib. Regards Rene

Posted by rene.kundersma on December 27, 2009 at 03:30 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Blog of Rene Kundersma, Principal Member of Technical Staff at Oracle Development USA. I am designing and evaluating solutions and best practices around database MAA focused on Exadata. This involves HA, backup/recovery, migration and database consolidation and upgrades on Exadata. Opinions are my own and not necessarily those of Oracle Corporation. See http://www.oracle.com/technology/deploy/availability/htdocs/maa.htm.

Search

Archives
« May 2015
SunMonTueWedThuFriSat
     
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
      
Today