2003-05-05 16:17:42

by Ezra Nugroho

[permalink] [raw]
Subject: partitions in meta devices

I am curious if partitioning meta devices is allowed or not.

I just created a software raid array, md0 with 240G logical size.
I want to partition that into two, 100G and the rest.

I used fdisk to create the partitions, and it worked, result:

bangalore exports # fdisk /dev/md0

Command (m for help): p

Disk /dev/md0: 247.0 GB, 247044636672 bytes
2 heads, 4 sectors/track, 60313632 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Device Boot Start End Blocks Id System
/dev/md0p1 1 24414064 97656254 83 Linux
/dev/md0p2 24414065 60313632 143598272 83 Linux


however, I couldn't create any file system for them, or mount them.
/dev/md0px just don't exist.

Do I need to partition the drives first before creating the raids?
I use devfs instead of file based /dev

Thanks,



2003-05-05 16:28:53

by Carl-Daniel Hailfinger

[permalink] [raw]
Subject: Re: partitions in meta devices

Ezra Nugroho wrote:
> I am curious if partitioning meta devices is allowed or not.
>
> I just created a software raid array, md0 with 240G logical size.
> I want to partition that into two, 100G and the rest.
>
> I used fdisk to create the partitions, and it worked, result:
>
> bangalore exports # fdisk /dev/md0
>
> Command (m for help): p
>
> Disk /dev/md0: 247.0 GB, 247044636672 bytes
> 2 heads, 4 sectors/track, 60313632 cylinders
> Units = cylinders of 8 * 512 = 4096 bytes
>
> Device Boot Start End Blocks Id System
> /dev/md0p1 1 24414064 97656254 83 Linux
> /dev/md0p2 24414065 60313632 143598272 83 Linux
>
>
> however, I couldn't create any file system for them, or mount them.
> /dev/md0px just don't exist.
>
> Do I need to partition the drives first before creating the raids?
> I use devfs instead of file based /dev

Please reboot after partitioning.

HTH,
Carl-Daniel

2003-05-05 16:31:57

by Ezra Nugroho

[permalink] [raw]
Subject: Re: partitions in meta devices


On Mon, 2003-05-05 at 11:39, Carl-Daniel Hailfinger wrote:
> Ezra Nugroho wrote:
> > I am curious if partitioning meta devices is allowed or not.
> >
> > I just created a software raid array, md0 with 240G logical size.
> > I want to partition that into two, 100G and the rest.
> >
> > I used fdisk to create the partitions, and it worked, result:
> >
> > bangalore exports # fdisk /dev/md0
> >
> > Command (m for help): p
> >
> > Disk /dev/md0: 247.0 GB, 247044636672 bytes
> > 2 heads, 4 sectors/track, 60313632 cylinders
> > Units = cylinders of 8 * 512 = 4096 bytes
> >
> > Device Boot Start End Blocks Id System
> > /dev/md0p1 1 24414064 97656254 83 Linux
> > /dev/md0p2 24414065 60313632 143598272 83 Linux
> >
> >
> > however, I couldn't create any file system for them, or mount them.
> > /dev/md0px just don't exist.
> >
> > Do I need to partition the drives first before creating the raids?
> > I use devfs instead of file based /dev
>
> Please reboot after partitioning.

I did. Nothing changed. fdisk reported the changes still.


2003-05-05 16:50:35

by Carl-Daniel Hailfinger

[permalink] [raw]
Subject: Re: partitions in meta devices

Ezra Nugroho wrote:
> On Mon, 2003-05-05 at 11:39, Carl-Daniel Hailfinger wrote:
>
>>Ezra Nugroho wrote:
>>
>>>however, I couldn't create any file system for them, or mount them.
>>>/dev/md0px just don't exist.
>>>
>>
>>Please reboot after partitioning.
>
> I did. Nothing changed. fdisk reported the changes still.

OK. Maybe I wasn't clear enough.
1. Partition a drive
2. Reboot
3. Now the kernel should see the partitions and let you create file
systems on them.

You rebooted and fdisk sees the partitions now. Fine. Please try to
mke2fs /dev/md0p1
That should work. If it doesn't, devfs could be the problem.

