Skip to contentSkip to conversation

Raid5 to another raid level??

DISCUSSION Michael Busby 2 participants 6 messages Sep 7, 2011 – Oct 12, 2011 1 message not in the archive MD RAID

lore
Share & tools
lore
#0 lore raw

Thanks for taking the time to respond, I am now running a 4 disk raid5 soon to be upgraded to a 8 disk raid6

-- Sent from my HP TouchPadOn 7 Sep 2011 02:08, <[email protected]> wrote:

Quoted 10 lines · On Fri, 2 Sep 2011 14:11:57 +0100 Michael Busby <[email protected]>…

I am using the 3.0.0 kernel so that should not be a issue, have just upgraded mdadm on my box to 3.2.2 from 3.1.4

would i be right in thinking that to get from raid0 to raid5 i would first have to change from raid0 to raid4 and add the extra disk for parity, once i am at this level i would need a command to get the parity data striped over the raid5 and not in a single disk like raid4 or maybe there is a way to go from raid0 direct to raid5 by adding the extra disk and then having the parity data created and spread over the disks....

(I vaguely recall already replying to this but find no evidence - apologies if this is a duplicate).

RAID0 to RAID5 does happen in two stages but only one rebuild is needed. mdadm should make it all 'just work'.
i.e.
mdadm -G /dev/md0 -l 5 --raid-devices=4 --add /dev/sdf \
--backup-file=/root/md0-backup

This will:
- convert the array from RAID0 to RAID5 in a 'parity-last' layout, which is really the same thing as RAID4.
- 'freeze' recovery
- add /dev/sdf as a spare
- request a reshape to change the layout from 'parity-last' to 'left-symetric'
- 'unfreeze' recovery

Then the kernel will notice that a reshape is needed and allowed, will add the spare and start reshaping the array and creating parity at the same time.

So you don't need an intermediate state of a complete RAID4 - a degraded RAID4 is sufficient and handled automatically.

NeilBrown

Quoted 47 lines · NeilBrown
Quoted 45 lines
Quoted 7 lines · On Fri, 2 Sep 2011 11:35:30 +0100 Michael Busby <[email protected]>…

Great, will test that in a bit

will mdadm 3.2.2 support converting raid4 to raid5

"A RAID4 can change the number of devices or the size of individual devices. It cannot be converted to RAID5 yet (though that should be trivial to implement)"

I guess the man page needs updating.  You would need a reasonably recent kernel... 2.6.30 or later.  I guess that isn't so recent any more.

NeilBrown

Quoted 28 lines · NeilBrown
Quoted 26 lines
Quoted 8 lines · On Fri, 2 Sep 2011 10:12:32 +0100 Michael Busby <[email protected]>…

Thanks Neil

Is there anyway back from raid0 to raid4 as i know once at raid0 i will no longer be able to add any disks, in theory i could change echo raid0 > /sys/block/md0/md/level,but this would require adding a missing disk to the raid4 at the same time, not sure how easy that would be todo

Yes, you can switch from RAID0 to RAID4 in much the same way as you switch from RAID4 to RAID0.
You can then freeze/add-disk/change-size/unfreeze/wait/switch-back-to-RAID0 to add more devices.

mdadm-3.2.2 should be able to do all this for you.  i.e. you ask it to --grow a RAID and --add some disks at the same time, and it will do all the required magic.

This hasn't been tested extensively, but should work in simple cases.

Of course the more devices you have in a RAID0, the less reliability you have
- but e.g. as a cache for a tape backup system a large RAID0 is fine.

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAFsPQ__YdDnJw=qgLAq10vRbNPy4B_EhkV4FU0JAfovxnw9TxQ@mail.gmail.com

#2 lore raw

I have a quick question i remember reading somewhere about not using metadata version 0.9 with drives larger than 2tb,

Quoted 30 lines

at the moment i have the following

root@BlueBolt:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdd[2] sde[0] sdb[3] sdc[1]
      5860543488 blocks level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 2/15 pages [8KB], 65536KB chunk
unused devices: <none>
root@BlueBolt:~# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Mon Jul  4 15:08:38 2011
     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
  Intent Bitmap : Internal
    Update Time : Mon Oct 10 22:44:11 2011
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
         Layout : left-symmetric
     Chunk Size : 512K
           UUID : ddab6c38:dee3ead0:95ba4558:1c9a49ed (local to host BlueBolt)
         Events : 0.2836102
