Operating System - HP-UX
1833737 Members
2680 Online
110063 Solutions
New Discussion

Mirroring raw volumes: possible or impossible?

 
SOLVED
Go to solution
Matt Hearn
Regular Advisor

Mirroring raw volumes: possible or impossible?

I have what seems to me to be a silly question: can you mirror raw volumes?

My view is that an lvol is an lvol, and can be mirrored at the LVM level no matter what you decide to put on it, be it raw data or a VXFS filesystem or whatever.

We have some sybase databases that use raw volumes to store the data, and I have a couple colleagues that insist that because of these they can't be mirrored. They are quite vehement in their opinion.

Can somebody settle this for us?

Thanks!!!
8 REPLIES 8
Pete Randall
Outstanding Contributor
Solution

Re: Mirroring raw volumes: possible or impossible?

Matt,

I can't say definitively but I agree wholeheartedly with you that an lvol is an lvol and mirroring should work on a raw lvol as well as a cooked lvol.


Pete

Pete
Patrick Wallek
Honored Contributor

Re: Mirroring raw volumes: possible or impossible?

Yes, you can mirror a raw LVOL.

# lvextend -m 1 /dev/vg??/lvol?

It doesn't matter that it doesn't have a filesystem on it.
Pete Randall
Outstanding Contributor

Re: Mirroring raw volumes: possible or impossible?

In fact, I just reviewed the course material for "Hands On With LVM and MirrorDisk/UX" (H6285S), and the very first illustration in the mirroring section shows raw data being mirrored!


Pete

Pete
Patrick Wallek
Honored Contributor

Re: Mirroring raw volumes: possible or impossible?

As a quick test, I just did:

# lvcreate -L 512 -m 1 -n test vg00

This create a 512 MB mirrored LVOL /dev/vg00/test on one of my machines. Now if I want to I can do a newfs on that. Or if I want to access it as a raw volume, I could do that to. It doesn't matter. The LV is mirrored regardless of whether the filesystem is actually there or not.
A. Clay Stephenson
Acclaimed Contributor

Re: Mirroring raw volumes: possible or impossible?

Ask your expert colleagues how it is possible to completely remove a filesystem or do a newfs on an existing LVOL and somehow the LVOL manages to stay mirrored eventhough you did nothing special when the new filesystem was created. The mirroring occurs at a lower abstraction layer than the filesystem. Whenever a disk i/o is going to a device major 64 (LVM) there is a lookaside table that translates logical block N to physical block M on physical device D. It also associates the physical device with the actual major device number in the kernel's device switch table. There can be a one to many mapping of logical block N so that multiple physical block/physical device tupes are associated with one LVM logical block. Of course, we really should use "extent" rather than "block" but you get the idea.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: Mirroring raw volumes: possible or impossible?

As Clay pointed out, mirroring takes place far below the filesystem code. In fact, a logical volume is simply a virtual disk, a collection of extents. The LVM subsystem does not understand or care about how the disk is used. In fact, putting a filesystem on an lvol is only one of many uses for an lvol. An lvol might be used for swap space, or it could be used as a Sybase (or Informix or Oracle) raw lvol. Mirroring is never based on files or directories, it is based on disk extents without regard to actual usage higher up the chain.


Bill Hassell, sysadmin
Basheer_2
Trusted Contributor

Re: Mirroring raw volumes: possible or impossible?

Hi Matt

I have used this for mirroring root disk

I didn't have mirror-ux product
So I used to mirror my root disk weekly once by putting in the cron
dd if=/dev/rdsk/c???? of=/dev/dsk/xxxx bs=1024

I think may be u can use for lv
Marlou Everson
Trusted Contributor

Re: Mirroring raw volumes: possible or impossible?

And just in case, you would like real world experience. I've been mirroring Sybase raw logical volumes for years now. On at least 4 systems. More systems if you count upgrading to newer hardware. That's also how we moved the data from the original Jamaica disks to the Model 30 then to the VA7400 and next to the EVA.

Marlou