Could you please tell us which kernel version you're using?

Carl-Daniel

2003-05-05 16:56:32

by Ezra Nugroho

[permalink] [raw]
Subject: Re: partitions in meta devices

On Mon, 2003-05-05 at 11:59, Carl-Daniel Hailfinger wrote:
> Ezra Nugroho wrote:
> > On Mon, 2003-05-05 at 11:39, Carl-Daniel Hailfinger wrote:
> >
> >>Ezra Nugroho wrote:
> >>
> >>>however, I couldn't create any file system for them, or mount them.
> >>>/dev/md0px just don't exist.
> >>>
> >>
> >>Please reboot after partitioning.
> >
> > I did. Nothing changed. fdisk reported the changes still.
>
> OK. Maybe I wasn't clear enough.
> 1. Partition a drive
> 2. Reboot
> 3. Now the kernel should see the partitions and let you create file
> systems on them.

Did all that, kernel didn't see the partition.

> You rebooted and fdisk sees the partitions now. Fine. Please try to
> mke2fs /dev/md0p1

This didn't work, because /dev/md0p1 doesn't exists.

> That should work. If it doesn't, devfs could be the problem.

It could be.

> Could you please tell us which kernel version you're using?

My linux is:
Linux version 2.4.20 (root@localhost) (gcc version 3.2.2)

kernel config related to raid:

#
# Multi-device support (RAID and LVM)
#
CONFIG_MD=y
CONFIG_BLK_DEV_MD=m
CONFIG_MD_LINEAR=m
CONFIG_MD_RAID0=m
CONFIG_MD_RAID1=m
CONFIG_MD_RAID5=m
CONFIG_MD_MULTIPATH=m
# CONFIG_BLK_DEV_LVM is not set


My raidtab is:
raiddev /dev/md0
raid-level 5
nr-raid-disks 3
nr-spare-disks 0
persistent-superblock 1
chunk-size 32
parity-algorithm left-symmetric

device /dev/hdc
raid-disk 0
device /dev/hde
raid-disk 1
device /dev/hdg
raid-disk 2


any idea?

2003-05-05 17:06:38

by Bernd Schubert

[permalink] [raw]
Subject: Re: partitions in meta devices

On Monday 05 May 2003 18:57, Ezra Nugroho wrote:
> On Mon, 2003-05-05 at 11:39, Carl-Daniel Hailfinger wrote:
> > Ezra Nugroho wrote:
> > > I am curious if partitioning meta devices is allowed or not.
> > >
> > > I just created a software raid array, md0 with 240G logical size.
> > > I want to partition that into two, 100G and the rest.
> > >

Hi,