Quoted 8 lines
    Number   Major   Minor   RaidDevice State
       0       8       64        0      active sync   /dev/sde
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       16        3      active sync   /dev/sdb
which as you can see if using 0.90, i am looking at replacing all the 2tb drives with 3tb versions, would i need to update the metadata version? if so how can i go about this?
thanks
Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 38 lines · On Mon, 10 Oct 2011 22:47:58 +0100 Michael Busby <[email protected]>…

I have a quick question i remember reading somewhere about not using metadata version 0.9 with drives larger than 2tb,

Quoted 36 lines

at the moment i have the following

root@BlueBolt:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdd[2] sde[0] sdb[3] sdc[1]
      5860543488 blocks level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 2/15 pages [8KB], 65536KB chunk
unused devices: <none>
root@BlueBolt:~# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Mon Jul  4 15:08:38 2011
     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
  Intent Bitmap : Internal
    Update Time : Mon Oct 10 22:44:11 2011
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
         Layout : left-symmetric
     Chunk Size : 512K
           UUID : ddab6c38:dee3ead0:95ba4558:1c9a49ed (local to host BlueBolt)
         Events : 0.2836102
    Number   Major   Minor   RaidDevice State
       0       8       64        0      active sync   /dev/sde
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       16        3      active sync   /dev/sdb
which as you can see if using 0.90, i am looking at replacing all the 2tb drives with 3tb versions, would i need to update the metadata version? if so how can i go about this?

With a really recent kernel (3.1) and recent mdadm (also not released yet), 0.90 can go up to 4TB (it has 32 bits to count kilobytes with).

Alternately you need to convert to 1.0 metadata.

Currently the only way to do this is to 'create' the array again. Be sure to specified the same chunk size, the right metadata, the name level and number of disks, and the correct disks in the correct order. An use "--assume-clean". Then check your data is still consistent. With --assume-clean and a read-only mount, no data will actually be changed, only metadata.

NeilBrown

#4 lore raw

Thanks, can i just double check the command with you

mdadm --create /dev/md0 --chunk=512 --metadata=1.0 --assume-clean --level=5 --raid-devices=4 /dev/sde /dev/sdc /dev/sdd /dev/sdb

Quoted 47 lines · NeilBrown
Quoted 38 lines · On Mon, 10 Oct 2011 22:47:58 +0100 Michael Busby <[email protected]>…

I have a quick question i remember reading somewhere about not using metadata version 0.9 with drives larger than 2tb,

Quoted 36 lines

at the moment i have the following

root@BlueBolt:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdd[2] sde[0] sdb[3] sdc[1]
      5860543488 blocks level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 2/15 pages [8KB], 65536KB chunk
unused devices: <none>
root@BlueBolt:~# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Mon Jul  4 15:08:38 2011
     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
  Intent Bitmap : Internal
    Update Time : Mon Oct 10 22:44:11 2011
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
         Layout : left-symmetric
     Chunk Size : 512K
           UUID : ddab6c38:dee3ead0:95ba4558:1c9a49ed (local to host BlueBolt)
         Events : 0.2836102
    Number   Major   Minor   RaidDevice State
       0       8       64        0      active sync   /dev/sde
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       16        3      active sync   /dev/sdb
which as you can see if using 0.90, i am looking at replacing all the 2tb drives with 3tb versions, would i need to update the metadata version? if so how can i go about this?

With a really recent kernel (3.1) and recent mdadm (also not released yet), 0.90 can go up to 4TB (it has 32 bits to count kilobytes with).

Alternately you need to convert to 1.0 metadata.

Quoted 10 lines

Currently the only way to do this is to 'create' the array again. Be sure to specified the same chunk size, the right metadata, the name level and number of disks, and the correct disks in the correct order. An use "--assume-clean".  Then check your data is still consistent. With --assume-clean and a read-only mount, no data will actually be changed, only metadata.

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 5 lines · On Wed, 12 Oct 2011 10:25:16 +0100 Michael Busby <[email protected]>…

Thanks, can i just double check the command with you

mdadm --create /dev/md0 --chunk=512 --metadata=1.0 --assume-clean --level=5 --raid-devices=4 /dev/sde /dev/sdc /dev/sdd /dev/sdb

