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 - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-17-2004, 11:41 AM   #1
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Rep: Reputation: 15
Problem getting md0 mounted!!!


Hello,

I'm following the Root Raid Doc How-To to get my box running RAID1.

All the steps seem to go nicely until step 4.4 Edit /etc/fstab so that you mount your new RAID partition on boot up. I've added the suggested line in /etc/fstab and rebooted. However, when I run mount it does NOT give a line showing /dev/md0 is mounted on /mnt/md0. What gives?

I've gone back a few steps, stopping md0 and recreated partition type signatures, created the raid device and formatted it. Created mount point, mounted md0. Then copied my root system (on hda1) to md0, edited fstab again and rebooted. Again, no line showing md0 is mounted when issuing "mount".

Does this have to do with the FAM (File Alteration Monitor) I am running? (Tripwire I think the package is called?) What could be wrong?


Here's where you can find the Root RAID Doc How-To
 
Old 08-19-2004, 07:09 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
I wouldn't trust to the output of mount. It gathers it from /etc/mtab and the root partition might have been readonly at the moment those drives are mounted.

Check if you see that mount in /proc/mounts. If not, can you manually mount that,
eg. "mount /mnt/md0". If not, what is the error?
 
Old 08-20-2004, 10:53 AM   #3
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Original Poster
Rep: Reputation: 15
Thanks for your reply Toni T. Here are some results of your suggestions:

ls /proc shows a link mounts to self/mounts

mount /dev/md0 gives:
Code:
EXT3-fs: unable to read superblock
mount: wrong fs type, bad option, bad superblock on /dev/md0, or too many mounted file systems 
(could this be the IDE device where you in fact use ide-scsi so that sr0 or sda or so is needed?)
I am puzzled, as I thought I had manually cleared the superblock before formatting it ext3?!
Your suggestions are very welcome!

For your information: I made a similar post in the General forums. Go here to read it.
 
Old 08-20-2004, 01:11 PM   #4
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
What does
file -Ls /dev/md0
say?
Is your filesystem type claimed in /etc/fstab correct?
 
Old 08-20-2004, 01:12 PM   #5
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Ah, and what I meaned is to
cat /proc/mounts
 
Old 08-21-2004, 03:09 AM   #6
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Original Poster
Rep: Reputation: 15
Hi ToniT,

file -Ls /dev/md0 gives: /dev/md0: empty

I haven't declared md0 in fstab, it wouldn't mount anyway so I guessed it was pointless to add it to fstab. Did I think wrong?

cat /proc/mounts gives:
rootfs / rootfs rw 0 0
/dev/2/root2 / ext3 rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0


I don't understand the outcomes of this though...

Last edited by denniz; 08-21-2004 at 03:10 AM.
 
Old 08-23-2004, 08:36 PM   #7
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
The outputs of /proc/mounts shows what is mounted and to where in same way as mount does, just the information is gathered directly from kernel.

That
file -Ls /dev/md0 gives: /dev/md0: empty
sounds like there is no filesystem on the raid-device (md0).
 
Old 09-05-2004, 03:15 PM   #8
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Original Poster
Rep: Reputation: 15
Hi ToniT, I have tried it again from scratch... Steps 1-9 worked ok, but I listed them so you can see what I have done exactly. It went wrong at 10... This time I have zero-ed the superblock before creating the raid md0. In the appendix XII of the how-to recommends doing this always before creating a raid (no word of this in the step-by-step how-to (before 3.3)). Let's see if this makes a difference... So here's what I've been doing:


1. cat /proc/mdstat shows that raid is built into my kernel (its got different raid personalities)
2. I copied the partitions from hda to hdc: sfdisk -d /dev/hda | sfdisk /dev/hdc
3. Using cfdisk /dev/hdc I changed the partition type to Linux Raid autodetect.
4. Rebooted and rechecked partition type (ok).
5. before creating the raid device, I zero-ed the superblock: mdadm --zero-superblock /dev/hdc1
6. Created the raid device: mdadm --create /dev/md0 --level=1 --raid-disks=2 missing /dev/hdc1
7. Formatted the raid device. It autodetected it as ext2, but I want it ext3, so: mkfs.ext3 /dev/md0
8. Created a mount point: mkdir /mnt/md0
9. Mounted the raid device: mount /dev/md0 /mnt/md0

So far so good, it mounts! Hurrah!
cat /proc/mounts lists a line "/dev/md0 /mnt/md0 ext3 rw 0 0"

10. Now, before copying all the data, I added "/dev/md0 /mnt/md0 ext3 rw 0 0" to fstab. To check if md0 gets mounted after reboot.

This is where things go wrong:
when I reboot it does NOT mount! In /var/log/dmesg I find a (disturbing) line "EXT3-fs: unable to read superblock". This I do not understand. When I formatted md0 to ext3 (see step 7), it wrote all superblocks nicely and started the fs without problems. Now cat /proc/mdstat doesn't show any md0 devices running.

And we're back at the point of all the errors mentioned above. Any idea what could be wrong?

cheers,
denniz

Last edited by denniz; 09-09-2004 at 11:50 AM.
 
Old 09-05-2004, 05:15 PM   #9
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
ok, what seems to be the problem is that MD device doesn't get running automaticly.

What happens when you run command "mdrun"?
Do you get /dev/md0 manually running by using mdstat with --assemble parameter?

If later, but not first. There is some problem with mdrun script.

Also, have you changed the type of /dev/hda1 to raid autodetect? If not, you have to explicityl help mdrun (eg. by using some conffile of mdadm) to make it scan also that device.
 
Old 09-08-2004, 09:12 AM   #10
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Original Poster
Rep: Reputation: 15
Hi ToniT,

Thanks for responding so quickly. Took me a while before I noticed, because it didn't show in my User CP... Thought I was subcribed to my own thread but guess I was wrong? (How do I subscribe to this thread?)

Anyway: mdrun gave this:
md: md0 stopped
md: could not lock hda1
md: md_import_device returned -16
mdadm: failed to add /dev/hda1 to /dev/md0: device or resource busy
md: bug in file drivers/md/md.c, line 1513

md: o **********************************
md: Complete raid state printout
md: o **********************************
md0:
md: o **********************************

mdadm: failed to RUN_ARRAY /dev/md0: invalid argument


About mdstat, what would I have to issue specifically?
The partition-type is set to (fd): Linux Raid autodetect

I´m new to mdadm, mdrun, mdstat. I apologise for my ignorance here.
 
Old 09-08-2004, 09:27 AM   #11
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Original Poster
Rep: Reputation: 15
Quick note: mdadm --assemble --scan gives "mdadm: no arrays found in config file"
The suggested config file (according to the man pages) /etc/mdadm/mdadm.conf does not exist.
There is however a /etc/mdadm/debian.conf, here´s its contents:
START_DEAMON=true
MAIL_TO="root"
AUTOSTART=false

Last edited by denniz; 09-08-2004 at 09:40 AM.
 
Old 09-08-2004, 11:57 AM   #12
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Subscribe/Unsubscribe links are located below the "Smilar Threads" table.

Ok, I re-readed what you are doing and that howto you are following.

And there was a thinko in my previous post.. not mdstat, but mdadm..
So, starting raid array manually is something like:
Code:
mdadm --assemble /dev/md0 --run /dev/hdc1
The --run flag here tries to start the array even while one of the disks is missing.
 
Old 09-09-2004, 11:40 AM   #13
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Original Poster
Rep: Reputation: 15
Hi ToniT, thanks again for replying so quickly.

Here are the results:
Code:
mdadm --assemble /dev/md0 --run /dev/hdc1
md: md0 stopped.
mdadm: no RAID superblock on /dev/hdc1
mdadm: /dev/hdc1 has no superblock - assembly aborted
Now where have we seen that before?
post#8:"...In /var/log/dmesg I find a (disturbing) line "EXT3-fs: unable to read superblock". This I do not understand. When I formatted md0 to ext3 (see step 7), it wrote all superblocks nicely and started the fs without problems....

What could be wrong here?

Last edited by denniz; 09-09-2004 at 11:50 AM.
 
Old 09-12-2004, 02:35 PM   #14
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
The error-messages there are somewhat unrelated.

In post #8, the EXT3 driver can't read the superblock of the filesystem[A block that describes information like: fs label, location of root directory, size of the filesystem, block-count, location of journal, etc..] (inside the md0 "partition").
In your last post, the problem is, that the md driver can't read/locate superblock of the raid-device [A block that describes information like: How many partitions are in this raid device, which one is this, what are sizes and id:s of other partitions] (in the start of /dev/hdc1).
 
Old 09-19-2004, 06:15 AM   #15
denniz
Member
 
Registered: Apr 2004
Location: amsterdam
Distribution: Debian (Sarge and Woody)
Posts: 49

Original Poster
Rep: Reputation: 15
Thanks for elaborating, ToniT

But now I don't understand what is exactly wrong with my system. Why can't I get a raid-array running after reboot?
When I follow the steps in the How-To I mentioned, it seems to start and mount md0 fine. Then when I reboot, things go wrong and I get those error messages. I don't understand where the problem lies precisely. Can you tell me, please?
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
RAID5 using mdadm, how to mount /dev/md0? ggduff Linux - Software 4 11-14-2007 01:59 AM
Crash while resyncing /dev/md0 HelaWann Linux - Enterprise 1 12-06-2005 08:52 AM
can not mount RAID 0 /dev/md0 dysenteryduke Linux - Software 3 09-15-2005 03:19 PM
RAID 1 ... everyime I reboot, /dev/md0 is broken... rrohde Red Hat 1 10-26-2004 02:03 PM
Upgrade from Redhat 9 - /home/ md0 - error trekk Fedora 2 12-16-2003 10:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:58 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