[opensuse-autoinstall] Problem with disk device names
Hello, I am trying (on openSuse 11.2) to create a rules file and classes to create a software raid if the pc has 2 hard disks. My first try is to use disksize rules for /dev/sda and /dev/sdb. This failed, because I booted from USB stick, and the first SATA disk became /dev/sda, the USB stick became /dev/sdb, and the second SATA disk became /dev/sdc. Probably I will find a way to find out if there are 2 disks, but what to use for the "device" attribute of the "partitioning" section? Is there a generic way to specify the first, second, ... harddisk without getting disturbed by USB sticks? Peter -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
On Tue, Jun 8, 2010 at 10:31 AM, Peter Pointner
Hello,
I am trying (on openSuse 11.2) to create a rules file and classes to create a software raid if the pc has 2 hard disks. My first try is to use disksize rules for /dev/sda and /dev/sdb. This failed, because I booted from USB stick, and the first SATA disk became /dev/sda, the USB stick became /dev/sdb, and the second SATA disk became /dev/sdc.
Probably I will find a way to find out if there are 2 disks, but what to use for the "device" attribute of the "partitioning" section? Is there a generic way to specify the first, second, ... harddisk without getting disturbed by USB sticks?
I took a more eclectic approach, by running a shell script to determine the number of disks and manually merging a corresponding partitioning scheme XML to the main profile. But I'd also be interested in knowing what is the "official" way to do it with a rules/classes file. -- -- Erico -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Tuesday 08 June 2010 Peter Pointner wrote:
I am trying (on openSuse 11.2) to create a rules file and classes to create a software raid if the pc has 2 hard disks. My first try is to use disksize rules for /dev/sda and /dev/sdb. This failed, because I booted from USB stick, and the first SATA disk became /dev/sda, the USB stick became /dev/sdb, and the second SATA disk became /dev/sdc.
Probably I will find a way to find out if there are 2 disks,
in that case you indeed need a custom rule. I used something like that for a
project I did in the past:
<rule>
<custom1>
<script>
<![CDATA[
NUM=`hwinfo --disk|grep -c "Hardware Class:"`
# yeah, I know, I don't catch errors here
if [ "x$NUM" == "x1" ]; then
echo -n "one"
elif [ "x$NUM" == "x2" ]; then
echo -n "two"
else
echo -n "three"
fi;
]]>
</script>
<match>*</match>
but what to use for the "device" attribute of the "partitioning" section? Is there a generic way to specify the first, second, ... harddisk without getting disturbed by USB sticks?
a USB stick can disturb autoyast's device-autodetection (I think there is room
for improvement . it's on my TODO now).
You can try to specify no device at all and autoyast will guess. But in your
case there is a good chance that will fail and autoyast will use the USB
stick.
You can use <device>/dev/disk/by-id/....</device> or /dev/disk/by-path/....
because those should not change.
If that is not an option for you either, you can only use a pre-script with
some device detection written by you.
put <device>___dev1___</device> or so in your partitioning section and "sed"
those values out with a pre-script in /tmp/profile/autoinst.xml
Write the modified script to /tmp/profile/modified.xml
Autoyast will read it again before it's parsing the partitioning section.
If you don't have the USB stick always plugged in, the bootloader can get
confused too if you don't use by-id or by-path devices for the grub config
because the root/boot-device changes.
Sorry, but that's the only way at the moment.
I'll do something like
On Wed, Jun 9, 2010 at 5:05 AM, Uwe Gansert
You can try to specify no device at all and autoyast will guess. But in your case there is a good chance that will fail and autoyast will use the USB stick.
You can use <device>/dev/disk/by-id/....</device> or /dev/disk/by-path/.... because those should not change.
If that is not an option for you either, you can only use a pre-script with some device detection written by you. put <device>___dev1___</device> or so in your partitioning section and "sed" those values out with a pre-script in /tmp/profile/autoinst.xml Write the modified script to /tmp/profile/modified.xml Autoyast will read it again before it's parsing the partitioning section.
I use this script to detect the number of harddisks and detect their capabilities (e.g. if it's a harddisk or not). Perhaps it could be adapted for your purpose? ============ # find out how many hard disks are there EXCEPTIONS="ram[0-9]" let COUNT=0 for f in /sys/block/*; do ISREMOVABLE=`[ -f ${f}/removable ] && cat ${f}/removable || echo -1` ISREADONLY=`[ -f ${f}/ro ] && cat ${f}/ro || echo -1` SIZE=`[ -f ${f}/size ] && cat ${f}/size || echo -1` NAME=`basename ${f}` if [ $ISREMOVABLE -eq 0 ] && [ $ISREADONLY != 1 ] && [ $SIZE -gt 0 ] && [ `echo ${NAME} | egrep -c "${EXCEPTIONS}"` -eq 0 ]; then echo "The device ${f} is a HARD DISK." let COUNT=COUNT+1 fi done case $COUNT in 1) # do whatever you need for ONE hard disk ;; 2) # do whatever you need for TWO hard disks ;; *) echo "I don't know what to do with $COUNT hard disks, using only the first one..." # do whatever you need for ONE hard disk ;; esac ========= -- -- Erico -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Hello Uwe and Erico, thank you for sharing your ideas and scripts. Inspired by your input, I could solve the problem with a custom rule and a pre-script: ==== custom rule: ==== cd /sys/block let disks=0 for dev in sd[a-z]; do readlink $dev | grep -q usb && continue let disks++ echo "s/__diskdev${disks}__/${dev}/g" >> /tmp/realdisks.sed done if [ $disks = 1 ]; then echo -n "sdsys" else echo -n "raidsys" fi ==== pre-script: ==== sed -f /tmp/realdisks.sed /tmp/profile/autoinst.xml >/tmp/profile/modified.xml The single disk installation ends up using /dev/disk/by-id/... in /etc/fstab and /boot/menu/grub/menu.lst. The raid installation uses /dev/mdx in these files and UUIDs in /etc/mdadm.conf, so all should be ok. Thangs again, Peter -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Hi folks, until now i supported only 32bit Suse installation with autoyast. As time pass by i get request for 64bit suse and ppc support. My current layout was: ( In this example for OpenSuse 11.1 ) /export/suse/sl111 ./x86_64 # x64 DVD copy ./i586 # x32 DVD copy ./ppc # p64 DVD copy ./autoinstall # Autoyast directory for 32bit intel installations. ./autoinstall/ ./classes ./rules I assume that i need for each installable version ( x32,x64,ppc ) its own autoyast directory . Is that correct ? Or how do you maintain your autoyast environment ? With my current knowledge i would go for something like: /export/suse/sl111/. ./ayast_i586 ./ayast_x86_64 ./ayast_ppc Each having its own classes and rules directory. Any comments ? Tia Hajo -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Tuesday 06 July 2010 Hans-Joachim Ehlers wrote:
My current layout was: ( In this example for OpenSuse 11.1 )
/export/suse/sl111 ./x86_64 # x64 DVD copy ./i586 # x32 DVD copy ./ppc # p64 DVD copy ./autoinstall # Autoyast directory for 32bit intel installations. ./autoinstall/ ./classes ./rules
I assume that i need for each installable version ( x32,x64,ppc ) its own autoyast directory . Is that correct ? Or how do you maintain your autoyast environment ?
I have them all in one directory. I hardly have any configurations in my XML files that are arch dependent but my XML files are more for testing than for production. What do you have in mind when you say that each arch needs an own XML file? Except from package names (....-32bit packages are only available on 64bit arch)? -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug listening to: "Mephisto" by Subway to Sally -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Hi Uwe,
What do you have in mind when you say that each arch needs an own XML file?
I assume that a software section for an OS 11.1 (32bit) will not work for an OS 11.1 (64bit) . At least i have got during an autoyast installation a sw resolver error - using 32bit autoyast xml file for an 64bit installation. Also for the 32bit i use by default the kernel-pae where on 64bit i use the kernel-default. Thus i have to take care at least of the following sections of an autoinst.xml * kernel * Software So i could have all autoyast related info in separate directories for each arch or using one directory but extending the current rules.xml logic. Like: Rules.xml # uname -m case x86-64 -> software.x86_64.xml & kernel-default.x86_64.xml case i686 -> software.x86 & kernel-pae.x86.xml case ppc -> software.ppc & kernel-default.ppc.xml # generic global.xml # Valid config for all installations. Since i had already a rules structure i switch to a one directory structure for the autoyast related files and creating separate software XML files for each arch. Thx for your input Hajo -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Dear all,
Its been a while since I autoyasted anything. I just started an
install and was confronted with this message during the end of the
installation:
Error while installing GRUB:
sh: /usr/sbin/grub: No such file or directory
I checked the config file (generica-sles11_x84-64-LAMP+Tomcat.xml), for
grub packages and found none. This is strange because these profiles
were used some months ago. It only contains the grub config entry :
Resent this again to keep the archives useful: The original Subject header was incorrect.
Dear all,
Its been a while since I autoyasted anything. I just started an install and was confronted with this message during the end of the installation:
Error while installing GRUB: sh: /usr/sbin/grub: No such file or directory
I checked the config file (generica-sles11_x84-64-LAMP+Tomcat.xml), for grub packages and found none. This is strange because these profiles were used some months ago. It only contains the grub config entry :
grub I looked in the SLES10 profiles and these contain a package: <package>grub-32bit</package>
Something is amiss, but can anyone spot the mistake?
Best wishes, S.
-- Simon Loewenthal/Tele2 GSM: +31 6 2000 5427 ******** IMPORTANT NOTICE ******** Please repect the X-Reply to klunky.co.uk. PGP available 0x6F54D215 This e-mail (including any attachments) may contain information that is confidential or otherwise protected from disclosure and it is intended only for the addressees. If you are not the intended recipient, please note that any copying, distribution or other use of information contained in this e-mail (and its attachments) is not allowed. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message (including any attachments) from your system. Please note that e-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be subject of unauthorized interception or other interference without the knowledge of sender or recipient. Tele2 only send and receive e-mails on the basis that Tele2 is not responsible for any such computer viruses, corruption or other interference or any consequences thereof. It ought to be obvious that my views do not represent my employer's views. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
Dear all, I tried to replicate this error today, but failed, because now half way through the installation breaks with an error message stating that it cannot find the installation source (NFS). This makes me think that the network is being incorrectly configured (or correctly configured by AutoYast, but is useless for our network). The checked the DHCP logs on the autoyast server, and only 1 IP is let out to the client. It does not ask for another one later for the same NIC nor the second NIC (There are two NICs on the client, although I do not know whether the second one is cabled up. Remote site and takes a while for the site management team to check it out). The network config in the xml file is: <interfaces config:type="list"> <interface> <bootproto>static</bootproto> <device>eth0</device> <ipaddr>10.205.8.252</ipaddr> <name>NetXtreme II BCM5708S Gigabit Ethernet</name> <netmask>255.255.252.0</netmask> <prefixlen>22</prefixlen> <startmode>auto</startmode> <usercontrol>no</usercontrol> </interface> </interfaces> The/etc/dhcpd.conf lets out only the IP 10.205.8.252. Perhaps, during the install, autoyast decides to use map the second NIC to eth0, which means it won't find the network. I don't really know because I have no way of checking. Aborting the install leaves me with a dead machine. Thus, is there anyway to make the autoyast xml profile a little more generic when it comes to settings the NIC? Instead of defining this below, perhaps one could allow autoyast to stick to the MAC address it used to boot from. (However I would like to avoid hardcoding the MAC into the XML file because this sort of defeats the purpose of autoyast) <device>eth0</device> Any ideas? -- Once this is solved I can move back to the grub not found problem. On 07/14/2010 05:47 PM, Simon Loewenthal wrote:
Resent this again to keep the archives useful: The original Subject header was incorrect.
Dear all,
Its been a while since I autoyasted anything. I just started an install and was confronted with this message during the end of the installation:
Error while installing GRUB: sh: /usr/sbin/grub: No such file or directory
I checked the config file (generica-sles11_x84-64-LAMP+Tomcat.xml), for grub packages and found none. This is strange because these profiles were used some months ago. It only contains the grub config entry :
grub I looked in the SLES10 profiles and these contain a package: <package>grub-32bit</package>
Something is amiss, but can anyone spot the mistake?
Best wishes, S.
-- Simon Loewenthal/Tele2 GSM: +31 6 2000 5427 ******** IMPORTANT NOTICE ******** Please repect the X-Reply to klunky.co.uk. PGP available 0x6F54D215 This e-mail (including any attachments) may contain information that is confidential or otherwise protected from disclosure and it is intended only for the addressees. If you are not the intended recipient, please note that any copying, distribution or other use of information contained in this e-mail (and its attachments) is not allowed. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message (including any attachments) from your system. Please note that e-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be subject of unauthorized interception or other interference without the knowledge of sender or recipient. Tele2 only send and receive e-mails on the basis that Tele2 is not responsible for any such computer viruses, corruption or other interference or any consequences thereof. It ought to be obvious that my views do not represent my employer's views. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
I found the network problem. There was a MAC address hardcoded in the XML file. Oops. I reran the install (replaced the rouge MAC addr., with the correct one), and it passed the Bootloader section. To conclude: User error. As usual. On 07/15/2010 11:39 AM, Simon Loewenthal wrote:
Dear all,
I tried to replicate this error today, but failed, because now half way through the installation breaks with an error message stating that it cannot find the installation source (NFS). This makes me think that the network is being incorrectly configured (or correctly configured by AutoYast, but is useless for our network).
The checked the DHCP logs on the autoyast server, and only 1 IP is let out to the client. It does not ask for another one later for the same NIC nor the second NIC (There are two NICs on the client, although I do not know whether the second one is cabled up. Remote site and takes a while for the site management team to check it out).
The network config in the xml file is: <interfaces config:type="list"> <interface> <bootproto>static</bootproto> <device>eth0</device> <ipaddr>10.205.8.252</ipaddr> <name>NetXtreme II BCM5708S Gigabit Ethernet</name> <netmask>255.255.252.0</netmask> <prefixlen>22</prefixlen> <startmode>auto</startmode> <usercontrol>no</usercontrol> </interface> </interfaces>
The/etc/dhcpd.conf lets out only the IP 10.205.8.252.
Perhaps, during the install, autoyast decides to use map the second NIC to eth0, which means it won't find the network. I don't really know because I have no way of checking. Aborting the install leaves me with a dead machine.
Thus, is there anyway to make the autoyast xml profile a little more generic when it comes to settings the NIC? Instead of defining this below, perhaps one could allow autoyast to stick to the MAC address it used to boot from. (However I would like to avoid hardcoding the MAC into the XML file because this sort of defeats the purpose of autoyast) <device>eth0</device>
Any ideas?
-- Once this is solved I can move back to the grub not found problem.
On 07/14/2010 05:47 PM, Simon Loewenthal wrote:
Resent this again to keep the archives useful: The original Subject header was incorrect.
Dear all,
Its been a while since I autoyasted anything. I just started an install and was confronted with this message during the end of the installation:
Error while installing GRUB: sh: /usr/sbin/grub: No such file or directory
I checked the config file (generica-sles11_x84-64-LAMP+Tomcat.xml), for grub packages and found none. This is strange because these profiles were used some months ago. It only contains the grub config entry :
grub I looked in the SLES10 profiles and these contain a package: <package>grub-32bit</package>
Something is amiss, but can anyone spot the mistake?
Best wishes, S.
-- Simon Loewenthal/Tele2 GSM: +31 6 2000 5427 ******** IMPORTANT NOTICE ******** Please repect the X-Reply to klunky.co.uk. PGP available 0x6F54D215 This e-mail (including any attachments) may contain information that is confidential or otherwise protected from disclosure and it is intended only for the addressees. If you are not the intended recipient, please note that any copying, distribution or other use of information contained in this e-mail (and its attachments) is not allowed. If you have received this e-mail in error, kindly notify us immediately by telephone or e-mail and delete the message (including any attachments) from your system. Please note that e-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be subject of unauthorized interception or other interference without the knowledge of sender or recipient. Tele2 only send and receive e-mails on the basis that Tele2 is not responsible for any such computer viruses, corruption or other interference or any consequences thereof. It ought to be obvious that my views do not represent my employer's views. -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
on Wednesday 14 July 2010 Simon Loewenthal wrote:
Error while installing GRUB: sh: /usr/sbin/grub: No such file or directory
I checked the config file (generica-sles11_x84-64-LAMP+Tomcat.xml), for grub packages and found none. This is strange because these profiles were used some months ago. It only contains the grub config entry :
grub
actually you don't need to specify grub in the package list. It should get pulled in automatically. Do you see any resolver errors when you stop the installation in the proposal screen (confirm=true in the XML file or y2confirm on the kernel commandline)? What happens when you click on "Software" then? Is the grub package selected? -- ciao, Uwe Gansert Uwe Gansert SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) Business: http://www.suse.de/~ug listening to: "irregular Times" by Mao Tse Tung Experience -- To unsubscribe, e-mail: opensuse-autoinstall+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-autoinstall+help@opensuse.org
participants (5)
-
Erico Mendonça
-
Hans-Joachim Ehlers
-
Peter Pointner
-
Simon Loewenthal
-
Uwe Gansert