All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] determing lvm support
@ 2003-12-19 18:49 Rich Turner
  2003-12-20  6:31 ` Alasdair G Kergon
  2003-12-20 12:55 ` Micah Anderson
  0 siblings, 2 replies; 9+ messages in thread
From: Rich Turner @ 2003-12-19 18:49 UTC (permalink / raw)
  To: linux-lvm

is there any fool proof way of knowing whether or not a system has lvm
support?

right now i determine it this way:

lvm1:
look for "vgcreate" command and
look for "lvm" in /proc/devices or
look for "lvm-mod" in /lib/modules/[release]/kernel/drivers/md/*

lvm2:
look for "vgcreate" command and
look for "device-mapper" in /proc/devices or
look for "dm-mod" in /lib/modules/[release]/kernel/drivers/md/*

i think i am fairly certain with lvm1, but with lvm2 i am not sure if i
have device mapper support and a lvm command that is enough.

any ideas?

rich turner

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

* Re: [linux-lvm] determing lvm support
  2003-12-19 18:49 [linux-lvm] determing lvm support Rich Turner
@ 2003-12-20  6:31 ` Alasdair G Kergon
  2003-12-20  7:37   ` Luca Berra
  2003-12-22 10:05   ` Rich Turner
  2003-12-20 12:55 ` Micah Anderson
  1 sibling, 2 replies; 9+ messages in thread
From: Alasdair G Kergon @ 2003-12-20  6:31 UTC (permalink / raw)
  To: linux-lvm

On Fri, Dec 19, 2003 at 04:47:18PM -0800, Rich Turner wrote:
> lvm2:
> look for "vgcreate" command and
Better to check for the new 'lvm' base command: other commands are
links to it: check that running 'lvm version' produces complete output.
That will also confirm that device-mapper is available in the live
kernel and that /dev/mapper/control is set up correctly.
(See device-mapper/scripts/devmap_mknod.sh)

> look for "device-mapper" in /proc/devices or
It's better to check for that in /proc/misc, which will tell you whether
or not device-mapper support is present in the running kernel.

> look for "dm-mod" in /lib/modules/[release]/kernel/drivers/md/*
Better to attempt to load the module with modprobe and then do the
tests above to check it worked.
 
Alasdair
-- 
agk@uk.sistina.com

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

* Re: [linux-lvm] determing lvm support
  2003-12-20  6:31 ` Alasdair G Kergon
@ 2003-12-20  7:37   ` Luca Berra
  2003-12-20 17:32     ` Alasdair G Kergon
  2003-12-22 10:05   ` Rich Turner
  1 sibling, 1 reply; 9+ messages in thread
From: Luca Berra @ 2003-12-20  7:37 UTC (permalink / raw)
  To: linux-lvm

On Sat, Dec 20, 2003 at 12:30:23PM +0000, Alasdair G Kergon wrote:
>On Fri, Dec 19, 2003 at 04:47:18PM -0800, Rich Turner wrote:
>> lvm2:
>> look for "vgcreate" command and
>Better to check for the new 'lvm' base command: other commands are
>links to it: check that running 'lvm version' produces complete output.
>That will also confirm that device-mapper is available in the live
>kernel and that /dev/mapper/control is set up correctly.
>(See device-mapper/scripts/devmap_mknod.sh)
>
Besides that is there any way to reliably check if dm is loaded from a
c program, besides calling dm_task_run(), which is noisy if the driver
is not loaded? I don't want the user to see an error if she's not
running device-mapper.
it the moment i try to open dm_dir()/control, is that ok?

L.

-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

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

* Re: [linux-lvm] determing lvm support
  2003-12-19 18:49 [linux-lvm] determing lvm support Rich Turner
  2003-12-20  6:31 ` Alasdair G Kergon
@ 2003-12-20 12:55 ` Micah Anderson
  1 sibling, 0 replies; 9+ messages in thread
From: Micah Anderson @ 2003-12-20 12:55 UTC (permalink / raw)
  To: linux-lvm

On Fri, 19 Dec 2003, Rich Turner wrote:

> is there any fool proof way of knowing whether or not a system has lvm
> support?
> 
> right now i determine it this way:
> 
> lvm1:

> look for "lvm-mod" in /lib/modules/[release]/kernel/drivers/md/*

> lvm2:
> look for "dm-mod" in /lib/modules/[release]/kernel/drivers/md/*

The only problem with this step is that many kernels (any
production-level server of mine at least) do not use loadable modules,
but instead build LVM support striaght into the kernel. In these cases
your tests for the modules will fail. 

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

* Re: [linux-lvm] determing lvm support
  2003-12-20  7:37   ` Luca Berra
@ 2003-12-20 17:32     ` Alasdair G Kergon
  2003-12-21  2:09       ` Luca Berra
  0 siblings, 1 reply; 9+ messages in thread
From: Alasdair G Kergon @ 2003-12-20 17:32 UTC (permalink / raw)
  To: linux-lvm

On Sat, Dec 20, 2003 at 02:35:41PM +0100, Luca Berra wrote:
> Besides that is there any way to reliably check if dm is loaded from a
> c program, besides calling dm_task_run(), which is noisy if the driver
> is not loaded? I don't want the user to see an error if she's not
> running device-mapper.

Look at using dm_log_init() to provide a function that
suppresses all output.

> it the moment i try to open dm_dir()/control, is that ok?
That should work OK bypassing libdevmapper.
Otherwise, try dm_task_get_driver_version() after disabling log output.
 
Alasdair
-- 
agk@uk.sistina.com

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

* Re: [linux-lvm] determing lvm support
  2003-12-20 17:32     ` Alasdair G Kergon
@ 2003-12-21  2:09       ` Luca Berra
  2003-12-21 10:02         ` Alasdair G Kergon
  0 siblings, 1 reply; 9+ messages in thread
From: Luca Berra @ 2003-12-21  2:09 UTC (permalink / raw)
  To: linux-lvm

On Sat, Dec 20, 2003 at 11:30:51PM +0000, Alasdair G Kergon wrote:
>On Sat, Dec 20, 2003 at 02:35:41PM +0100, Luca Berra wrote:
>> Besides that is there any way to reliably check if dm is loaded from a
>> c program, besides calling dm_task_run(), which is noisy if the driver
>> is not loaded? I don't want the user to see an error if she's not
>> running device-mapper.
>
>Look at using dm_log_init() to provide a function that
>suppresses all output.
I'll look at it, but it seems i cannot restore the previous log function
then, i think it's easier to bypass the lib for my particular case.
Thanks a lot for your answers.

Regards,
L.


-- 
Luca Berra -- bluca@comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \

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

* Re: [linux-lvm] determing lvm support
  2003-12-21  2:09       ` Luca Berra
@ 2003-12-21 10:02         ` Alasdair G Kergon
  0 siblings, 0 replies; 9+ messages in thread
From: Alasdair G Kergon @ 2003-12-21 10:02 UTC (permalink / raw)
  To: linux-lvm

On Sun, Dec 21, 2003 at 09:08:02AM +0100, Luca Berra wrote:
> >Look at using dm_log_init() to provide a function that
> I'll look at it, but it seems i cannot restore the previous log function
I'll fix it so people can.

Alasdair
-- 
agk@uk.sistina.com

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

* Re: [linux-lvm] determing lvm support
  2003-12-20  6:31 ` Alasdair G Kergon
  2003-12-20  7:37   ` Luca Berra
@ 2003-12-22 10:05   ` Rich Turner
  2003-12-22 18:08     ` Alasdair G Kergon
  1 sibling, 1 reply; 9+ messages in thread
From: Rich Turner @ 2003-12-22 10:05 UTC (permalink / raw)
  To: linux-lvm

On Sat, 2003-12-20 at 04:30, Alasdair G Kergon wrote:
> On Fri, Dec 19, 2003 at 04:47:18PM -0800, Rich Turner wrote:
> > lvm2:
> > look for "vgcreate" command and
> Better to check for the new 'lvm' base command: other commands are
> links to it: check that running 'lvm version' produces complete output.
> That will also confirm that device-mapper is available in the live
> kernel and that /dev/mapper/control is set up correctly.
> (See device-mapper/scripts/devmap_mknod.sh)
if i have 'device-mapper' and 'lvm version' produces complete output, is
there anything else to check if lvm is supported on the system?

is 'device-mapper' used for anything else besides lvm?

does the kernel need to be built with 'lvm' support (which i believe was
true with lvm1-created 'lvm-mod'), or does building a kernel for 'lvm'
support just create 'dm-mod' loadable module/builtin 'dm-mod' kernel
support?

> > look for "device-mapper" in /proc/devices or
> It's better to check for that in /proc/misc, which will tell you whether
> or not device-mapper support is present in the running kernel.
why is it better to check in /proc/misc? when device-mapper support is
loaded, it shows up in both /proc/misc as well as /proc/devices.

> 
> > look for "dm-mod" in /lib/modules/[release]/kernel/drivers/md/*
> Better to attempt to load the module with modprobe and then do the
> tests above to check it worked.
>  
> Alasdair

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

* Re: [linux-lvm] determing lvm support
  2003-12-22 10:05   ` Rich Turner
@ 2003-12-22 18:08     ` Alasdair G Kergon
  0 siblings, 0 replies; 9+ messages in thread
From: Alasdair G Kergon @ 2003-12-22 18:08 UTC (permalink / raw)
  To: linux-lvm

On Mon, Dec 22, 2003 at 08:03:34AM -0800, Rich Turner wrote:
> > > look for "device-mapper" in /proc/devices or
> > It's better to check for that in /proc/misc, which will tell you whether
> > or not device-mapper support is present in the running kernel.
> why is it better to check in /proc/misc? when device-mapper support is
> loaded, it shows up in both /proc/misc as well as /proc/devices.

You can only guarantee its appearance in /proc/devices while you
have a device active.

Alasdair
-- 
agk@uk.sistina.com

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

end of thread, other threads:[~2003-12-22 18:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-19 18:49 [linux-lvm] determing lvm support Rich Turner
2003-12-20  6:31 ` Alasdair G Kergon
2003-12-20  7:37   ` Luca Berra
2003-12-20 17:32     ` Alasdair G Kergon
2003-12-21  2:09       ` Luca Berra
2003-12-21 10:02         ` Alasdair G Kergon
2003-12-22 10:05   ` Rich Turner
2003-12-22 18:08     ` Alasdair G Kergon
2003-12-20 12:55 ` Micah Anderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.