Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
change order of disks breaks raid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ootneg
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2003
Posts: 82

PostPosted: Wed Nov 19, 2003 8:38 am    Post subject: change order of disks breaks raid Reply with quote

First of all, I'm not booting these disks. They're just storage. I boot from an IDE drive and the system has SCSI drives that I use for storage. It's my file server :) Originally, I only had two 18 GB drives, one on scsi0 and one on scsi1. These were sda and sdb. I created the array with superblocks as I figured that would save me from having to deal with the current problem.

Now, I have added an additional 18 GB drive on scsi0 and will soon add a smaller drive to scsi1. The new drives will not use RAID. I don't want to add all of my new drives to scsi1 because of I/O balance problems that would come up on that controller as a result.

Now, when the system boots, It detects the three drives properly
Code:
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi disk sdb at scsi0, channel 0, id 3, lun 0
Attached scsi disk sdc at scsi1, channel 0, id 1, lun 0

sda and sdc are the original raid0 disks.
I updated my raidtab file so that it lists these drives
Code:
/etc# cat /etc/raidtab
raiddev /dev/md0
        raid-level      0
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock   1
        chunk-size      32
        device  /dev/sda1
        raid-disk       0
        device  /dev/sdc1
        raid-disk       1


Though I set sdc1 rather than sdb1 for device 1 (not zero), The array does not start. Logs show the following when I try to start raid:
Code:
md: can not import scsi/host0/bus0/target3/lun0/part1, has active inodes!
md: could not import scsi/host0/bus0/target3/lun0/part1, trying to run array nevertheless.
md: autorun ...
md: considering scsi/host0/bus0/target0/lun0/part1 ...
md:  adding scsi/host0/bus0/target0/lun0/part1 ...
md: created md0
md: bind<scsi/host0/bus0/target0/lun0/part1,1>
md: running: <scsi/host0/bus0/target0/lun0/part1>
md: scsi/host0/bus0/target0/lun0/part1's event counter: 00000047
md0: former device scsi/host0/bus0/target3/lun0/part1 is unavailable, removing from array!
md0: max total readahead window set to 496k
md0: 2 data-disks, max readahead per data-disk: 248k
md: md0, array needs 2 disks, has 1, aborting.
raid0: disks are not ordered, aborting!
md: pers->run() failed ...
md :do_md_run() returned -22
md: md0 stopped.
md: unbind<scsi/host0/bus0/target0/lun0/part1,0>
md: export_rdev(scsi/host0/bus0/target0/lun0/part1)
md: ... autorun DONE.


It appears to be trying to start raid with sdb1 rather than sdc1. I don't know why this is, because I have configured raidtab to tell it not to.

I may understand why it doesn't start the array automatically. From the logs, it appears that it does not autorun because raid tries to autorun before the SCSI module is loaded, which means that the kernel does not yet see the drives.
Code:
md: raid0 personality registered as nr 2
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
.
.
.
aic7xxx: <Adaptec AIC-7895 Ultra SCSI host adapter> at PCI 0/20/0
aic7xxx: external SCB RAM detected, but not enabled
aic7xxx: <Adaptec AIC-7895 Ultra SCSI host adapter> at PCI 0/20/1
aic7xxx: external SCB RAM detected, but not enabled
.
.


Can someone tell me if I am understanding this correctly or how to make this work? I don't expect it should be too dificult. It's probably just something that I haven't figured out or learned yet.


[/code]
Back to top
View user's profile Send private message
ledskof
Apprentice
Apprentice


Joined: 22 Oct 2002
Posts: 209

PostPosted: Wed Nov 19, 2003 8:40 pm    Post subject: Reply with quote

What kernel are you using?
Code:
#uname -r

Is your SCSI device driver compiled as a module?
Back to top
View user's profile Send private message
ootneg
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2003
Posts: 82

PostPosted: Wed Nov 19, 2003 10:20 pm    Post subject: Reply with quote

