Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
silo raid1 mbr copy
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc
View previous topic :: View next topic  
Author Message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Mon Mar 20, 2006 9:00 pm    Post subject: silo raid1 mbr copy Reply with quote

Hi,

I have 2006.0 and 2005.1 running on a few different Sun Sparcs without a problem but this is my first 2006.0 Sparc RAID array using mdadm. The gentoo documentation says: "When configuring your bootloader, make sure it gets installed in the MBR of both disks if you use mirroring"

I know how to do this with LILO but I don't know how this is done with SILO. I sucessfully managed to convert a single disk system into a RAID1 dual system all the way through the first reboot but managed to break SILO once I added the boot partition into the array. I'm now rebuilding the system from scratch but this time building the array at the begining from the Live CD. Once this install is finished I would like to try booting from both parts of the array. I plan to do this from the OBP prompt by setting up aliases for both halfs of the RIAD array. e.g OK> boot disk-raid1 and OK> boot disk-raid2. My boot order in the OBP would be disk-raid1 disk-raid2 cdrom

My silo.conf would look like this:

partition = 1
timeout = 150
default = linux.raid
image = /boot/kernel-2.4.32r2
root = /dev/hdc1
label = linux.noraid.disk1
image = /boot/kernel-2.4.32r2
root = /dev/hdb1
label = linux.noraid.disk2
image = /boot/kernel-2.4.32r2
root = /dev/md1
label=linux.raid

So how do you copy the SILO bootloader to the MBR of both devices in a RAID 1 array ? thanks - Mark
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Mon Mar 20, 2006 10:26 pm    Post subject: Reply with quote

I'm getting a few steps closer (there is no mbr on the sun disks). I'm looking at trying out 3 things:
1) build the array from the liveCD, Chroot into the array mount point and run /sbin/silo -C /boot/silo.conf (normal procedure for a non-array install)
2) run /sbin/silo against both members of the array (/dev/hdb1 and /dev/hdc1) - this doesn't work as I can't mount the members (error "unknown fileysystem mdraid")
3) create a small, permanently, non-raid partion on both members of the array just so that I can do step 2).

I can't believe 1) is going to be this easy but I think that 3) should work without a problem. This seems a workaround but I recall having to do something like this before a long time ago (different OS or distro). If anyone has the best way to do this please let me know. - thanks Mark.
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Tue Mar 21, 2006 6:30 am    Post subject: Reply with quote

Tried all of the above and seemed to get a step closer each time. The last attempt was to create two seperate non-raid /boot partitions. This kind-of worked but on startup I got a kernel panic about devfs on boot. (I see one other post about a similar problem). I'm interested in coming back to this if I knew for sure that someone has a working V100 IDE Gentoo 2006.0 MD RAID 1 setup but otherwise I'm going with a non-RAID configuration and will just have a standardized build to backup/restore to other systems in the event of an outage. - Mark
Back to top
View user's profile Send private message
nl0pvm
n00b
n00b


Joined: 08 Nov 2004
Posts: 46
Location: Netherlands

PostPosted: Fri Mar 24, 2006 11:56 am    Post subject: Reply with quote

Okay here we go :)

i'm running 2005.1 on a e250..

In this system are 2 disks which are mirrored.

First i partitioned them as following:
Code:
Disk /dev/sda (Sun disk label): 27 heads, 133 sectors, 4924 cylinders
Units = cylinders of 3591 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/sda1             0        54     96957   fd  Linux raid autodetect
/dev/sda2            54       332    499149   fd  Linux raid autodetect
/dev/sda3             0      4924   8841042    5  Whole disk
/dev/sda4           332      4924   8244936   fd  Linux raid autodetect

Disk /dev/sdb (Sun disk label): 27 heads, 133 sectors, 4924 cylinders
Units = cylinders of 3591 * 512 bytes

   Device Flag    Start       End    Blocks   Id  System
/dev/sdb1             0        54     96957   fd  Linux raid autodetect
/dev/sdb2            54       332    499149   fd  Linux raid autodetect
/dev/sdb3             0      4924   8841042    5  Whole disk
/dev/sdb4           332      4924   8244936   fd  Linux raid autodetect



then i did mdadm on all disks like this for the /boot partition :
Code:
mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1

the same for the /swap and the / root disk.

Then i bootstrapped my system etc etc

and here the trick comes... :)... if i'm correct youre unable to run silo from the chrooted installation envrionment
that's why i ran it out of the chrooted environment... but still with the disks in /raid1 formation mounted on the /mnt/gentoo etc..

and then youre able to boot from the obp from both disks... ( at least I am )

by the way.. running silo out of the chrooted environment means that you have to run silo with the -C option and the -r option..

by the way.. as you say below.. i didnt know that it was possible to set boot order in the oBP :) please tell me how to....

... oh and by the way.. the swap partiiton is also running mirrored as a died swapdisk makes my system crash too :)
_________________
SUN E250 2 x UltrasparcII@400Mhz 512MB RAM 6 x 9GB Kernel 2.6.8 (SMP)
SUN E250 UltrasparcII@400Mhz 512MB RAM 2 x 9GB Kernel 2.6.11
SUN E250 UltrasparcII@400Mhz 1024MB RAM 2 x 9GB
SPARCstation 10 MP 2 x 390Z55@40Mhz 512MB RAM Kernel 2.4.30 4GB & 9GB
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Fri Mar 24, 2006 2:19 pm    Post subject: Reply with quote

So the trick is to run Silo outside of Chroot and also mirror swap (I wasn't going to do this) ! I was planning to pick up a drive for another server today, but I'll pick up two instead and give this a go. It will probably be Monday before I can kick off the build process (I spent all last weekend working on this so need a break). I'll follow up with an update...

About the boot aliases. The way to do this is to create a device alias for your alternate disks.

OK>devalias [ lists the current set of aliases ]
OK>devalias mydisk /pci@1f,0/ide@d/disk@3,0 [ creates a new device alias ]
OK>setenv boot-device mydisk cdrom [ sets the boot order ]
Back to top
View user's profile Send private message
nl0pvm
n00b
n00b


Joined: 08 Nov 2004
Posts: 46
Location: Netherlands

PostPosted: Fri Mar 24, 2006 9:44 pm    Post subject: Reply with quote

markpr wrote:
So the trick is to run Silo outside of Chroot and also mirror swap (I wasn't going to do this) ! I was planning to pick up a drive for another server today, but I'll pick up two instead and give this a go. It will probably be Monday before I can kick off the build process (I spent all last weekend working on this so need a break). I'll follow up with an update...

About the boot aliases. The way to do this is to create a device alias for your alternate disks.

OK>devalias [ lists the current set of aliases ]
OK>devalias mydisk /pci@1f,0/ide@d/disk@3,0 [ creates a new device alias ]
OK>setenv boot-device mydisk cdrom [ sets the boot order ]


Have faith ;) at least i've got it running, besides, running gentoo on a sparc on software raid is not work.. its a mission :)
_________________
SUN E250 2 x UltrasparcII@400Mhz 512MB RAM 6 x 9GB Kernel 2.6.8 (SMP)
SUN E250 UltrasparcII@400Mhz 512MB RAM 2 x 9GB Kernel 2.6.11
SUN E250 UltrasparcII@400Mhz 1024MB RAM 2 x 9GB
SPARCstation 10 MP 2 x 390Z55@40Mhz 512MB RAM Kernel 2.4.30 4GB & 9GB
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Thu Mar 30, 2006 4:49 pm    Post subject: Reply with quote

It is a mission, unfortunately one I'm failing at at the moment! I just rebuilt another system this time following the steps above and I still run into the same problem. The error when I go to boot from either disk in the array is:

ok boot disk0
Boot device: /pci@1f,0/ide@d/disk@0,0 File and args:
The file just loaded does not appear to be executable.

I can boot from the livecd and then reassemble the array and mount the array onto temporary mount points without a problem. If I look at the contents of /dev/md1 that holds the root filesystem and compare the contents of /boot with the contents of /boot on one of my non-raid systems -they look identical. I have formatted the disks with the same partition sizes (and starting cylinders) as my working Non-RAID systems. The only difference with my Silo.conf between the two is that I have specified root=RAID-PARTITION in this case, instead of root=NON-RAID-PARTITION

Contents of /etc/silo.conf on the /dev/md1 array

partition = 1
root = /dev/md1
timeout = 150
default = linux

image = /boot/kernel-2.4.32r2
label = linux

Could my Silo.conf need more changes to support a RAID configuration? For a complete posting, here's what the original partitions looked like on both disks (before I assembled them into the array). The /dev/md1 device consistents of /dev/hdc1 and /dev/hda1 (not shown but identical in layout)

Disk /dev/hdc (Sun disk label): 255 heads, 63 sectors, 14946 cylinders
Units = cylinders of 16065 * 512 bytes

Device Flag Start End Blocks Id System
/dev/hdc1 0 124 996030 fd Linux raid autodetect
/dev/hdc2 u 124 373 2000092+ 82 Linux swap
/dev/hdc3 0 14946 120053745 5 Whole disk
/dev/hdc4 373 871 4000185 fd Linux raid autodetect
/dev/hdc5 871 1369 4000185 fd Linux raid autodetect
/dev/hdc6 1369 14946 109057252+ fd Linux raid autodetect

Any clues? Could you post or send me your silo.conf so that I could compare? I would say the difference between our systems is that you are running the 2.6 kernel where I'm testing with the default 2.4 but I can't (immediately) see that this would make a difference to this problem. It does just seem to be a DISK/PARTITION/SILO issue...

thanks

Mark
Back to top
View user's profile Send private message
nl0pvm
n00b
n00b


Joined: 08 Nov 2004
Posts: 46
Location: Netherlands

PostPosted: Thu Mar 30, 2006 8:40 pm    Post subject: Reply with quote

could you please also put a post here with the output of:

#mount

#cat /etc/fstab

#cat /proc/mdstat


tnx
_________________
SUN E250 2 x UltrasparcII@400Mhz 512MB RAM 6 x 9GB Kernel 2.6.8 (SMP)
SUN E250 UltrasparcII@400Mhz 512MB RAM 2 x 9GB Kernel 2.6.11
SUN E250 UltrasparcII@400Mhz 1024MB RAM 2 x 9GB
SPARCstation 10 MP 2 x 390Z55@40Mhz 512MB RAM Kernel 2.4.30 4GB & 9GB
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Sat Apr 01, 2006 4:37 pm    Post subject: Reply with quote

I'll boot from cdrom this afternoon and post mount, fstab and mdstat (actuals)...

I have made a little progress though. I checked the version of SILO on the LiveCD against the version of SILO in portage and the portage (emerged) version that I have is one revision older. Just in case, I made sure to run this new version of SILO against silo.conf. I also added in the following from the UltraSparc FAQ into silo.conf
append="md=1,/dev/hdc1,/dev/hda1"

I'm now getting to the first part of the bootloader: the "S" stage but this is where it's failing... I'm also going to read up on second.b problems.

Executing last command: boot disk0
Boot device: /pci@1f,0/ide@d/disk@0,0 File and args:
SProgram terminated
Mark
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Sat Apr 01, 2006 11:49 pm    Post subject: Reply with quote

Here is the output of fstab, mdstat, and mount

fstab

/dev/md1 / ext2 noauto,noatime 1 2
/dev/md2 none swap sw 0 0
/dev/md4 /usr ext3 noatime 0 1
/dev/md5 /var ext3 noatime 0 1
/dev/md6 /apps ext3 noatime 0 1
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs nodev,nosuid,noexec 0 0
none /proc/openprom openpromfs defaults 0 0

mdstat (this is after I had reassembled the array and it was just syncing.. this completes successfully all mirrors)

cat /proc/mdstat

Personalities : [raid1]
read_ahead 1024 sectors
md6 : active raid1 ide/host0/bus0/target0/lun0/part6[1] ide/host0/bus1/target0/lun0/part6[0]
109057216 blocks [2/2] [UU]
[>....................] resync = 2.8% (3069568/109057216) finish=113.8min speed=15508K/sec
md5 : active raid1 ide/host0/bus0/target0/lun0/part5[1] ide/host0/bus1/target0/lun0/part5[0]
4000128 blocks [2/2] [UU]
resync=DELAYED
md4 : active raid1 ide/host0/bus0/target0/lun0/part4[1] ide/host0/bus1/target0/lun0/part4[0]
4000128 blocks [2/2] [UU]
resync=DELAYED
md1 : active raid1 ide/host0/bus0/target0/lun0/part1[1] ide/host0/bus1/target0/lun0/part1[0]
995968 blocks [2/2] [UU]

unused devices: <none>


this is the result of mount (outside of chroot) after booting from the livecd.

livecd / # mount
tmpfs on / type tmpfs (rw)
none on /dev type devfs (rw)
/dev/cdroms/cdrom0 on /mnt/cdrom type iso9660 (ro)
/dev/loop/0 on /mnt/livecd type squashfs (ro)
proc on /proc type proc (rw)
tmpfs on /mnt/livecd/lib/firmware type tmpfs (rw)
tmpfs on /mnt/livecd/usr/portage type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw,devmode=0664,devgid=85)
none on /proc/openprom type openpromfs (rw)
none on /mnt/gentoo/dev type devfs (rw)
/dev/md/1 on /mnt/gentoo type ext2 (rw,noatime)
/dev/md/4 on /mnt/gentoo/usr type ext3 (rw)
/dev/md/5 on /mnt/gentoo/var type ext3 (rw)
/dev/md/6 on /mnt/gentoo/apps type ext3 (rw)
none on /mnt/gentoo/proc type proc (rw)
/dev on /mnt/gentoo/dev type none (rw,bind)

any clues?

thanks for the help - Mark
Back to top
View user's profile Send private message
nl0pvm
n00b
n00b


Joined: 08 Nov 2004
Posts: 46
Location: Netherlands

PostPosted: Sun Apr 02, 2006 11:10 am    Post subject: Reply with quote

I had this S->DEAD error as well.. i resolved it with a solution like this:

http://lists.debian.org/debian-sparc/2001/10/msg00067.html

Otherwise this may help:

https://forums.gentoo.org/viewtopic.php?p=665793

And Hey you see!!! -> You already got to the point that silo is trying to start :)
_________________
SUN E250 2 x UltrasparcII@400Mhz 512MB RAM 6 x 9GB Kernel 2.6.8 (SMP)
SUN E250 UltrasparcII@400Mhz 512MB RAM 2 x 9GB Kernel 2.6.11
SUN E250 UltrasparcII@400Mhz 1024MB RAM 2 x 9GB
SPARCstation 10 MP 2 x 390Z55@40Mhz 512MB RAM Kernel 2.4.30 4GB & 9GB
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Sun Apr 02, 2006 4:32 pm    Post subject: Reply with quote

I had had found and tried these two threads without much luck. So as a quick eval attempt, I tried a few things at once and managed to get SILO to boot.

- moved silo.conf into /boot (not likely to be the problem)
- created the boot partition on /dev/md0 (less likely but stranger things have happened)
- moved the starting cylinder from 0 to 1 on the /dev/md0 members (most likely).
- reran SILO (emerged version) to the /boot/silo.conf with the -r to the /dev/md0 mount point

I was then only able to boot if I used the following: ok> boot disk0:3

Unfortunately the array didn't start up correctly and I got the following error "md0 invalid raid superblock magic" but this is probably because I didn't update /etc/mdadm.conf (forgot) when I tried this quick test. I then got a kernel panic and the box has hung - so I need to get to the server next week.

I'm sure this is going to work though - thanks for the help!
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Tue Apr 04, 2006 4:38 am    Post subject: Reply with quote

Having updated mdadm.conf etc and tried several other techniques, I still can't resolve the invalid superblock error. Tried recreating the array, remaking the filesystem etc. Kept reading about resize2fs on the array to resolve this problem but the only info I received was "nothing to do". Also tried booting from alternate superblocks. The next step seems to be a fresh install.
Back to top
View user's profile Send private message
nl0pvm
n00b
n00b


Joined: 08 Nov 2004
Posts: 46
Location: Netherlands

PostPosted: Tue Apr 04, 2006 10:49 am    Post subject: Reply with quote

The invalid superblock is the result of a corrupt superblock.. this is because you have edited on only one of the disks instead of the two disks at the same time using raid1.... I have bin through this too and my solution to this was a recreation of the raid......

If correct you do not destroy your raid.. it just starts resyncing the other disk and it is back online/okay again
_________________
SUN E250 2 x UltrasparcII@400Mhz 512MB RAM 6 x 9GB Kernel 2.6.8 (SMP)
SUN E250 UltrasparcII@400Mhz 512MB RAM 2 x 9GB Kernel 2.6.11
SUN E250 UltrasparcII@400Mhz 1024MB RAM 2 x 9GB
SPARCstation 10 MP 2 x 390Z55@40Mhz 512MB RAM Kernel 2.4.30 4GB & 9GB
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Tue Apr 04, 2006 11:02 pm    Post subject: Reply with quote

Just in case, I zero'd the superblocks, repartitioned the disks, and started a fresh installation. The good news is that I can now reliably boot from either disk int0 the array using: OK> boot disk2:3 or OK> boot disk0:3 but both eventually fail at the same point. I have read quite a few solutions to this problem for several distros but none seem to appy to me. I still get an fsck error on /dev/md0 on boot and the filesystem is then mounted read-only. There are no other errors during startup. I'm running out of ideas while it seems that I'm so close to getting this running....

I should probably post this to a new thread outside the Sparc forum but here's the part of the boot messages when it gets to constructing the array.

md: created md0
md: bind<ide/host0/bus0/target0/lun0/part1,1>
md: bind<ide/host0/bus1/target0/lun0/part1,2>
md: running: <ide/host0/bus1/target0/lun0/part1><ide/host0/bus0/target0/lun0/part1>
md: ide/host0/bus1/target0/lun0/part1's event counter: 00000004
md: ide/host0/bus0/target0/lun0/part1's event counter: 00000004
md0: max total readahead window set to 248k
md0: 1 data-disks, max readahead per data-disk: 248k
raid1: device ide/host0/bus1/target0/lun0/part1 operational as mirror 0
raid1: device ide/host0/bus0/target0/lun0/part1 operational as mirror 1
raid1: raid set md0 active with 2 out of 2 mirrors
md: updating md0 RAID superblock on device
md: ide/host0/bus1/target0/lun0/part1 [events: 00000005]<6>(write) ide/host0/bus1/target0/lun0/part1's sb offset: 995904
md: ide/host0/bus0/target0/lun0/part1 [events: 00000005]<6>(write) ide/host0/bus0/target0/lun0/part1's sb offset: 995904
md: ... autorun DONE.
md: md driver 0.90.0 MAX_MD_DEVS=256, MD_SB_DISKS=27

* Checking root filesystem ...fsck.ext2: 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 running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
* Filesystem couldn't be fixed :(
[ !! ]
Back to top
View user's profile Send private message
markpr
n00b
n00b


Joined: 07 Nov 2004
Posts: 26

PostPosted: Wed Apr 05, 2006 6:15 pm    Post subject: Reply with quote

so to continue troubleshooting the problem, I removed the fsck check from my /etc/fstab and was able to boot and mount all MD filesystems. This indicates to me that the configuration is sound and that my only problem seems to be the fsck and superblock. I've tried other solution (resizefs etc) that do not seem to apply to this setup. I also know that the only systems I'm aware of that are working are using the 2.6 kernel (does anyone have any version of gentoo using MD, RAID1 with mdadm and the 2.4 kernel?). My next steps are to emerge the vanilla-sources for the sparc 2.6 kernel and give it a try. I'll start with devfs (never tried this) first and then try udev regardless of the results.
Back to top
View user's profile Send private message
nl0pvm
n00b
n00b


Joined: 08 Nov 2004
Posts: 46
Location: Netherlands

PostPosted: Thu Apr 06, 2006 10:35 pm    Post subject: Reply with quote

UHhhh,

This is because of a crappy baselayout, please check for messages from me on udev and baselayout.

You've got a working install only gentoo has got a completely borked baselayout.
_________________
SUN E250 2 x UltrasparcII@400Mhz 512MB RAM 6 x 9GB Kernel 2.6.8 (SMP)
SUN E250 UltrasparcII@400Mhz 512MB RAM 2 x 9GB Kernel 2.6.11
SUN E250 UltrasparcII@400Mhz 1024MB RAM 2 x 9GB
SPARCstation 10 MP 2 x 390Z55@40Mhz 512MB RAM Kernel 2.4.30 4GB & 9GB
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Sparc 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