linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] LVM minor number allocation policy
@ 2005-05-10  6:53 Aditya Kulkarni
  2005-05-10 12:50 ` Alasdair G Kergon
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Kulkarni @ 2005-05-10  6:53 UTC (permalink / raw)
  To: linux-lvm

Hi all,

Here are a few questions that I had related to minor numbers of
logical volumes (LVs). First the questions, and then I will explain
the reason why I ask these questions -

[1] Suppose I create two LVs named vol1 and vol2. They have the
following (major, minor) no.s. vol1 = (major=X, minor=0) and vol2 =
(major=X, minor=1). Now I reboot the system. Is it guaranteed that
vol1 and vol2 will retain their minor no.s?

[2] Are there some options while creating LVs that we can use so that
LVs are created with a particular minor number?

[3] Suppose it is not guaranteed that LVs retain their minor numbers
across system reboots. When the system is coming up, what policy it
uses to assign minor numbers to LVs. For example, it could be based on
any one of the following -
    1. sort order of names of LVs.
    2. Timestamp of creation of LVs.
    3. Random

Why I ask these:
The issue of minor number remaining same is relevant to services being
"highly available". In my case, it happens to be the NFS exported file
system. The NFS file handle includes, among other things, the minor
no. of the device on which the exported file system resides. In case
the minor no. of LV is different on the failed-over-to system, we get
the problem of stale file handles.

Hence, I wanted to know how minor numbers are treated by LVM.

-- 
Best Wishes,
Aditya Kulkarni

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] LVM minor number allocation policy
  2005-05-10  6:53 [linux-lvm] LVM minor number allocation policy Aditya Kulkarni
@ 2005-05-10 12:50 ` Alasdair G Kergon
  0 siblings, 0 replies; 2+ messages in thread
From: Alasdair G Kergon @ 2005-05-10 12:50 UTC (permalink / raw)
  To: Aditya Kulkarni; +Cc: LVM general discussion and development

These answers are for lvm2 not lvm1.

On Tue, May 10, 2005 at 12:23:02PM +0530, Aditya Kulkarni wrote:
> [1] Suppose I create two LVs named vol1 and vol2. They have the
> following (major, minor) no.s. vol1 = (major=X, minor=0) and vol2 =
> (major=X, minor=1). Now I reboot the system. Is it guaranteed that
> vol1 and vol2 will retain their minor no.s?
 
No.

> [2] Are there some options while creating LVs that we can use so that
> LVs are created with a particular minor number?
 
Yes.  lvcreate/lvchange -My --major 254 --minor 200

Minor numbers normally allocated lowest first, so best to choose
higher numbers for persistent ones.  [2.6 kernel currently ignores 
the --major option]

> The issue of minor number remaining same is relevant to services being
> "highly available". In my case, it happens to be the NFS exported file
> system. The NFS file handle includes, among other things, the minor
> no. of the device on which the exported file system resides. 

These days, that's configurable.
See 'man exports' fsid=num.

+ This option forces the filesystem identification portion of the file handle
+ and file attributes  used  on the  wire  to  be  num instead of a number
+ derived from the major and minor number of the block device on which the
+ filesystem is mounted.  Any 32 bit number can be used, but it must be unique
+ amongst  all  the exported filesystems.

+ This  can  be  useful for NFS failover, to ensure that both
+ servers of the failover pair use the same NFS file handles for the shared
+ filesystem thus avoiding stale file handles after failover.

Alasdair
-- 
agk@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-10 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-10  6:53 [linux-lvm] LVM minor number allocation policy Aditya Kulkarni
2005-05-10 12:50 ` Alasdair G Kergon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).