Code:
# uname -r
2.4.20


I currently have the vanilla sources, but have emerged the gentoo sources as I was thinking about switching to them. I just haven't gotten arount to it yet.

I have have two modules compiled for this chip. I use the 'Old' version as I have found that I get twice the throughput (acording to 'hdparm -Tt' results) on each controler with it. Performance is everything . . . right?

Code:
# cat /etc/modules.autoload | grep aic
# aic7xxx
aic7xxx_old


This is the kernel configuration
Code:
<M> Adaptec AIC7xxx support
(253)   Maximum number of TCQ commands per device
(15000)   Initial bus reset delay in milli-seconds
[*]   Probe for EISA and VL AIC7XXX Adapters
[ ]   Build Adapter Firmware with Kernel Build
<M> Old Adaptec AIC7xxx support
[*]   Enable Tagged Command Queueing (TCQ) by default
(8)   Maximum number of TCQ commands per device
[ ]   Collect statistics to report in /proc


I also disconnected the new drive (just turn the key in the hot swap reciever after unmounting the device) and rebooted. This is the log information from the successfull raid startup
Code:
md: autorun ...
md: considering scsi/host1/bus0/target1/lun0/part1 ...
md:  adding scsi/host1/bus0/target1/lun0/part1 ...
md:  adding scsi/host0/bus0/target0/lun0/part1 ...
md: created md0
md: bind<scsi/host0/bus0/target0/lun0/part1,1>
md: bind<scsi/host1/bus0/target1/lun0/part1,2>
md: running: <scsi/host1/bus0/target1/lun0/part1><scsi/host0/bus0/target0/lun0/part1>
md: scsi/host1/bus0/target1/lun0/part1's event counter: 00000047
md: scsi/host0/bus0/target0/lun0/part1's event counter: 00000047
md0: max total readahead window set to 496k
md0: 2 data-disks, max readahead per data-disk: 248k
raid0: looking at scsi/host0/bus0/target0/lun0/part1
raid0:   comparing scsi/host0/bus0/target0/lun0/part1(17936448) with scsi/host0/bus0/target0/lun0/part1(17936448)
raid0:   END
raid0:   ==> UNIQUE
raid0: 1 zones
raid0: looking at scsi/host1/bus0/target1/lun0/part1
raid0:   comparing scsi/host1/bus0/target1/lun0/part1(17920384) with scsi/host0/bus0/target0/lun0/part1(17936448)
raid0:   NOT EQUAL
raid0:   comparing scsi/host1/bus0/target1/lun0/part1(17920384) with scsi/host1/bus0/target1/lun0/part1(17920384)
raid0:   END
raid0:   ==> UNIQUE
raid0: 2 zones
raid0: FINAL 2 zones
raid0: zone 0
raid0: checking scsi/host0/bus0/target0/lun0/part1 ... contained as device 0
  (17936448) is smallest!.
raid0: checking scsi/host1/bus0/target1/lun0/part1 ... contained as device 1
  (17920384) is smallest!.
raid0: zone->nb_dev: 2, size: 35840768
raid0: current zone offset: 17920384
raid0: zone 1
raid0: checking scsi/host0/bus0/target0/lun0/part1 ... contained as device 0
  (17936448) is smallest!.
raid0: checking scsi/host1/bus0/target1/lun0/part1 ... nope.
raid0: zone->nb_dev: 1, size: 16064
raid0: current zone offset: 17936448
raid0: done.
raid0 : md_size is 35856832 blocks.
raid0 : conf->smallest->size is 16064 blocks.
raid0 : nb_zone is 2233.
raid0 : Allocating 17864 bytes for hash.
md: updating md0 RAID superblock on device
md: scsi/host1/bus0/target1/lun0/part1 [events: 00000048]<6>(write) scsi/host1/bus0/target1/lun0/part1's sb offset: 17920384
md: scsi/host0/bus0/target0/lun0/part1 [events: 00000048]<6>(write) scsi/host0/bus0/target0/lun0/part1's sb offset: 17936448
md: ... autorun DONE.


