LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   4x2TB drives in software RAID5 in Debian Lenny (https://www.linuxquestions.org/questions/linux-software-2/4x2tb-drives-in-software-raid5-in-debian-lenny-805435/)

superkikim 05-02-2010 06:44 AM

4x2TB drives in software RAID5 in Debian Lenny
 
Hi,

I'm about to hang myself... :-(

My goal is the following:

Software RAID 5 on 4 2TB caviar green disks. Then 12 partitions or about 500GB, and finally LVM to use the partitions as pv, and create some vg for my needs.

My disks are /dev/sda to /dev/sdd
I boot on /dev/sde which is an sd card

My doing (and at the end, my issue):

Code:

(parted) select /dev/sda
(parted) mklabel
Warning: The existing .... blablabla [msdos] ? gpt
(parted) select /dev/sdb
(parted) mklabel
Warning: The existing .... blablabla [msdos] ? gpt
(parted) select /dev/sdc
(parted) mklabel
Warning: The existing .... blablabla [msdos] ? gpt
(parted) select /dev/sdd
(parted) mklabel
Warning: The existing .... blablabla [msdos] ? gpt
quit

Then:

Code:

mdadm --create /dev/md0 --verbose --chunk=256 --level=5 --raid-devices=4 /dev/sda /dev/sdb /dev/sdc /dev/sdd
resulted in

Code:

mdadm: layout defaults to left-symmetric
mdadm: /dev/sda appears to be part of a raid array:
    level=raid5 devices=4 ctime=Sun May  2 04:59:56 2010
mdadm: /dev/sdb appears to be part of a raid array:
    level=raid5 devices=4 ctime=Sun May  2 04:59:56 2010
mdadm: /dev/sdc appears to be part of a raid array:
    level=raid5 devices=4 ctime=Sun May  2 04:59:56 2010
mdadm: /dev/sdd appears to be part of a raid array:
    level=raid5 devices=4 ctime=Sun May  2 04:59:56 2010
mdadm: size set to 1953514496K
Continue creating array? y
mdadm: array /dev/md0 started.

Here, I'm not sure why it set the size to 2TB. I thought it was the parity size... is it ?

anyhow, mdadm --detail /dev/md0 returns:

Code:

/dev/md0:
        Version : 00.90
  Creation Time : Sun May  2 13:32:02 2010
    Raid Level : raid5
    Array Size : 5860543488 (5589.05 GiB 6001.20 GB)
  Used Dev Size : 1953514496 (1863.02 GiB 2000.40 GB)
  Raid Devices : 4
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Sun May  2 13:33:27 2010
          State : clean, degraded, recovering
 Active Devices : 3
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 1

        Layout : left-symmetric
    Chunk Size : 256K

 Rebuild Status : 0% complete

          UUID : ec3fbf51:f7d0b544:16911994:d274d6b7 (local to host caprica)
        Events : 0.6

    Number  Major  Minor  RaidDevice State
      0      8        0        0      active sync  /dev/sda
      1      8      16        1      active sync  /dev/sdb
      2      8      32        2      active sync  /dev/sdc
      4      8      48        3      spare rebuilding  /dev/sdd

Seems correct to me so fare.

Therefore, I try now to partition /dev/md0:

1st thing's 1st, when I go into parted /dev/md0 I get the following question:

Code:

GNU Parted 1.8.8
Using /dev/md0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Error: The backup GPT table is not at the end of the disk, as it should be.  This might
mean that another operating system believes the disk is smaller.  Fix, by moving the
backup to the end (and removing the old backup)?
Fix/Cancel?

I type Fix and then I have the following:

Code:

Warning: Not all of the space available to /dev/md0 appears to be used, you can fix the
GPT to use all of the space (an extra 7814057808 blocks) or continue with the current
setting?
Fix/Ignore?

Therefore... Fix again...

Now a print gives me:

Code:

Model: Unknown (unknown)
Disk /dev/md0: 6001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

Doesn't looks bad... Then comes the problems:

Code:

mkpart part1 0 500GB
result:

Code:

Error: Error informing the kernel about modifications to partition /dev/md0p1 -- Invalid
argument.  This means Linux won't know about any changes you made to /dev/md0p1 until you
reboot -- so you shouldn't mount it or use it in any way before rebooting.
Ignore/Cancel?

I can go on with Ignore or Cancel, whatever. I can create all the partitions I want. It will gives this message for each partition everytime I make a parted command on the volume. Then, after reboot, there is no device node for the created partitions.

For the example, I just made one. After reboot, cat /proc/partitions returns:

Code:

cat /proc/partitions
major minor  #blocks  name

  8    0 1953514584 sda
  8    16 1953514584 sdb
  8    32 1953514584 sdc
  8    48 1953514584 sdd
  9    0 5860543488 md0
  8    64  15986688 sde
  8    65  15269751 sde1
  8    66          1 sde2
  8    69    714861 sde5

What the hell :-( What did I miss ...

deadeyes 05-03-2010 05:07 AM

Dont you have to create partitions on your disk and give them "fd" as type?
Just try to create a partition on each disk (I always use fdisk for this).

Then use the same mdadm command with /dev/sda1 , ... (or whatever they are called)

superkikim 05-03-2010 05:25 AM

Tx for your reply.

I tried this as well. No success. I tried to make label as GPT on the disks (then you need parted), and I tried to make label as msdos. I tried to make RAID type partitions, I tried everything I can think of...

What is surprising is that it seems that you cannot create partition over an md drive. I have installed ubuntu 10.4 for now, and tried to make the same configuration from the graphic interface from ubuntu. And it just doesn't let me partition the md device.

Googleling a bit more today, I found that indeed you cannot partition a software RAID device... You can only create a single volume, use it as pv for LVM, and then make a vg and create volumes over it. Which in fact leads to the same result as I wanted. But I didn't realized :-) I wished I had found this info about the fact you can't partition an md volume. I would not have wasted so much time trying ... The bad side is that neither parted nor fdisk nor cfdisk tells you you can't ! They make you believe it's working... But the device nodes are not created, and when you reboot it's all crappy ^^

harmscon 01-10-2011 05:59 PM

create the mdadm RAID array as partitionable
 
add this to your mdadm create line:
--auto=p7

that will get you a partitionable raid array with 7 partitions. see the mdadm man page for more detail on this option


All times are GMT -5. The time now is 03:33 AM.