LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 10-28-2006, 03:01 PM   #1
metamechanical
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Rep: Reputation: 0
Linear RAID failing to automount at boot


I recently purchased a third hard drive, and decided to do a linear RAID with my second one (mounting at /home). I packed away all my data, ran:

mkraid /dev/md0
mdadm --create --verbose /dev/md0 --level=linear --raid-devices=2 /dev/hda1 /dev/hdb1

my /etc/raidtab looks like:

raiddev /dev/md0
raid-level linear
nr-raid-disks 2
chunk-size 32
persistent-superblock 1
device /dev/hda1
raid-disk 0
device /dev/hdb1
raid-disk 1

I made a partition, set up a filesystem, added it to /etc/fstab, and loaded my data back on, and when I rebooted, /dev/md0 didn't mount.

The catch is, running:

raidstart /dev/md0
mount /dev/md0

mounts my drive just fine! RAID is compiled right into my kernel (not as a module), so I'm hoping someone might have some insight as to why it's not automounting at boot.

--Nate

Last edited by metamechanical; 10-28-2006 at 03:02 PM.
 
Old 10-28-2006, 05:28 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Did you remember to change the partition type to 0xfd using fdisk?
From the Software-RAID-HOWTO
Quote:
7.2 Autodetection

Autodetection allows the RAID devices to be automatically recognized by the kernel at boot-time, right after the ordinary partition detection is done.

This requires several things:

You need autodetection support in the kernel. Check this
You must have created the RAID devices using persistent-superblock
The partition-types of the devices used in the RAID must be set to 0xFD (use fdisk and set the type to "fd")

NOTE: Be sure that your RAID is NOT RUNNING before changing the partition types. Use raidstop /dev/md0 to stop the device.
 
Old 10-28-2006, 05:53 PM   #3
metamechanical
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
I thought I did, but upon running fdisk, it says:

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

But then, the same thing pops up for my other, non-RAID drives... which doesn't seem right.

also, if I haven't run raidstart yet, all it says is:

Unable to read /dev/md0

I'm really lost here.
 
Old 10-29-2006, 08:54 AM   #4
fayez
Member
 
Registered: Aug 2004
Location: Amman
Distribution: Red Hat
Posts: 50

Rep: Reputation: 15
Hi ,

Any way Partion 4 mus be extended partition, did you made it extended????
 
Old 10-29-2006, 10:13 AM   #5
metamechanical
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
so, I figured maybe I took a misstep somewhere, and maybe I should start from scratch... so I copied off my data again, ran raidstop, and then ran:

mkraid /dev/md0

it said that the drives were already part of a RAID array, so I ran:

mkraid /dev/md0 -R

and then:

mdadm --create --verbose /dev/md0 --level=linear --raid-devices=2 /dev/hda1 /dev/hdb1

to which it replied:

mdadm: Cannot open /dev/hda1: Device or resource busy
mdadm: Cannot open /dev/hdb1: Device or resource busy
mdadm: create aborted

my /proc/mdstat shows:

md0 : active linear hdb1[1] hda1[0]
507926912 blocks 32k rounding

what's going on here? why can't I run mdadm on my new array?
 
Old 10-29-2006, 10:36 AM   #6
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
mkraid is equivalent to mdadm --create. You need to do one or the other.
 
Old 10-29-2006, 12:08 PM   #7
metamechanical
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
okay, so in light of that, I just ran:

mkraid /dev/md0 -R
cfdisk /dev/md0 (I started with a fresh Linux Raid Autodetect partition)
mkfs.ext3 /dev/md0
reboot

during boot, it says:

md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.

...

/sbin/e2fsck: Invalid argument while trying to open /dev/md0
/dev/md0:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try runing e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

...

Mounting non-root local filesystems:
EXT3-fs: unable to read superblock
mount: wrong fs type, bad option, bad superblock on /dev/md0,
missing codepage or other error


and then, it's unsurprisingly not there when I log in... but if I run raidstart and mount, it starts up and mounts just fine and dandy.

I might also add that upon running cfdisk again, it shows the type as "free space" - not as linux raid autodetect. what on earth??

Last edited by metamechanical; 10-29-2006 at 12:11 PM.
 
Old 10-29-2006, 05:58 PM   #8
metamechanical
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
after much deliberating, I realized it was an order-of-operations issue!

instead of running:

mkraid /dev/md0 -R
cfdisk /dev/md0

I ran:

cfdisk /dev/hda
cfdisk /dev/hdb
mkraid /dev/md0 -R

and it worked!
 
Old 10-29-2006, 06:29 PM   #9
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
mkraid implies raidstart. As per the howto, you need to change the partition type when the raid device is not running (see 'NOTE' in my first post). By the way, my version of raidtools doesn't mention an 'R' option to mkraid (mkraid -R).
 
Old 10-29-2006, 07:16 PM   #10
metamechanical
LQ Newbie
 
Registered: Oct 2006
Posts: 8

Original Poster
Rep: Reputation: 0
-R means "really-force" on mine... I suppose to keep people from typing -f by mistake?

I guess my confusion arose from the fact that I wasn't supposed to partition the array - I was supposed to partition each drive.
 
Old 10-29-2006, 08:01 PM   #11
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Ah, ok. It sounds familiar now. It's just not mentioned in the man page. Anyway, yeah, fdisk wasn't writing to the MBR.
 
  


Reply



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
LXer: Linear Optimization with the GNU Linear Programming Kit LXer Syndicated Linux News 0 08-12-2006 04:21 AM
Fedora4 Install and Raid control with grub failing to boot blackman890 Fedora 1 03-18-2006 03:24 PM
Mounting linear-raid partition daniel_lidstrom Linux - Software 2 12-29-2004 05:04 AM
linear raid recovery beaucoup Linux - Software 0 02-27-2004 02:28 AM
software raid (linear) and moving disks TuxJay Linux - Software 0 08-27-2003 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:12 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
Open Source Consulting | Domain Registration