The file system mounts and works properly without the extra drive in between. All files appear to be there. I just don't want to have to stack all of my additional drives onto scsi1. I want to be able to balance the load between the two.

Oh, yeh. I forgot to switch the raidtab file back to sdb when I made this drive change. Now there is no sdc on my system, but it worked anyway. Apparently, it is not looking at the raidtab file, but rather the superblock information.
Code:
# cat /etc/raidtab
raiddev /dev/md0
        raid-level      0
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock   1
        chunk-size      32
        device  /dev/sda1
        raid-disk       0
        device  /dev/sdc1
        raid-disk       1


Strangely enough, when I rename raidtab to raidtab.off, raid does not create a device. The file is necessary, but the contents do not seam to matter.

If any other information would be helpfull, please let me know :)
Back to top
View user's profile Send private message
ootneg
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2003
Posts: 82

PostPosted: Fri Nov 21, 2003 7:53 am    Post subject: Reply with quote

After much more digging, reading manpages, and asking friends, and searching the net, I still haven't gotten this to work. Apparently, Raid 0 superblocks do not let you move the devices to different locations.

I checked the superblocks on my drives and they apper to be in tact and to match, but each query indicates a missing superblock on sdb1 (now "/dev/scsi/host0/bus0/target3/lun0/part1"), even though sdb1 is not part of the array and should not be.

Code:
/root# lsraid -D -d /dev/sda1
lsraid: Device "/dev/scsi/host0/bus0/target3/lun0/part1" does not have a valid raid superblock
[dev 8, 1] /dev/sda1:
        md device       = [dev 9, 0] /dev/md/0
        md uuid         = 01992DA4.888CC6B4.18EBBE59.871EC264
        state           = good

/root# lsraid -D -d /dev/sdc1
lsraid: Device "/dev/scsi/host0/bus0/target3/lun0/part1" does not have a valid raid superblock
lsraid: Device "/dev/scsi/host0/bus0/target3/lun0/part1" does not have a valid raid superblock
[dev 8, 33] /dev/sdc1:
        md device       = [dev 9, 0] /dev/md/0
        md uuid         = 01992DA4.888CC6B4.18EBBE59.871EC264
        state           = good

/root# lsraid -D -d /dev/sdb1
lsraid: Device "/dev/sdb1" does not have a valid raid superblock
/root#


I'm about to the point that I will just backup my data and run mkraid to see if it will apply the changes from /etc/raidtab to the superblocks and allow raid to start with the new configuration. If it does not, I won't want to use raid anyway, and will just go to using individual disks. The array is no good to me if I cannot relocate the drives as I understood I would be able to. I won't do that until I have been able to move the data to another location.

I hope that someone will post an answer/solution before I get to that point.
Back to top
View user's profile Send private message
ootneg
Tux's lil' helper
Tux's lil' helper


Joined: 12 Jul 2003
Posts: 82

PostPosted: Mon Nov 24, 2003 12:40 am    Post subject: change order of disks breaks raid {fixed/understood} Reply with quote

I backed up the files that I absolutely could not live without. Then I ran the comand
Code:
# mkraid --force /dev/md0


This gave a warning which included the following
Code:
If your /etc/raidtab file matches the real layout of on-disk data then
 recreating the array will not hurt your data, but be aware of the risks
 of doing this anyway . . .
 . . . You have been warned!


I double checked the drive layout on my system to be sure that it matched the contents of my /etc/raidtab and then replaced the --force option with the option given in the output. At the author's request, I am not including that flag in my post. The author would like all user's to find that flag by using --force so that all will have read his warnings at least one time.

Anyway, as my /etc/raidtab matched the data and layout on my disks, this worked. It is still recomended that you have a backup and that you know what you are doing before you do this.

I hope this information is helpfull.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum