LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-20-2008, 10:45 PM   #1
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 147

Rep: Reputation: 15
Question MDADM not syncing????


Hi there,

I'm new to MDADM. I created an array for RAID1. When I read the contents of /proc/mdstat, it says it's syncing the disks and shows how long till the operation is over. I used /dev/hda3 and /dev/hdb3 to create my array. So, here's my question:

If I create a file on say hda3, shouldn't it be duplicated on to hdb3? Isn't this the whole point? So, if I try to see the contents of the hdb3, shouldn't I be able to see the file duplicated on it?

I created a test file on hda3 and cehcked the contents of hdb3 but I couldn't see anything. Is there anything wrong with what I'm doing?

Thanks all
 
Old 07-20-2008, 11:33 PM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
After you initially set up a RAID mirror, you need to let the tools do their job.

NEVER individually write to one disk or the other - you will screw up your RAID - always write to the 'md' device to ensure that the data is correctly written to both drives. In a worst case, if a disk failed, mdadm gets confused, and you want to back up your data, mount the drive as read-only. But usually you just replace the bad drive and tell mdadm to 'add' a device to the mirror.
 
Old 07-21-2008, 12:17 AM   #3
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 147

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pinniped View Post
After you initially set up a RAID mirror, you need to let the tools do their job.

NEVER individually write to one disk or the other - you will screw up your RAID - always write to the 'md' device to ensure that the data is correctly written to both drives. In a worst case, if a disk failed, mdadm gets confused, and you want to back up your data, mount the drive as read-only. But usually you just replace the bad drive and tell mdadm to 'add' a device to the mirror.
Alright, it's good to know what's the correct way of doing it ) damn... Thanks!

So, okay, I mounted my /dev/md0 to /mnt/raid and wrote a file to /mnt/raid. Now this file should be copied to both of my raid disks right? how long would it take? I can't see the file copied after 10 minutes... What's wrong now?

Thanks again
 
Old 07-21-2008, 03:39 AM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Can you post the statistics from 'mdadm'? Just to make sure the drives are both used in the one md, etc. At the moment it sounds like the discs are either not synced or else they are not assembled as a RAID.

If you have a software RAID controller, did you set its function to 'normal' (not RAID)? The 'RAID' mode doesn't work with Linux; you need to leave teh disks as 2 separate devices and let Linux handle everything.

After the devices have been synced (which can take many hours), then when a file is copied you should see the duplicate appear in a fairly short time, although a very small file can take a few minutes - just to be sure you can call 'sync' to force the md driver to finish writing things.
 
Old 07-21-2008, 02:47 PM   #5
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 147

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pinniped View Post
Can you post the statistics from 'mdadm'? Just to make sure the drives are both used in the one md, etc. At the moment it sounds like the discs are either not synced or else they are not assembled as a RAID.

If you have a software RAID controller, did you set its function to 'normal' (not RAID)? The 'RAID' mode doesn't work with Linux; you need to leave teh disks as 2 separate devices and let Linux handle everything.

After the devices have been synced (which can take many hours), then when a file is copied you should see the duplicate appear in a fairly short time, although a very small file can take a few minutes - just to be sure you can call 'sync' to force the md driver to finish writing things.
Thanks for your comments. Here's the output of fdisk -l and /proc/mdstat:

sh-3.1# fdisk -l

Disk /dev/hda: 17.1 GB, 17179803648 bytes
16 heads, 63 sectors/track, 33288 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 9688 4882720+ 83 Linux
/dev/hda2 9689 13563 1953000 82 Linux swap / Solaris
/dev/hda3 13564 23251 4882752 83 Linux
/dev/hda4 23252 32939 4882752 83 Linux

Disk /dev/hdb: 17.1 GB, 17179803648 bytes
16 heads, 63 sectors/track, 33288 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 9689 4883224+ 83 Linux
/dev/hdb2 9690 10659 488880 82 Linux swap / Solaris
/dev/hdb3 10660 20348 4883256 fd Linux raid
autodetect
/dev/hdb4 20349 30037 4883256 fd Linux raid
autodetect

Disk /dev/md0: 5000 MB, 5000445952 bytes
2 heads, 4 sectors/track, 1220812 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

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

Disk /dev/md1: 500 MB, 500604928 bytes
2 heads, 4 sectors/track, 122218 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table
sh-3.1# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 hda4[1] hda3[0]
488872 blocks super 1.0 [2/2] [UU]

