Go Back   Technibble Forums > Operating Systems > Linux

  Technibble Sponsor

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2012, 06:18 AM
tankman1989's Avatar
tankman1989 tankman1989 is offline
 
Join Date: Apr 2009
Posts: 2,152
tankman1989 is on a distinguished road
Question Linux softRAID 5 array (mdadm) creation problem - anyone know what to do?

I am creating a software RAID 5 array and I am getting a strange output response from the create array command. It is listing the sizes of the partitions available and it is not correct at all. I have 5 500GB drives as listed in the Fdisk -l command below and they all appear to have the same number of blocks and the disk sizes are all listed the same. I just created the partitions in Fdisk and all the disks were empty. Can anyone tell me what is going on here?

The create command is at the bottom of the code.

Code:
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x07df3ce0

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008c8f9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3bf537ab

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sde: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x44fdfe06

   Device Boot      Start         End      Blocks   Id  System
/dev/sde1               1       60801   488384001   fd  Linux raid autodetect

Disk /dev/sdf: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a4906

root@fserve:/home/mike# mdadm --create --verbose /dev/md0 --level=5 --raid-devices=5 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 512K
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: /dev/sda1 appears to contain an ext2fs file system
    size=488384000K  mtime=Fri Mar 23 00:52:34 2012
mdadm: layout defaults to left-symmetric
mdadm: /dev/sdb1 appears to contain an ext2fs file system
    size=8032468K  mtime=Fri Mar 23 00:55:34 2012
mdadm: layout defaults to left-symmetric
mdadm: /dev/sdc1 appears to contain an ext2fs file system
    size=24097468K  mtime=Fri Mar 23 00:55:50 2012
mdadm: layout defaults to left-symmetric
mdadm: /dev/sdd1 appears to contain an ext2fs file system
    size=488384000K  mtime=Fri Mar 23 00:56:01 2012
mdadm: layout defaults to left-symmetric
mdadm: size set to 488382464K
Continue creating array?
Reply With Quote
  #2  
Old 03-23-2012, 11:00 AM
kwisher's Avatar
kwisher kwisher is offline
 
Join Date: Nov 2009
Posts: 86
kwisher is an unknown quantity at this point
Default

I'm not sure about your exact problem but maybe the how-to guide I use may provide some answers. If not I have some more if this doesn't help.
http://www.howtoforge.com/software-r...ot-debian-etch
__________________
The instructions said "Requires Windows XP or better". So I installed Linux.
Reply With Quote
  #3  
Old 04-07-2012, 02:55 PM
SouthernTech SouthernTech is offline
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 47
SouthernTech is an unknown quantity at this point
Default

Did you have a prior RAID on those drives?
Reply With Quote
  #4  
Old 04-09-2012, 01:32 PM
Bigj Bigj is offline
 
Join Date: Dec 2011
Posts: 15
Bigj is an unknown quantity at this point
Default

you need to clear the existing partition info off first. I know it should when you do the original fdisk and set it to linux raid autodetect but it doesnt.

Soooo you need to :

dd if=/dev/zero of=/dev/sda bs=512 count=2048
dd if=/dev/zero of=/dev/sdb bs=512 count=2048
dd if=/dev/zero of=/dev/sdc bs=512 count=2048
dd if=/dev/zero of=/dev/sdd bs=512 count=2048
dd if=/dev/zero of=/dev/sde bs=512 count=2048

then fdisk each drive back to how you have it now.
make sure you clean your /etc/mdadm.conf before recreating your new raid
now redo your mdadm command.

botta bing!

P.S = make sure your aligning them partitions. When you enter fdisk hit u "i think its u" to change it to sector and not human readable. MAKE sure your starting at a offset of 2048. I got a 15ish% in IOPS by aligning my partitions correctly. If this is a updated system then the new fdisk aligning by default.

P.S.S - No idea why it says ext partition. I had new drives and put them in my raid. When I went to rebuild the raid I ran into the same problem. Mine said it had a NTFS partition on it....... haha

Last edited by Bigj; 04-09-2012 at 01:38 PM.
Reply With Quote
  #5  
Old 04-09-2012, 01:37 PM
iisjman07's Avatar
iisjman07 iisjman07 is offline
 
Join Date: Jul 2009
Location: South End Of The UK
Posts: 3,049
iisjman07 has a spectacular aura aboutiisjman07 has a spectacular aura about
Default

Quote:
Originally Posted by Bigj View Post
you need to clear the existing partition info off first.
+1 Try this and see if it's better
__________________
put that in your pipe and grep it
Reply With Quote
  #6  
Old 04-09-2012, 03:51 PM
coffee's Avatar
coffee coffee is offline
 
Join Date: Oct 2011
Location: USA, Indiana
Posts: 1,670
coffee has a spectacular aura aboutcoffee has a spectacular aura about
Send a message via Skype™ to coffee
Post

I have setup quite a few raids in linux and currently run a 1TB raid on my home/business server. Setting up the raid is not very hard but can be confusing at times when you are first learning. What I can do for you is list the steps involved and you can go thru and make sure everything is good to go.
---------------------------------------------
First thing is first. Make sure the drives have NO partitions on them. You can do this by going into fdisk for each drive and deleteing all partitions on the drives (D command in fdisk). Make sure you hit W after you are done to write changes to disk. Also, What gets some is that you might need to re-read the partition tables on the drives after you are done otherwise they will show up like you never edited them. To have linux reread the tables issue the following command:

Quote:
partprobe
or for a particular drive:
Quote:
partprobe /dev/sdX
Now go into fdisk and make your partitions. On mine I just made ext2 partitions but you might want to make gpt partitions if your going to do a raid device larger than 3tb I do believe. Otherwise stuff like windows may not recognize the whole array. The choice is up to you. Linux will work on almost any type of partition as long as they are all the same (IMHO). Remember to (W)rite your changes in fdisk.

After all the drives are partitioned we will make the raid. In your case you are building a raid5 with 5 disks.

Quote:
mdadm --create /dev/md0 --level=raid5 --force /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1
(gee, what is your boot drive??)

after that is all done we can now format the raid

Quote:
mkfs.ext3 /dev/md0
To make it available to mount, add the following to /etc/fstab:
Quote:
/dev/md0 /mymountpoint ext3 defaults 0 0
Now mount that sucker!

Quote:
mount /dev/md0
Lets make sure that the raid starts on bootup otherwise you will have to assemble it manually everytime you boot.

Quote:
mdadm --detail --scan --verbose > /etc/mdadm.conf
---------------------------------------------------------

Below are some helpful commands:

---------------------------------------------------------

To remove a failed drive from the array:

Quote:
mdadm /dev/md0 -r /dev/sda1
To add a drive to the array:

Quote:
mdadm /dev/md0 -a /dev/sda1
To remove a spare drive from array that has failed:

Quote:
mdadm /dev/md0 --remove /dev/sdXX
To see which drive has failed, type this

Quote:
mdadm --detail /dev/md0
To manually assemble your raid if you rebooted without mdadm.conf file. Or something weird happened.

Quote:
mdadm --assemble --force /dev/md1 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
Manually stop a array:

Quote:
mdadm -s /dev/md0
-----------------------------------------------------

Hope this all helped.
__________________

www.renuecomputers.com
Reply With Quote
  #7  
Old 04-09-2012, 04:23 PM
Slaters Kustum Machines's Avatar
Slaters Kustum Machines Slaters Kustum Machines is online now
 
Join Date: Jun 2011
Location: Iowa
Posts: 1,160
Slaters Kustum Machines is on a distinguished road
Default

Quote:
Originally Posted by coffee View Post
I have setup quite a few raids in linux and currently run a 1TB raid on my home/business server. Setting up the raid is not very hard but can be confusing at times when you are first learning. What I can do for you is list the steps involved and you can go thru and make sure everything is good to go.
---------------------------------------------
First thing is first. Make sure the drives have NO partitions on them. You can do this by going into fdisk for each drive and deleteing all partitions on the drives (D command in fdisk). Make sure you hit W after you are done to write changes to disk. Also, What gets some is that you might need to re-read the partition tables on the drives after you are done otherwise they will show up like you never edited them. To have linux reread the tables issue the following command:



or for a particular drive:


Now go into fdisk and make your partitions. On mine I just made ext2 partitions but you might want to make gpt partitions if your going to do a raid device larger than 3tb I do believe. Otherwise stuff like windows may not recognize the whole array. The choice is up to you. Linux will work on almost any type of partition as long as they are all the same (IMHO). Remember to (W)rite your changes in fdisk.

After all the drives are partitioned we will make the raid. In your case you are building a raid5 with 5 disks.


(gee, what is your boot drive??)

after that is all done we can now format the raid



To make it available to mount, add the following to /etc/fstab:


Now mount that sucker!



Lets make sure that the raid starts on bootup otherwise you will have to assemble it manually everytime you boot.


---------------------------------------------------------

Below are some helpful commands:

---------------------------------------------------------

To remove a failed drive from the array:



To add a drive to the array:


To remove a spare drive from array that has failed:


To see which drive has failed, type this



To manually assemble your raid if you rebooted without mdadm.conf file. Or something weird happened.



Manually stop a array:


-----------------------------------------------------

Hope this all helped.
This looks like it should be in the Wiki or put in the Guides, Tips, and Tricks section as a How To.
Reply With Quote
  #8  
Old 04-09-2012, 06:38 PM
coffee's Avatar
coffee coffee is offline
 
Join Date: Oct 2011
Location: USA, Indiana
Posts: 1,670
coffee has a spectacular aura aboutcoffee has a spectacular aura about
Send a message via Skype™ to coffee
Default

Quote:
This looks like it should be in the Wiki or put in the Guides, Tips, and Tricks section as a How To.
Today 11:51 AM
I would but I would clean it up a bit more and be more indepth if I did. Dont have the time right now. Perhaps tonite or tomorrow I could.

thanx!

__________________

www.renuecomputers.com
Reply With Quote
  #9  
Old 04-09-2012, 08:18 PM
SouthernTech SouthernTech is offline
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 47
SouthernTech is an unknown quantity at this point
Default

Another command:

mdadm --zero-superblock <dev>

Removes the RAID superblock from the device. Just deleting a RAID will not remove it, which is why I asked if the drives were used before.
Reply With Quote
  #10  
Old 04-09-2012, 08:29 PM
tankman1989's Avatar
tankman1989 tankman1989 is offline
 
Join Date: Apr 2009
Posts: 2,152
tankman1989 is on a distinguished road
Default

I want to thank everyone for the support here!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:07 PM.


Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Technibble.com is based out of MELBOURNE, AUSTRALIA.