LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Trouble starting my RAID5 at bootup (https://www.linuxquestions.org/questions/linux-software-2/trouble-starting-my-raid5-at-bootup-930090/)

maan75 02-18-2012 02:31 PM

Trouble starting my RAID5 at bootup
 
Hi!

I can't seem to figure out how to autostart my RAID 5 on bootup. (I'm using Debian 6.0)
I've tried a few things, but I'm worried that tinkering too much would make me loose my data. The raid has to be started manually (within Gnome) after every reboot.

The raid consists of 3 x 2tb disks;
Code:

# blkid
/dev/sda1: UUID="8a0a4f78-8c87-8d94-7063-b77dd9bcbf92" LABEL=":New RAID Array" TYPE="linux_raid_member"
/dev/sdb1: UUID="8a0a4f78-8c87-8d94-7063-b77dd9bcbf92" LABEL=":New RAID Array" TYPE="linux_raid_member"
/dev/sdc1: UUID="8a0a4f78-8c87-8d94-7063-b77dd9bcbf92" LABEL=":New RAID Array" TYPE="linux_raid_member"
/dev/sdd1: UUID="473eb1c4-f7c2-4270-ba64-c70d66d778bc" TYPE="ext3"
/dev/sdd5: UUID="9e4c8ca5-ddf0-4d24-bdac-a99f6b39614b" TYPE="swap"

# mdadm --detail --scan
ARRAY /dev/md0 metadata=1.2 name=:New RAID Array UUID=8a0a4f78:8c878d94:7063b77d:d9bcbf92

I really hope someone out there knows what's going on!

-Martin

T3RM1NVT0R 02-18-2012 02:39 PM

@ Reply
 
Hi maan75,

Welcome to LQ!!!

What are the things that you have already tried? Paste the output of the following commands:

1.
Code:

df -h
2.
Code:

fdisk -l
3.
Code:

mdadm --detail
4.
Code:

cat /proc/mdstat
5.
Code:

cat /etc/fstab

maan75 02-18-2012 03:06 PM

1 df -h
Quote:

# df -h
filsystem storlek anvnt tillg anv% monteret på
/dev/sdd1 53g 3,9g 47g 8% /
tmpfs 1007m 0 1007m 0% /lib/init/rw
udev 1002m 220k 1002m 1% /dev
tmpfs 1007m 0 1007m 0% /dev/shm
2 fdisk -l
Quote:

# fdisk -l

disk /dev/sda: 2000.4 gb, 2000398934016 byte
255 huvuden, 63 sektorer/spår, 243201 cylindrar
enheter = cylindre av 16065 · 512 = 8225280 byte
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
diskidentifierare: 0x000bd949

enhed opstart start slut blokke id system
/dev/sda1 1 243201 1953512001 fd linux raid autodetekt

disk /dev/sdb: 2000.4 gb, 2000398934016 byte
255 huvuden, 63 sektorer/spår, 243201 cylindrar
enheter = cylindre av 16065 · 512 = 8225280 byte
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
diskidentifierare: 0x000c4481

enhed opstart start slut blokke id system
/dev/sdb1 1 243201 1953512001 fd linux raid autodetekt

disk /dev/sdc: 2000.4 gb, 2000398934016 byte
255 huvuden, 63 sektorer/spår, 243201 cylindrar
enheter = cylindre av 16065 · 512 = 8225280 byte
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
diskidentifierare: 0x00020f2f

enhed opstart start slut blokke id system
/dev/sdc1 1 243201 1953512001 fd linux raid autodetekt

disk /dev/sdd: 60.0 gb, 60022480896 byte
255 huvuden, 63 sektorer/spår, 7297 cylindrar
enheter = cylindre av 16065 · 512 = 8225280 byte
sector size (logical/physical): 512 bytes / 512 bytes
i/o size (minimum/optimal): 512 bytes / 512 bytes
diskidentifierare: 0x00021e55

enhed opstart start slut blokke id system
/dev/sdd1 * 1 6996 56190976 83 linux
/dev/sdd2 6996 7298 2421761 5 udvidet
/dev/sdd5 6996 7298 2421760 82 linux swap / solaris
3 mdadm --detail
Quote:

# mdadm --detail
mdadm: Only give one device per array line: /dev/md0 and raid
mdadm: Only give one device per array line: /dev/md0 and array
mdadm: No devices given.
4 cat /proc/mdstat
Quote:

# cat /proc/mdstat
personalities :
Unused devices: <none>
5 cat /etc/fstab
Quote:

# cat /etc/fstab
# /etc/fstab: Static file system information.
#
# use 'blkid' to print the universally unique identifier for a
# device; this may be used with uuid= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda1 during installation
uuid=473eb1c4-f7c2-4270-ba64-c70d66d778bc / ext3 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
uuid=9e4c8ca5-ddf0-4d24-bdac-a99f6b39614b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/md0 /jadda ext4 defaults 0 0
# rw,nosuid,nodev 0 0

T3RM1NVT0R 02-18-2012 03:11 PM

@ Reply
 
Did you run these commands when your RAID was up? For mdadm --detail you have to mention the device as well as follows:

mdadm --detail /dev/md0

I do not see any out for cat /proc/mdstat which makes me think that you ran the commands when RAID was not up.

It would be good if you could paste the output of mdadm.conf file as well. And you did not mention what are the things that you already tried. Just want to know so that we do not suggest what you already tried.

maan75 02-18-2012 03:12 PM

Perhaps the content of mdadm.conf is of interest as well?

C
Quote:

REATE owner=root group=disk mode=0660 auto=yes
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR root
# definitions of existing MD arrays
ARRAY /dev/md0 metadata=1.2 UUID=8a0a4f78:8c878d94:7063b77d:d9bcbf92 name=:New RAID Array
# This file was auto-generated on Tue, 07 Feb 2012 18:16:27 +0100
# by mkconf 3.1.4-1+8efb9d1+squeeze1


---------- Post added 02-18-12 at 10:12 PM ----------

Perhaps the content of mdadm.conf is of interest as well?

C
Quote:

REATE owner=root group=disk mode=0660 auto=yes
# automatically tag new arrays as belonging to the local system
HOMEHOST <system>
# instruct the monitoring daemon where to send mail alerts
MAILADDR root
# definitions of existing MD arrays
ARRAY /dev/md0 metadata=1.2 UUID=8a0a4f78:8c878d94:7063b77d:d9bcbf92 name=:New RAID Array
# This file was auto-generated on Tue, 07 Feb 2012 18:16:27 +0100
# by mkconf 3.1.4-1+8efb9d1+squeeze1

T3RM1NVT0R 02-18-2012 03:22 PM

@ Reply
 
Alright. Run the following command:

Code:

mdadm --detail --scan >> /etc/mdadm/mdadm.conf
and put a # sign in front of the following line in mdadm.conf file

#ARRAY /dev/md0 metadata=1.2 UUID=8a0a4f78:8c878d94:7063b77d:d9bcbf92 name=:New RAID Array

and then reboot the system.

Note: Make sure that you take a backup of existing mdadm.conf file. Make sure that you use double redirector >>. If you will use single then you will loose the existing stuff in that file.

maan75 02-18-2012 03:24 PM

I've been trying some changes to the mdadm.conf, enableing/disableing services related to mdadm and a whole lot of rebooting to see if i were going somewhere..


Thought it had to be down; here are mdadm --detail while up-and-running

Quote:

# mdadm --detail /dev/md0
mdadm: only give one device per ARRAY line: /dev/md0 and RAID
mdadm: only give one device per ARRAY line: /dev/md0 and Array
/dev/md0:
Version : 1.2
Creation Time : Sun Oct 30 17:34:28 2011
Raid Level : raid5
Array Size : 3907020800 (3726.03 GiB 4000.79 GB)
Used Dev Size : 1953510400 (1863.01 GiB 2000.39 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent

Intent Bitmap : Internal

Update Time : Sat Feb 18 21:35:04 2012
State : active
Active Devices : 3
Working Devices : 3
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 512K

Name : :New RAID Array
UUID : 8a0a4f78:8c878d94:7063b77d:d9bcbf92
Events : 118520

Number Major Minor RaidDevice State
0 8 33 0 active sync /dev/sdc1
1 8 17 1 active sync /dev/sdb1
3 8 1 2 active sync /dev/sda1
..and cat /proc/mdstat

Quote:

# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md0 : active raid5 sdc1[0] sda1[3] sdb1[1]
3907020800 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
bitmap: 0/15 pages [0KB], 65536KB chunk

unused devices: <none>

maan75 02-18-2012 03:33 PM

Done..
However; when i open the disctool, it reports the raid as not running.. :-/

T3RM1NVT0R 02-18-2012 03:43 PM

@ Reply
 
Alright.

Add the following line to /etc/fstab:

Code:

8a0a4f78:8c878d94:7063b77d:d9bcbf92    /jadda    ext4        defaults 0 0
and comment out following line (put a # sign before it):

Code:

/dev/md0        /jadda        ext4        defaults 0 0
Reboot the system.

Another thing that I noticed about your RAID is the name. Did you give it a name New Raid Array because I have seen people using giving one word name to their RAID array.

If the above does not work then we can think of putting a script to run at boot time to automatically mount it using the command.

Make sure that you take a backup of existing /etc/fstab before making any modifications. It is better to be safe then sorry ;-)

maan75 02-18-2012 03:58 PM

The name was the default suggestion; I would have given it another name with just one word.. :-)
Anyway; after reboot, the raid is still not up and running..

T3RM1NVT0R 02-18-2012 04:11 PM

@ Reply
 
Alright. One more thing we can try before we jump on to script section. When the system comes up (without RAID) and if you type the command:

Code:

mount -a
Does it activate the RAID?

If not, then run the following command and see if your RAID comes up or not:

Code:

mdadm --assemble --scan

maan75 02-18-2012 04:21 PM

This IS one of the things i've tried earlier.. Still; tried again, but to no avail..

Quote:

#mount -a
mount: specialenhed 8a0a4f78:8c878d94:7063b77d:d9bcbf92 eksisterer ikke
(mount: Special unit 8a0a4f78:8c878d94:7063b77d:d9bcbf92 does not exist)

Quote:

#mdadm --assemble --scan
mdadm: only give one device per ARRAY line: /dev/md0 and RAID
mdadm: only give one device per ARRAY line: /dev/md0 and array

T3RM1NVT0R 02-18-2012 04:30 PM

@ Reply
 
Try this command and see if this works.

Code:

mdadm /dev/md0 --assemble -u 8a0a4f78-8c87-8d94-7063-b77dd9bcbf92
Thing that I am trying to figure out is how the RAID is getting started via Gnome. In short which command it is executing in the backend. And how it is identifying the RAID when system is unable to at the time of boot.

Another thing that you could try is putting the uuid in the following format in /etc/fstab:

Code:

uuid=8a0a4f78-8c87-8d94-7063-b77dd9bcbf92      /jadda    ext4        defaults 0 0

maan75 02-18-2012 04:46 PM

Success.. :-)

Quote:

# mdadm /dev/md0 --assemble -u 8a0a4f78-8c87-8d94-7063-b77dd9bcbf92
mdadm: only give one device per ARRAY line: /dev/md0 and RAID
mdadm: only give one device per ARRAY line: /dev/md0 and Array
mdadm: /dev/md0 has been started with 3 drives.
..exept for the two lines of "only give... ", wich i strongly assume has to do with the naming..

maan75 02-18-2012 04:52 PM

The fstab-thingy did'nt work however..


All times are GMT -5. The time now is 08:19 AM.