Skip to contentSkip to conversation

LVM and I2O

linux-lvm Andreas Dilger 3 participants 5 messages Sep 7, 2000 – Sep 8, 2000

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Jan Strohbehn

I'm trying to get the newest lvm working on I2O-devices, but it seems that the LVM-tools aren't able to recognize them. Has anyone a hint are an idea why this problem appears ???

That's because LVM was coded to do all of the device/partition searching itself. This is a holdover from 2.0 days when /proc/partitions did not exist.

Quoted 1 line

Are there any workarounds ???

What you need to do is go into the LVM user tools (tools/lib/lvm_dir_cache.c) and add /dev/i2o (or whatever the base of the device name is) to the list of "valid" LVM devices. You also need to add the block major(s) to at least lvm_check_dev.c, lvm_check_partitioned_dev.c.

The issue of LVM handling partitions/devices/etc itself has caused problems in the past, and will probably cause problems in the future. The solution is to have LVM allow anything in /proc/partitions, and only fall back on its internal checks if /proc/partitions doesn't exist.

Cheers, Andreas

#1 lore raw
Quoted 16 lines · Andreas Dilger
Quoted 3 lines · Jan Strohbehn

I'm trying to get the newest lvm working on I2O-devices, but it seems that the LVM-tools aren't able to recognize them. Has anyone a hint are an idea why this problem appears ???

That's because LVM was coded to do all of the device/partition searching itself. This is a holdover from 2.0 days when /proc/partitions did not exist.

Quoted 1 line

Are there any workarounds ???

What you need to do is go into the LVM user tools (tools/lib/lvm_dir_cache.c) and add /dev/i2o (or whatever the base of the device name is) to the list of "valid" LVM devices. You also need to add the block major(s) to at least lvm_check_dev.c, lvm_check_partitioned_dev.c.

Quoted 4 lines

The issue of LVM handling partitions/devices/etc itself has caused problems in the past, and will probably cause problems in the future. The solution is to have LVM allow anything in /proc/partitions, and only fall back on its internal checks if /proc/partitions doesn't exist.

It does this since 0.8final.

_But_ in case a partiton is used to set up a Physical Volume it additionally checks the partition type identifier to avoid accidents like overwriting a native Linux partition.

If /proc/partitions would provide a Partition Type Identifier as well, some of the problem causing LVM library code could be dropped.

Quoted 2 lines

Cheers, Andreas

Signature · 12 lines
Regards,
Heinz      -- The LVM guy --

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Bartningstr. 12
                                                  64289 Darmstadt
                                                  Germany
[email protected]                           +49 6151 7103 86
                                                       FAX 7103 96
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw

Heinz, you write:

Quoted 3 lines

_But_ in case a partiton is used to set up a Physical Volume it additionally checks the partition type identifier to avoid accidents like overwriting a native Linux partition.

This is "overly safe" and adds complexity to LVM. There is no such safety check for mkfs or mkswap or fdisk or any number of other ways to destroy your disk...

Cheers, Andreas

#3 lore raw
Quoted 8 lines · Andreas Dilger

Heinz, you write:

Quoted 3 lines

_But_ in case a partiton is used to set up a Physical Volume it additionally checks the partition type identifier to avoid accidents like overwriting a native Linux partition.

This is "overly safe" and adds complexity to LVM. There is no such safety check for mkfs or mkswap or fdisk or any number of other ways to destroy your disk...

That's obviously right ;-{(

If we drop the safety code in the LVM we will still have our officially registered 0x8E LVM partiton type identifier which could even be missleading, because the partition might be used for different purposes than beeing used by LVM.

Other opinions?

Signature · 12 lines
Regards,
Heinz      -- The LVM guy --

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Bartningstr. 12
                                                  64289 Darmstadt
                                                  Germany
[email protected]                           +49 6151 7103 86
                                                       FAX 7103 96
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#4 lore raw
Quoted 4 lines · Heinz J. Mauelshagen
Quoted 3 lines · Andreas Dilger

This is "overly safe" and adds complexity to LVM. There is no such safety check for mkfs or mkswap or fdisk or any number of other ways to destroy your disk...

But mkfs and mkswap are tools that are normally only called manually by an administrator who should know what he does.

Some lvm tools are called automatically from startup scripts, and if the partition tables or other config have been changed they may try to access the wrong partition, so some additional checks may be reasonable.

Quoted 4 lines

If we drop the safety code in the LVM we will still have our officially registered 0x8E LVM partiton type identifier which could even be missleading, because the partition might be used for different purposes than beeing used by LVM.

What about making it a command line option? I can see three possible behaviours:

- no checking of partition types at all
- use /proc/partitions, but do the partition type check wherever possible. If we don't know where the partition table for a given partition is, try to use the partition
- require valid partition type, as we currently do. If we don't know how to find the partition type, don't use the partition.

I think the second mode could be the default. The first one is not too usefull, but we may have some kind of --force option that skips the checks, some people want to be able to shoot themselves in the foot.

Jan