this is a question for [email protected]. Regarding to a thread about
a recent thread of this topic (I currently don't have the time to search it),
partitioning of md-devices is not possible. You have to use LVM if you want
to do something like this.

Bernd

2003-05-05 17:09:41

by Jörn Engel

[permalink] [raw]
Subject: Re: partitions in meta devices

On Mon, 5 May 2003 18:39:13 +0200, Carl-Daniel Hailfinger wrote:
> Ezra Nugroho wrote:
>> [partitioning problems]
>
> Please reboot after partitioning.

This has always been bothering me. Why?
As long as no mounted partitions have been changed, I fail to see any
need for a reboot, except maybe lazy programming.

s/mounted/used/ for correctness fanatics.

J?rn

--
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.
-- M.A. Jackson

2003-05-05 19:03:36

by Al Viro

[permalink] [raw]
Subject: Re: partitions in meta devices

On Mon, May 05, 2003 at 06:59:47PM +0200, Carl-Daniel Hailfinger wrote:

> OK. Maybe I wasn't clear enough.
> 1. Partition a drive
> 2. Reboot
> 3. Now the kernel should see the partitions and let you create file
> systems on them.
>
> You rebooted and fdisk sees the partitions now. Fine. Please try to
> mke2fs /dev/md0p1
> That should work. If it doesn't, devfs could be the problem.

No, it should not. And devfs, for once, has nothing to do with it.
RAID devices (md*) have _one_ (1) minor allocated to each. Consequently,
they could not be partitioned by any kernel - there is no device numbers
to be assigned to their partitions.

> Could you please tell us which kernel version you're using?

What would be much more interesting, which kernel are _you_ using
and what device numbers, in your experience, do these partitions get?

2003-05-05 19:44:43

by Carl-Daniel Hailfinger

[permalink] [raw]
Subject: Re: partitions in meta devices

[email protected] wrote:
> On Mon, May 05, 2003 at 06:59:47PM +0200, Carl-Daniel Hailfinger wrote:
>
>>Could you please tell us which kernel version you're using?
>
> What would be much more interesting, which kernel are _you_ using
> and what device numbers, in your experience, do these partitions get?

2.4.21-rc1 and no, I don't use RAID devices. Just plain old partitions
on /dev/hda, CONFIG_MSDOS_PARTITION=y

Ezra Nugroho wrote:

>>> Device Boot Start End Blocks Id System
>>> /dev/md0p1 1 24414064 97656254 83 Linux
>>> /dev/md0p2 24414065 60313632 143598272 83 Linux

That confused me. Assuming these entries were correct, I tried the
standard "kernel sees new partitions only after reboot" procedure.
GIGO.

2003-05-05 21:19:56

by Wakko Warner

[permalink] [raw]
Subject: Re: partitions in meta devices

> > OK. Maybe I wasn't clear enough.
> > 1. Partition a drive
> > 2. Reboot
> > 3. Now the kernel should see the partitions and let you create file
> > systems on them.
> >
> > You rebooted and fdisk sees the partitions now. Fine. Please try to
> > mke2fs /dev/md0p1
> > That should work. If it doesn't, devfs could be the problem.
>
> No, it should not. And devfs, for once, has nothing to do with it.
> RAID devices (md*) have _one_ (1) minor allocated to each. Consequently,
> they could not be partitioned by any kernel - there is no device numbers
> to be assigned to their partitions.
>
> > Could you please tell us which kernel version you're using?
>
> What would be much more interesting, which kernel are _you_ using
> and what device numbers, in your experience, do these partitions get?

I recall an MdPart patch for the kernel that would allow this, however, it
was way too buggy for real use. google for mdpart.

--
Lab tests show that use of micro$oft causes cancer in lab animals

2003-05-05 22:39:19

by Chuck Ebbert

[permalink] [raw]
Subject: Re: partitions in meta devices

> No, it should not. And devfs, for once, has nothing to do with it.
> RAID devices (md*) have _one_ (1) minor allocated to each. Consequently,
> they could not be partitioned by any kernel - there is no device numbers
> to be assigned to their partitions.
>
> > Could you please tell us which kernel version you're using?
>
> What would be much more interesting, which kernel are _you_ using
> and what device numbers, in your experience, do these partitions get?

These patches appear to contain raid partitioning code of some sort:

http://www.cse.unsw.edu.au/~neilb/patches/linux-stable/

Only the first 16 md devices can be partitioned, though... major is 60,
minors are 0-15 for md0, 16-31 for md1, etc.


2003-05-06 23:54:15

by NeilBrown

[permalink] [raw]
Subject: Re: partitions in meta devices

On Monday May 5, [email protected] wrote:
> > > OK. Maybe I wasn't clear enough.
> > > 1. Partition a drive
> > > 2. Reboot
> > > 3. Now the kernel should see the partitions and let you create file
> > > systems on them.
> > >
> > > You rebooted and fdisk sees the partitions now. Fine. Please try to
> > > mke2fs /dev/md0p1
> > > That should work. If it doesn't, devfs could be the problem.
> >
> > No, it should not. And devfs, for once, has nothing to do with it.
> > RAID devices (md*) have _one_ (1) minor allocated to each. Consequently,
> > they could not be partitioned by any kernel - there is no device numbers
> > to be assigned to their partitions.
> >
> > > Could you please tell us which kernel version you're using?
> >
> > What would be much more interesting, which kernel are _you_ using
> > and what device numbers, in your experience, do these partitions get?
>
> I recall an MdPart patch for the kernel that would allow this, however, it
> was way too buggy for real use. google for mdpart.

Unreported bugs don't get fixed ... or did I miss your report?

Work great for me on most of my servers.

NeilBrown