md0 : active raid1 hdb4[1] hdb3[0]
4883248 blocks super 1.0 [2/2] [UU]

unused devices: <none>



I just don't konw why I keep getting "Disk /dev/md0 doesn't contain a valid partition table" error message. I formatted the drive with mkfs.ext3 when I created it too but it keeps giving this error message.

help!!!

Thanks
 
Old 07-21-2008, 02:48 PM   #6
alirezan1
Member
 
Registered: Nov 2004
Location: Vancouver
Distribution: Ubunty, CentOS ,Mandriva, Gentoo, RedHat, Fedora, Knoppix
Posts: 147

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pinniped View Post
Can you post the statistics from 'mdadm'? Just to make sure the drives are both used in the one md, etc. At the moment it sounds like the discs are either not synced or else they are not assembled as a RAID.

If you have a software RAID controller, did you set its function to 'normal' (not RAID)? The 'RAID' mode doesn't work with Linux; you need to leave teh disks as 2 separate devices and let Linux handle everything.

After the devices have been synced (which can take many hours), then when a file is copied you should see the duplicate appear in a fairly short time, although a very small file can take a few minutes - just to be sure you can call 'sync' to force the md driver to finish writing things.
Thanks for your comments. Here's the output of fdisk -l and /proc/mdstat and mount:

Quote:
sh-3.1# fdisk -l

Disk /dev/hda: 17.1 GB, 17179803648 bytes
16 heads, 63 sectors/track, 33288 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 9688 4882720+ 83 Linux
/dev/hda2 9689 13563 1953000 82 Linux swap / Solaris
/dev/hda3 13564 23251 4882752 83 Linux
/dev/hda4 23252 32939 4882752 83 Linux

Disk /dev/hdb: 17.1 GB, 17179803648 bytes
16 heads, 63 sectors/track, 33288 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 9689 4883224+ 83 Linux
/dev/hdb2 9690 10659 488880 82 Linux swap / Solaris
/dev/hdb3 10660 20348 4883256 fd Linux raid
autodetect
/dev/hdb4 20349 30037 4883256 fd Linux raid
autodetect

Disk /dev/md0: 5000 MB, 5000445952 bytes
2 heads, 4 sectors/track, 1220812 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

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

Disk /dev/md1: 500 MB, 500604928 bytes
2 heads, 4 sectors/track, 122218 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table
sh-3.1# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 hda4[1] hda3[0]
488872 blocks super 1.0 [2/2] [UU]

md0 : active raid1 hdb4[1] hdb3[0]
4883248 blocks super 1.0 [2/2] [UU]

unused devices: <none>

sh-3.1# mount
/dev/root on / type ext2 (rw)
/ramdisk on /ramdisk type tmpfs (rw,size=242880k,mode=755)
/UNIONFS on /UNIONFS type aufs (rw,br:/ramdisk:/KNOPPIX)
/dev/hdc on /cdrom type iso9660 (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/proc/bus/usb on /proc/bus/usb type usbfs (rw,devmode=0666)
/dev/pts on /dev/pts type devpts (rw)
/dev/hda1 on /mnt/hdinstall type reiserfs (rw)
/dev/md0 on /mnt/raid0 type ext3 (rw)
/dev/md1 on /mnt/raid1 type ext3 (rw)

I don't konw why I keep getting "Disk /dev/md0 doesn't contain a valid partition table" error message. I formatted the drive with mkfs.ext3 when I created it too but it keeps giving this error message.


I also still can't get why I can't see the files written to disks when I write to the raid0 or raid1.

help!!!

Thanks

Last edited by alirezan1; 07-21-2008 at 02:53 PM.
 
  


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
mdadm says "mdadm: /dev/md1 not identified in config file" when booting FC7 raffeD Linux - Server 1 08-11-2008 12:47 PM
RAID through mdadm rosey Linux - Server 5 04-08-2007 12:57 PM
mdadm not stinking syncing erics_acvw Linux - Server 2 10-14-2006 10:34 PM
multipathing - mdadm da_kidd_er Linux - General 0 05-19-2005 08:28 PM
do you know mdadm? Coldburn Linux - Newbie 1 08-31-2004 03:22 PM


All times are GMT -5. The time now is 04:46 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration