LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   RAID 1 and mkraid (https://www.linuxquestions.org/questions/slackware-14/raid-1-and-mkraid-298667/)

GaMeS 03-07-2005 08:34 AM

RAID 1 and mkraid
 
hi,

i have slackware 10.1 (kernel 2.6.11) and see my raidtab.

Code:


raiddev /dev/md0
 raid-level 1
 nr-raid-disks 2
 nr-spare-disks 0
 persistent-superblock 1
 chunk-size 16
 device /dev/hda
  raid-disk 0
 device /dev/hdc
  raid-disk 1

when i do 'mkraid /dev/md0'

Code:


handling MD device /dev/md0
analyzing super-block
disk 0: /dev/hda, 156290904kB, raid superblock at 156290816kB
disk 1: /dev/hdc, 156290904kB, raid superblock at 156290816kB
mkraid: aborted.
(In addition to the above messages, see the syslog and /proc/mdstat as well
 for potential clues.)


can you help me ?

i want to mirorring the hda -> hdb

When i boot on my 2.4.29's kernel , the raid0 works fine...... and 2.6.11's kernel false :X

thank's

jiawj 03-07-2005 09:34 AM

hello

/dev/hda is specified the whole disk,you should make partitions by fdisk

example:


And, I think mdadm-tools package are better than raid-tools package :)

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda1 /dev/hdc1

then you can run:

lsraid -p -R > raidtab

to build raidtab config-file without edit it by manual

GaMeS 03-07-2005 09:46 AM

Code:


root@servcd:~# mdadm --create /dev/md0 --level=1 --raid-devices /dev/hda1 /dev/hdc1
mdadm: invalid number of raid devices: /dev/hda1

humpf ? :X

lsraid return this :

Code:


# This raidtab was generated by lsraid version 0.7.0.
# It was created from a query on the following devices:
#      /dev/hdc
#      /dev/hdc1
#      /dev/hdc2
#      /dev/hdc3
#      /dev/hdc4
#      /dev/hda
#      /dev/hda1
#      /dev/hda2
#      /dev/hda3
#      /dev/hda4

# md device [dev 9, 0] /dev/md0 queried offline
# Authoritative device is [dev 22, 0] /dev/hdc
raiddev /dev/md0
        raid-level              1
        nr-raid-disks          2
        nr-spare-disks          0
        persistent-superblock  1
        chunk-size              16

        device          /dev/hda
        raid-disk              0
        device          /dev/hdc
        raid-disk              1


keefaz 03-07-2005 09:54 AM

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[ac]1

see the examples at the end of mdadm man page

jiawj 03-07-2005 10:01 AM

Quote:

mdadm --create /dev/md0 --level=1 --raid-devices /dev/hda1 /dev/hdc1
so sorry!
that my mistake, :o

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hda1 /dev/hdc1

GaMeS 03-07-2005 11:00 AM

Code:

root@servcd:~# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[ac]1
mdadm: /dev/hda1 appears to be part of a raid array:
    level=1 devices=2 ctime=Mon Mar  7 17:57:07 2005
Continue creating array? y
VERS = 9001
mdadm: ADD_NEW_DISK for /dev/hda1 failed: Device or resource busy

excuse for the man page but ... the problem continu....

jiawj 03-07-2005 11:07 AM

please run : fdisk -l and paste result here.
I guess your partition /dev/hda1 is not correct.

if you make partitions by fdisk, you must reboot and take activity the new partition, to avoid reboot, you can run partprobe after fdisk.

keefaz 03-07-2005 11:07 AM

what is the output for:
mdadm --query /dev/hda1
mdadm --query /dev/hdc1

GaMeS 03-08-2005 02:10 AM

'fdisk -l'

Code:

root@servcd:~# fdisk -l

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1              1        124      995998+  82  Linux swap
/dev/hda2  *        125        6203    48829567+  83  Linux
/dev/hda3            6204        9850    29294527+  83  Linux
/dev/hda4            9851      19457    77168227+  83  Linux

Disk /dev/hdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/hdc1              1        124      995998+  82  Linux swap
/dev/hdc2  *        125        6203    48829567+  83  Linux
/dev/hdc3            6204        9850    29294527+  83  Linux
/dev/hdc4            9851      19457    77168227+  83  Linux
root@servcd:~#


Code:

root@servcd:~# mdadm --examine /dev/hda1
/dev/hda1:
          Magic : a92b4efc
        Version : 00.90.00
          UUID : 310b0c11:592d0950:3d02bd4c:2550acdf
  Creation Time : Mon Mar  7 18:02:02 2005
    Raid Level : raid1
    Device Size : 995904 (972.56 MiB 1019.81 MB)
  Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0

    Update Time : Mon Mar  7 18:02:02 2005
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
      Checksum : 1a1f1375 - correct
        Events : 0.1


      Number  Major  Minor  RaidDevice State
this    0      3        1        0      active sync  /dev/hda1

  0    0      3        1        0      active sync  /dev/hda1
  1    1      22        1        1      active sync  /dev/hdc1
root@servcd:~#

and hdc
Code:

root@servcd:~# mdadm --examine /dev/hdc
/dev/hdc:
          Magic : a92b4efc
        Version : 00.90.00
          UUID : 9922d56e:56e2d303:c5fee9e9:e675ad7f
  Creation Time : Mon Mar  7 16:44:51 2005
    Raid Level : raid1
    Device Size : 156290816 (149.05 GiB 160.04 GB)
  Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0

    Update Time : Mon Mar  7 16:45:15 2005
          State : active
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
      Checksum : d34f8ce4 - correct
        Events : 0.2


      Number  Major  Minor  RaidDevice State
this    1      22        0        1      active sync  /dev/hdc

  0    0      3        0        0      active sync  /dev/hda
  1    1      22        0        1      active sync  /dev/hdc
root@servcd:~#

i'm use argument --examine because it say
Code:

root@servcd:~# mdadm --query /dev/hda1
/dev/hda1: is not an md array
/dev/hda1: device -1073744460 in 2 device undetected raid1 md0.  Use mdadm --examine for more detail.
root@servcd:~#

when i use --query argument.

do you have solution ?

GaMeS 03-08-2005 07:52 AM

another solution...?

keefaz 03-08-2005 08:35 AM

From what I see, I would think your raid array is already set.
Any error at boot or in dmesg ?

GaMeS 03-08-2005 08:39 AM

'dmesg'

Code:


md: could not bd_claim hda.
md: error, md_import_device() returned -16
md: array md0 already initialised!
md: array md0 already initialised!
EXT3-fs: unable to read superblock
isofs_fill_super: bread failed, dev=md0, iso_blknum=16, block=32
md: array md0 already initialised!
md: array md0 already initialised!
md: md0 stopped.


keefaz 03-08-2005 09:06 AM

What does ' cat /proc/mdstat ' say ?

GaMeS 03-08-2005 09:09 AM

'mdstat'

Code:

root@servcd:~# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid5] [raid6] [raid10] [faulty]
unused devices: <none>

if in my raidtab config file , i change
Code:

raiddev /dev/md0
        raid-level              1
        nr-raid-disks          2
        nr-spare-disks          0
        chunk-size              32
        device          /dev/hda
        raid-disk              0
        device          /dev/hdc
        raid-disk              1

in
Code:

raiddev /dev/md0
        raid-level              1
        nr-raid-disks          2
        nr-spare-disks          0
        chunk-size              32
        device          /dev/hda1
        raid-disk              0
        device          /dev/hdc1
        raid-disk              1

and start mkraid....

Code:

root@servcd:~# mkraid /dev/md0
handling MD device /dev/md0
analyzing super-block
disk 0: /dev/hda1, 29294527kB, raid superblock at 29294400kB
/dev/hda1 is mounted
mkraid: aborted.
(In addition to the above messages, see the syslog and /proc/mdstat as well
 for potential clues.)

.............

hanzerik 03-08-2005 09:16 AM

Got a question...Why are you trying to raid your swap partitions?


All times are GMT -5. The time now is 05:31 PM.