[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to increase the maximal number of partitions ?
From: |
Bryn M. Reeves |
Subject: |
Re: How to increase the maximal number of partitions ? |
Date: |
Tue, 04 Nov 2008 15:26:35 +0000 |
User-agent: |
Thunderbird 2.0.0.16 (X11/20080723) |
Jean-Philippe BATTU wrote:
Hello
on a linux box, I use parted over a 800Gb array raid 5 disks. I would
like to store in this array, about 20 partitions of 30 Go each.
You can't do that...
I create all these partitions with parted without any problem,
primary, extended and logical as follow:
GNU Parted 1.8.1
Using /dev/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Model: AOC-USA arraypdp (scsi)
Disk /dev/sdd: 800GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
I'm not sure why you have extended/logical partitions, since you're
using GPT. The idea of extended and logical partitions is specific to
the MSDOS partition table format - it was introduced with Windows 95 as
a hack to allow more than 4 partitions to be represented.
These partition types don't really have any meaning in GPT which doesn't
have the limitations that required the use of this trick for MSDOS
tables. It's possibly a bug that parted allowed you to do this.
In general though, different disk label types will permit different
numbers of partitions to be created. GPT doesn't specify a limit but a
set number of partition entries must be reserved when the label is
created. Parted reserves 47 entries by default, other operating systems
may reserve as many as 128.
when I exit from parted, only the first sixteenth partitions have been
created. How to say to the linux system to create more than 16 devices
for my logical volumes ?
This is the actual problem you are having. Linux SCSI device numbering
only allows for 16 devices per SCSI disk - one for the whole disk device
and up to 16 partitions. This is hard-coded into the numbering scheme
for SCSI disks and cannot be altered trivially. For e.g.:
# ls -l /dev/sd[ab]
brw-rw---- 1 root disk 8, 0 Nov 3 12:39 /dev/sda
brw-rw---- 1 root disk 8, 16 Nov 3 12:39 /dev/sdb
The kernel gives sda (the whole disk) a major number of 8 and a minor
number of 0. Partitions on sda are numbered 8:1, 8:2 etc. up to 8:15:
# ls -l /dev/sda1 /dev/sda15
brw-rw---- 1 root disk 8, 1 Nov 3 12:39 /dev/sda1
brw-rw---- 1 root disk 8, 15 Nov 3 12:39 /dev/sda15
The next disk (sdb) then picks up at 8:16 for the whole disk, 8:17 for
the 1st partition and so on:
# ls -l /dev/sdb /dev/sdb1
brw-rw---- 1 root disk 8, 16 Nov 3 12:39 /dev/sdb
brw-rw---- 1 root disk 8, 17 Nov 3 12:39 /dev/sdb1
As a nasty hack, you can probably use the kpartx command from the
multipath-tools project to create device-mapper maps that would allow
you to access the partitions you have created. Run "kpartx -a <dev>" and
you should see new devices created in /dev/mapper (assuming you have
device-mapper support in your kernel). E.g. for a device named "foo"
with three partitions, you might have /dev/mapper/foo1, /dev/mapper/foo2
etc. If the device name ends with a numeral, kpartx will also add a "p"
before the partition index (e.g. foo0p1, foo0p2 etc.).
This will get you to your data, but I would strongly encourage you to
consider re-thinking your partitioning scheme - it really doesn't make
sense to have this many partitions on a single device.
If you really need this number of logical devices, consider using a
logical volume manager like LVM2 instead.
Regards,
Bryn.