Gavin Carr wrote:
Hi,
I'm having all kinds of problems trying to get a RAID1 + LVM partitioning scheme working on SL10.0. I'm wanting this:
/dev/sda: swap auto raid1a 100MB raid2a 100MB raid3a 100MB raid4a max
/dev/sdb: swap auto raid1b 100MB raid2b 100MB raid3b 100MB raid4b max
RAID: md0: raid1a + raid1b, /boot md1: raid2a + raid2b, /boot2 md2: raid3a + raid3b, /boot3 md3: raid4a + raid4b, LVM physical volume
LVM: volume group /dev/system: /dev/md3 logical volumes: / ext3 5GB /data ext3 200GB
i.e. an LVM physical volume on a RAID1 partition.
The partitioning fragment of my autoyast config looks like this:
<partitioning config:type="list"> <drive> <device>/dev/sda</device> <initialize config:type="boolean">false</initialize> <partitions config:type="list"> <partition> <filesystem config:type="symbol">swap</filesystem> <format config:type="boolean">true</format> <mount>swap</mount> <size>auto</size> </partition> <partition>
253 /dev/md0 <size>100mb</size> </partition> <partition>253 /dev/md1 <size>100mb</size> </partition> <partition>253 /dev/md2 <size>100mb</size> </partition> <partition>253 /dev/md3 <size>max</size> </partition> </partitions> <use>all</use> </drive> <drive> <device>/dev/sdb</device> <initialize config:type="boolean">false</initialize> <partitions config:type="list"> <partition> <filesystem config:type="symbol">swap</filesystem> <format config:type="boolean">true</format> <mount>swap</mount> <size>auto</size> </partition> <partition>253 /dev/md0 <size>100mb</size> </partition> <partition>253 /dev/md1 <size>100mb</size> </partition> <partition>253 /dev/md2 <size>100mb</size> </partition> <partition>253 /dev/md3 <size>max</size> </partition> </partitions> <use>all</use> </drive> <drive> <device>/dev/md</device> <partitions config:type="list"> <partition> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format>130 0 <mount>/boot</mount></partition> <partition> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format> 4 left-asymmetric raid1 130 1 <mount>/boot2</mount></partition> <partition> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format> 4 left-asymmetric raid1 130 2 <mount>/boot3</mount></partition> <partition> 4 left-asymmetric raid1 system 142 3 </partition> </partitions> <use>all</use> </drive> <drive> <device>/dev/system</device> 4 left-asymmetric raid1 true <partitions config:type="list"> <partition> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format>root1 <mount>/</mount> <size>5gb</size> </partition> <partition> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format>data <mount>/data</mount> <size>200gb</size> </partition> </partitions> <pesize>32M</pesize> <use>all</use> </drive> </partitioning>This validates against the DTDs with xmllint, and it _almost_ works under autoyast. Here's the Partitioning confirmation output:
Create extended partition /dev/sda1 (232.8 GB) Create swap partition /dev/sda5 (1.0 GB) Create partition /dev/sda6 (101.9 MB) with id=8E Create partition /dev/sda7 (101.9 MB) with id=8E Create partition /dev/sda8 (101.9 MB) with id=8E Create partition /dev/sda9 (231.5 GB) with id=8E Create extended partition /dev/sdb1 (232.8 GB) Create swap partition /dev/sdb5 (1.0 GB) Create partition /dev/sdb6 (101.9 MB) with id=FD Create partition /dev/sdb7 (101.9 MB) with id=FD Create partition /dev/sdb8 (101.9 MB) with id=FD Create partition /dev/sdb9 (231.5 GB) with id=FD Create software RAID /dev/md0 (101.9 MB) for /boot with ext3 Create software RAID /dev/md1 (101.9 MB) for /boot2 with ext3 Create software RAID /dev/md2 (101.9 MB) for /boot3 with ext3 Create software RAID /dev/md3 (231.5 GB) Create volume group system Create logical volume /dev/system/data (200.0 GB) for /data with ext3 Create logical volume /dev/system/root1 (5.0 GB) for / with ext3
The problem is that somehow it comes up with the wrong partition type /dev/sda[6-9] partitions, making them LVM partitions (8E) instead of RAID partitions (FD), it's added all the /dev/sda partitions to the /dev/system volume group, and the raid partitions only contain the /dev/sdb members, and so raid volume creation fails.
Does this look like an error in my config somewhere, or a bug? If I correct these problems by hand, everything works.
In addition, if I try and initialise the drives I get even more bizarre problems - the /dev/sda partitions disappear altogther. I've been deleting the partition tables by hand to get it this far.
This is x86_64 on sata drives, in case that matters.
Thanks a lot for any clues/ideas. Been banging my head against this for a day and a half now ...
Yeah, I've been banging my head a while with this kind of thing too.
I'm not sure of the exact problem in your xml, but I do have a similar
setup using IDE disks, see below. This one works except for the booting.
I have to boot rescue and manually get rid of "resume=/dev/md1" in my
/boot/grub/menu.lst in order to get the system to boot. I'm working on
that right now. In addition to the manual edits in rescue mode, I do
the following:
# grub
...
grub> root (hd0,0)
...
grub> setup (hd0)
...
grub> root (hd1,0)
...
grub> setup (hd1)
...
grub> quit
#
However, I'm not sure (yet) that this is needed. BTW, they tell me
that lilo is better to use for RAID1 boot, but I'm not convinced.
On top of that, I got a patch from Uwe G. that solves a network
installation issue I had with the setup I'm using. I'm not sure
you will need it though. The error I got (at partitioning phase)
was -6002.
Let me know how it goes, I'm aiming at using S-ATA disks
myself in the near future.
Good luck
/LarS
PS. The complete autoinst.xml I'm using with SuSE 10.0 network
installation:
--- Begin Included Message ---
<?xml version="1.0"?>
<!-- $Id: configure.xml,v 1.5 2005/09/28 12:46:34 stava Exp $ -->
<!DOCTYPE profile SYSTEM "/usr/share/autoinstall/dtd/profile.dtd">
<profile xmlns="http://www.suse.com/1.0/yast2ns"
xmlns:config="http://www.suse.com/1.0/configns">
<scripts>
<post-scripts config:type="list">
<script>
<filename>post.sh</filename>
<interpreter>shell</interpreter>
<source>
<![CDATA[
echo "pre.sh ($0)"
hds=`fdisk -l | grep Disk | cut -d\ -f2 | cut -d: -f1`
n=0
for hd in $hds; do
grub <<!
root (hd$n,0)
setup (hd$n)
!
n=$(($n + 1))
done
perl -pi -e 's&resume=/dev/md1&&g;' /boot/grub/menu.lst'
]]>
</source>
</script>
</post-scripts>
<pre-scripts config:type="list">
<script>
<filename>pre.sh</filename>
<interpreter>shell</interpreter>
<source>
<![CDATA[
echo "pre.sh ($0)"
hds=`fdisk -l | grep Disk | grep '/dev/hd' | cut -d\ -f2 | cut -d: -f1`
for hd in $hds; do
ps=`parted $hd print | grep '^[1-9]' | cut -d\ -f1`
for p in $ps; do
mdadm --zero-superblock $hd$p
parted $hd rm $p
done
dd if=/dev/zero of=$hd bs=1M count=100
done
]]>
</source>
</script>
</pre-scripts>
</scripts>
<users config:type="list">
<user>
<encrypted config:type="boolean">true</encrypted>
<gid config:type="integer">0</gid>
<grouplist></grouplist>
<home>/root</home>