Correct. Of course you have to
mdadm --stop /dev/md0
first, but you knew that.

NeilBrown

Quoted 59 lines · NeilBrown
Quoted 57 lines
Quoted 38 lines · On Mon, 10 Oct 2011 22:47:58 +0100 Michael Busby <[email protected]>…

I have a quick question i remember reading somewhere about not using metadata version 0.9 with drives larger than 2tb,

Quoted 36 lines

at the moment i have the following

root@BlueBolt:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdd[2] sde[0] sdb[3] sdc[1]
      5860543488 blocks level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 2/15 pages [8KB], 65536KB chunk
unused devices: <none>
root@BlueBolt:~# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Mon Jul  4 15:08:38 2011
     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
  Intent Bitmap : Internal
    Update Time : Mon Oct 10 22:44:11 2011
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
         Layout : left-symmetric
     Chunk Size : 512K
           UUID : ddab6c38:dee3ead0:95ba4558:1c9a49ed (local to host BlueBolt)
         Events : 0.2836102
    Number   Major   Minor   RaidDevice State
       0       8       64        0      active sync   /dev/sde
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       16        3      active sync   /dev/sdb
which as you can see if using 0.90, i am looking at replacing all the 2tb drives with 3tb versions, would i need to update the metadata version? if so how can i go about this?

With a really recent kernel (3.1) and recent mdadm (also not released yet), 0.90 can go up to 4TB (it has 32 bits to count kilobytes with).

Alternately you need to convert to 1.0 metadata.

Currently the only way to do this is to 'create' the array again. Be sure to specified the same chunk size, the right metadata, the name level and number of disks, and the correct disks in the correct order. An use "--assume-clean".  Then check your data is still consistent. With --assume-clean and a read-only mount, no data will actually be changed, only metadata.

NeilBrown

#6 lore raw

Thanks that worked fine, i did have to shrink the partition down first though, but that's no biggie

Quoted 9 lines · NeilBrown
Quoted 5 lines · On Wed, 12 Oct 2011 10:25:16 +0100 Michael Busby <[email protected]>…

Thanks, can i just double check the command with you

mdadm --create /dev/md0 --chunk=512 --metadata=1.0 --assume-clean --level=5 --raid-devices=4 /dev/sde /dev/sdc /dev/sdd /dev/sdb

Quoted 68 lines

Correct.  Of course you have to
  mdadm --stop /dev/md0
first, but you knew that.

NeilBrown

Quoted 59 lines · NeilBrown
Quoted 57 lines
Quoted 38 lines · On Mon, 10 Oct 2011 22:47:58 +0100 Michael Busby <[email protected]>…

I have a quick question i remember reading somewhere about not using metadata version 0.9 with drives larger than 2tb,

Quoted 36 lines

at the moment i have the following

root@BlueBolt:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdd[2] sde[0] sdb[3] sdc[1]
      5860543488 blocks level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      bitmap: 2/15 pages [8KB], 65536KB chunk
unused devices: <none>
root@BlueBolt:~# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Mon Jul  4 15:08:38 2011
     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
  Intent Bitmap : Internal
    Update Time : Mon Oct 10 22:44:11 2011
          State : active
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0
         Layout : left-symmetric
     Chunk Size : 512K
           UUID : ddab6c38:dee3ead0:95ba4558:1c9a49ed (local to host BlueBolt)
         Events : 0.2836102
    Number   Major   Minor   RaidDevice State
       0       8       64        0      active sync   /dev/sde
       1       8       32        1      active sync   /dev/sdc
       2       8       48        2      active sync   /dev/sdd
       3       8       16        3      active sync   /dev/sdb
which as you can see if using 0.90, i am looking at replacing all the 2tb drives with 3tb versions, would i need to update the metadata version? if so how can i go about this?

With a really recent kernel (3.1) and recent mdadm (also not released yet), 0.90 can go up to 4TB (it has 32 bits to count kilobytes with).

Alternately you need to convert to 1.0 metadata.

Currently the only way to do this is to 'create' the array again. Be sure to specified the same chunk size, the right metadata, the name level and number of disks, and the correct disks in the correct order. An use "--assume-clean".  Then check your data is still consistent. With --assume-clean and a read-only mount, no data will actually be changed, only metadata.

NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html