LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-28-2013, 06:37 PM   #1
geekasaurus
LQ Newbie
 
Registered: Apr 2008
Posts: 12

Rep: Reputation: 0
Linux RAID 1 with mdadm


I've been working on this project for a week. I've about given up!

This should be a lead-pipe cinch.....

I have a default install of Ubuntu 12.04. For some reason, the installer used sdb instead of sda. They are identical 1TB drives.

When I use "mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb2 /dev/sda2"

I get "mdadm: Failed to write metadata to /dev/sdb". The device /dev/md0 is created but does not appear to function at all.

Here is the complete output of the command.
~# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb2 /dev/sda2
mdadm: /dev/sdb2 appears to be part of a raid array:
level=raid0 devices=0 ctime=Wed Dec 31 18:00:00 1969
mdadm: partition table exists on /dev/sdb2 but will be lost or
meaningless after creating array
mdadm: Note: this array has metadata at the start and
may not be suitable as a boot device. If you plan to
store '/boot' on this device please ensure that
your boot-loader understands md/v1.x metadata, or use
--metadata=0.90
mdadm: /dev/sda2 appears to be part of a raid array:
level=raid0 devices=0 ctime=Wed Dec 31 18:00:00 1969
mdadm: partition table exists on /dev/sda2 but will be lost or
meaningless after creating array
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata


Further information:
# fdisk -l

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00048e18

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1920495615 960246784 83 Linux
/dev/sda2 1920497662 1953523711 16513025 5 Extended
/dev/sda5 1920497664 1953523711 16513024 82 Linux swap / Solaris

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0006d2c9

Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 32770047 16384000 83 Linux
/dev/sdb2 32772094 1953523711 960375809 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sdb5 1922275328 1953523711 15624192 82 Linux swap / Solaris
/dev/sdb6 32772096 64020479 15624192 83 Linux
/dev/sdb7 64022528 126521343 31249408 83 Linux
/dev/sdb8 126523392 189022207 31249408 83 Linux
/dev/sdb9 189024256 1922271231 866623488 83 Linux

Partition table entries are not in disk order
 
Old 07-28-2013, 07:32 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 1,985

Rep: Reputation: Disabled
Quote:
Originally Posted by geekasaurus View Post
~# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb2 /dev/sda2
OK, so you want to make a RAID array out of /dev/sda2 and /dev/sdb2, but...

Quote:
Originally Posted by geekasaurus View Post
/dev/sda2 1920497662 1953523711 16513025 5 Extended
Quote:
Originally Posted by geekasaurus View Post
/dev/sdb2 32772094 1953523711 960375809 5 Extended
...according to the output from fdisk, those two partitions are both extended partitions, which means they cannot be directly used for anything. They are containers for logical partitions.

You need to create one or more logical partitions inside /dev/sda2 and /dev/sdb2, like you've already done with /dev/sd[ab]5 and /dev/sdb[6-9].
 
1 members found this post helpful.
Old 07-28-2013, 08:51 PM   #3
geekasaurus
LQ Newbie
 
Registered: Apr 2008
Posts: 12

Original Poster
Rep: Reputation: 0
First of all, thanks very much for your reply. I was coming to this conclusion, albeit slowly.

I have partitions on /dev/sdb for /boot, /, /usr, /var and /home. So I need to create 5 mirrors, one for each partition?

I need to make /dev/sda bootable in case /dev/sdb dies. Will this occur when I mirror /boot?
 
  


Reply

Tags
mdadm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions on Linux Raid (mdadm) and how well it works? unseengundam Linux - Software 4 02-01-2013 03:47 PM
LXer: Software RAID on Linux with mdadm LXer Syndicated Linux News 0 03-30-2011 01:50 PM
Linux Software RAID 1+0 (using mdadm) barrulus Fedora 2 02-07-2006 09:21 AM
Linux raid with mdadm eyt Linux - Newbie 6 02-07-2006 05:26 AM


All times are GMT -5. The time now is 05:17 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration