LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2008, 01:40 PM   #1
priyank123
LQ Newbie
 
Registered: Apr 2008
Posts: 25

Rep: Reputation: 15
Question about RAID


hi i was trying to create RAID but i got some problem.
i have created /dev/md0 sucessfuly but when i m going to config th /dev/md1 i got error i have marked as RED color.
pls tell me what sould i do
i have write the all procedure which i have done.

thanku








[root@priyank ~]# fdisk -l

Disk /dev/sda: 10.4 GB, 10415295488 bytes
255 heads, 63 sectors/track, 1266 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1135 9116856 83 Linux
/dev/sda2 1136 1260 1004062+ 5 Extended
[root@priyank ~]# fdisk /dev/sda

The number of cylinders for this disk is set to 1266.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1136-1260, default 1136):
Using default value 1136
Last cylinder or +size or +sizeM or +sizeK (1136-1260, default 1260): +100M

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1149-1260, default 1149):
Using default value 1149
Last cylinder or +size or +sizeM or +sizeK (1149-1260, default 1260): +100M

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1162-1260, default 1162):
Using default value 1162
Last cylinder or +size or +sizeM or +sizeK (1162-1260, default 1260): +100M

Command (m for help): p

Disk /dev/sda: 10.4 GB, 10415295488 bytes
255 heads, 63 sectors/track, 1266 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1135 9116856 83 Linux
/dev/sda2 1136 1260 1004062+ 5 Extended
/dev/sda5 1136 1148 104391 83 Linux
/dev/sda6 1149 1161 104391 83 Linux
/dev/sda7 1162 1174 104391 83 Linux

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1175-1260, default 1175):
Using default value 1175
Last cylinder or +size or +sizeM or +sizeK (1175-1260, default 1260): +100M

Command (m for help): p

Disk /dev/sda: 10.4 GB, 10415295488 bytes
255 heads, 63 sectors/track, 1266 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1135 9116856 83 Linux
/dev/sda2 1136 1260 1004062+ 5 Extended
/dev/sda5 1136 1148 104391 83 Linux
/dev/sda6 1149 1161 104391 83 Linux
/dev/sda7 1162 1174 104391 83 Linux
/dev/sda8 1175 1187 104391 83 Linux

Command (m for help): t
Partition number (1-8): 8
Hex code (type L to list codes): fd
Changed system type of partition 8 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-8): 7
Hex code (type L to list codes): fd
Changed system type of partition 7 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-8): 6
Hex code (type L to list codes): fd
Changed system type of partition 6 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-8): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)

Command (m for help): wq
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
[root@priyank ~]# partprobe
[root@priyank ~]# mdadm -C /dev/md0 -l 1 -n 2 /dev/sda5 /dev/sda6
mdadm: array /dev/md0 started.
[root@priyank ~]# mdadm -C /dev/md1 -l 1 -n 2 /dev/sda7 /dev/sda8
mdadm: error opening /dev/md1: No such file or directory

[root@priyank ~]# fdisk -l

Disk /dev/sda: 10.4 GB, 10415295488 bytes
255 heads, 63 sectors/track, 1266 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1135 9116856 83 Linux
/dev/sda2 1136 1260 1004062+ 5 Extended
/dev/sda5 1136 1148 104391 fd Linux raid autodetect
/dev/sda6 1149 1161 104391 fd Linux raid autodetect
/dev/sda7 1162 1174 104391 fd Linux raid autodetect
/dev/sda8 1175 1187 104391 fd Linux raid autodetect

Disk /dev/md0: 106 MB, 106823680 bytes
2 heads, 4 sectors/track, 26080 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md0 doesn't contain a valid partition table
[root@priyank ~]#
 
Old 07-21-2008, 03:12 PM   #2
richardash1981
LQ Newbie
 
Registered: Aug 2006
Posts: 25
Blog Entries: 1

Rep: Reputation: 18
Can I start with Why?

RAIDing two partitions on the same device is a really, really bad idea. It certainly won't make your disk faster because the same physical heads have to seek back and forth across the surface for the two partitions. True, if you mirror the partitions then you get your data in two places, but on the same physical disk. Nearly all disk failures wipe out the entire drive however, so your gain in data security is negligible.

I suspect that the increased hard drive wear and tear from all the seeks will shorten it's life and increase the risk of failure a by a lot more than the gain in data integrity.

The actual problem is I suspect with the message:
Quote:
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Did you actually reboot the system? I suspect that you needed to before trying to run mdadm, and certainly before you mount the partitions (because if the kernel doesn't think the partitions are there, you certainly won't be able to mount them).
 
Old 07-21-2008, 06:26 PM   #3
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Slackware/Knoppix
Posts: 1,761
Blog Entries: 14

Rep: Reputation: 267Reputation: 267Reputation: 267
raid errors

I'll second the remarks about the overall concept of RAID on one disk with multiple partitions. But I'll assume you're doing it for education and experience and have only one disk.

Having said that, you didn't say what distro you were using; some don't have /dev/md1 already made as a device, only /dev/md0.
Your first error:
Quote:
mdadm: error opening /dev/md1: No such file or directory
indicates you have no /dev/md1. So make one with mknod (man mknod and use the major and minor same as /dev/md0 [use ls-l /dev/md0 to see these]but with a "1") and try again.

The second error
Quote:
Disk /dev/md0 doesn't contain a valid partition table
could come from the previous suggestion; ie lack of reboot. But it could just indicate that /dev/md0 doesn't have a partition table. It isn't a physical disk - it's a RAID device.
 
Old 07-22-2008, 12:17 PM   #4
priyank123
LQ Newbie
 
Registered: Apr 2008
Posts: 25

Original Poster
Rep: Reputation: 15
i ll try this guys and let u know.

i m using RHEL5.

thanks for ur reply
 
Old 07-30-2008, 04:28 AM   #5
priyank123
LQ Newbie
 
Registered: Apr 2008
Posts: 25

Original Poster
Rep: Reputation: 15
hi

sorry for long time


mostlyharmless can u write full CMD for me pls


thank you
 
Old 07-31-2008, 12:00 AM   #6
tanushreevk
LQ Newbie
 
Registered: Jul 2008
Posts: 8

Rep: Reputation: 0
hi

i don't know whether this is beneficial for u.

but for my clarification i would like to ask some questions.

for /dev/md0 --> have u formatted /dev/md0 with ext3 file system.
if not format with mkfs command and then mount it.

for /dev/md1 --> if driver is not present , then create with mknod comand.
for mknod command following link is useful.
check it.
http://www.faqs.org/docs/linux_admin/x797.html
 
Old 07-31-2008, 02:52 AM   #7
kenoshi
Member
 
Registered: Sep 2007
Location: SF Bay Area, CA
Distribution: CentOS, SLES 10+, RHEL 3+, Debian Sarge
Posts: 159

Rep: Reputation: 32
Richardash is correct. Just reboot and repeat the create process.

mdadm should create /dev/md1 for you when you create it again after the reboot.

The error:

Disk /dev/md0 doesn't contain a valid partition table

Is normal. You can't partition RAID devices directly. If you have a need to, pass it through LVM.

Hope this helps.
 
Old 07-31-2008, 12:05 PM   #8
mostlyharmless
Senior Member
 
Registered: Jan 2008
Distribution: Arch/Slackware/Knoppix
Posts: 1,761
Blog Entries: 14

Rep: Reputation: 267Reputation: 267Reputation: 267
mknod /dev/md1 XXX 1 b
where XXX is the major associated with md devices; use the same one you get with ls -l /dev/md0
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Linux RAID Smackdown: Crush RAID 5 with RAID 10 LXer Syndicated Linux News 0 02-26-2008 10:40 PM
Gave up on HPT374 driver, suggestions please for RAID 5 card/cabable mobo for RAID 5? Phoenix_Zero Linux - Hardware 10 03-25-2007 06:15 AM
Perc3Di SCSI RAID + Adaptec 2810SA RAID = Fatal Grub Error? LinuxOnTheEdge Linux - General 2 03-19-2005 03:35 PM
does linux support the sata raid and ide raid in k7n2 delta ilsr? spyghost Linux - Hardware 10 04-16-2004 06:27 AM
moving system from ide software raid to new box with scsi raid ftumsh Linux - General 0 10-28-2003 10:34 AM


All times are GMT -5. The time now is 02:44 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration