Skip to contentSkip to conversation

LVM2 on RAID

linux-lvm Christian Purnomo 3 participants 5 messages Apr 27, 2005

lore
Share & tools
lore
#0 lore raw

Hi All

I use gentoo, lvm2, raid (lvm on top of raid-1). My problem is that the kernel doesn't automatically detect my /dev/md[2-8] as the partitions are set to 8e (LVM2) instead of 0xFD ... the solution I have at the moment is to append md=2,/dev/sdXY,/dev/sdAB and so forth to my grub.conf.

Is it safe to change the partition types from 8e to 0xFD? will I break my lvm?

Many thanks

Christian.

#1 lore raw
Quoted 10 lines · [email protected] (Christian Purnomo) writes:

Hi All

I use gentoo, lvm2, raid (lvm on top of raid-1). My problem is that the kernel doesn't automatically detect my /dev/md[2-8] as the partitions are set to 8e (LVM2) instead of 0xFD ... the solution I have at the moment is to append md=2,/dev/sdXY,/dev/sdAB and so forth to my grub.conf.

Is it safe to change the partition types from 8e to 0xFD? will I break my lvm?

It should be safe. That's how I have mine set up.

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#2 lore raw

Thanks,

I have tried changing the partitions type to 0xFD and the auto detects kicked in and LVM still worked like a charm.

However I found this from mailling list archive

/* start quote */

From: Luca Berra <bluca comedia it>
To: linux-lvm redhat com
Subject: Re: [linux-lvm] Re: putting lvm autodetect into the kernel ala md
Date: Fri, 1 Apr 2005 19:41:22 +0200

quote Neil Brown back in july 2001

"autorun/autodetect just doesn't belong in the kernel. It should be done in user space. The only time the kernel should assemble a raid array itself is for the root device, and this is best done with md=0,/dev/whatever,etc

If I could start with a clean slate, I would rip out the autodetect stuff completely. But lots of people are depending on it so I cannot."

anyway the major issues are:
1) raid autodetect uses only the minor number stored in the superblock to identify the array components, move a disk from a different machine to yours and reboot it to enjoy the show
2) raid autodetect will try to start everything it finds, it will not scale with shared storage, or other complex configurations

/* end quote */

Can anyone conclude that passing the parameter md=0,/dev/* to kernel parameter is a better approach than using auto detect? I don't have a problem with having a rather long parameters in my grub.conf/lilo.conf.

Thanks

Christian.

Subject: [linux-lvm] Re: LVM2 on RAID
Date: Wed, Apr 27, 2005 at 12:20:15PM +0200
Quoting M?ns Rullg?rd ([email protected]):

: [email protected] (Christian Purnomo) writes:
:
: > Hi All
: >
: > I use gentoo, lvm2, raid (lvm on top of raid-1). My problem is that : > the kernel doesn't automatically detect my /dev/md[2-8] as the : > partitions are set to 8e (LVM2) instead of 0xFD ... the solution I : > have at the moment is to append md=2,/dev/sdXY,/dev/sdAB and so : > forth to my grub.conf.
: >
: > Is it safe to change the partition types from 8e to 0xFD? will I : > break my lvm?
:
: It should be safe. That's how I have mine set up.
:
: --
: M?ns Rullg?rd
: [email protected]
:
: _______________________________________________
: linux-lvm mailing list
: [email protected]
: https://www.redhat.com/mailman/listinfo/linux-lvm
: read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#3 lore raw
Quoted 21 lines · [email protected] (Christian Purnomo) writes:

Thanks,

I have tried changing the partitions type to 0xFD and the auto detects kicked in and LVM still worked like a charm.

However I found this from mailling list archive

/* start quote */

From: Luca Berra <bluca comedia it>
To: linux-lvm redhat com
Subject: Re: [linux-lvm] Re: putting lvm autodetect into the kernel ala md
Date: Fri, 1 Apr 2005 19:41:22 +0200

quote Neil Brown back in july 2001

"autorun/autodetect just doesn't belong in the kernel. It should be done in user space. The only time the kernel should assemble a raid array itself is for the root device, and this is best done with md=0,/dev/whatever,etc

Quoted 7 lines

If I could start with a clean slate, I would rip out the autodetect stuff completely. But lots of people are depending on it so I cannot."

anyway the major issues are:
1) raid autodetect uses only the minor number stored in the superblock to identify the array components, move a disk from a different machine to yours and reboot it to enjoy the show

Is this really true? My kernel log has messages like these:

md: Autodetecting RAID arrays.
md: autorun ...
md: considering sdb3 ...
md:  adding sdb3 ...
md: sdb1 has different UUID to sdb3
md:  adding sda3 ...
md: sda1 has different UUID to sdb3
md: created md2

If it uses the UUID, there should be little risk of misdetection.

A problem I have run into with LVM, was disks from different machines, using the same VG names.

Quoted 9 lines

2) raid autodetect will try to start everything it finds, it will not scale with shared storage, or other complex configurations

/* end quote */

Can anyone conclude that passing the parameter md=0,/dev/* to kernel parameter is a better approach than using auto detect? I don't have a problem with having a rather long parameters in my grub.conf/lilo.conf.

As usual, both ways have their own advantages and disadvantages. What I like about autodetection, is that things just work, even if I shuffle my disks for some reason.

Signature · 2 lines
M�ns Rullg�rd
[email protected]
#4 lore raw
Quoted 3 lines · M�ns Rullg�rd
Quoted 3 lines

/* start quote */

From: Luca Berra <bluca comedia it>

....

Quoted 16 lines
Quoted 4 lines

anyway the major issues are:
1) raid autodetect uses only the minor number stored in the superblock to identify the array components, move a disk from a different machine to yours and reboot it to enjoy the show

Is this really true? My kernel log has messages like these:

md: Autodetecting RAID arrays.
md: autorun ...
md: considering sdb3 ...
md:  adding sdb3 ...
md: sdb1 has different UUID to sdb3
md:  adding sda3 ...
md: sda1 has different UUID to sdb3
md: created md2
Quoted 1 line

If it uses the UUID, there should be little risk of misdetection.

the issue is: if it finds the wrong one before the right one

Quoted 3 lines

A problem I have run into with LVM, was disks from different machines, using the same VG names.

very true.

Quoted 9 lines
Quoted 4 lines

Can anyone conclude that passing the parameter md=0,/dev/* to kernel parameter is a better approach than using auto detect? I don't have a problem with having a rather long parameters in my grub.conf/lilo.conf.

As usual, both ways have their own advantages and disadvantages. What I like about autodetection, is that things just work, even if I shuffle my disks for some reason.

what i did is write mdassemble to be used in initrds
it uses a mdadm.conf file where you can put the UUID and have all disk that match a specific UUID be assembled in your MD

L.

Signature · 6 lines
Luca Berra -- [email protected]
       Communication Media & Services S.r.l.
/"\
\ /     ASCII RIBBON CAMPAIGN
 X        AGAINST HTML MAIL
/ \