PDA

View Full Version : SLES11 SP2: first hard disk shows up as /dev/sdb in installationsystem



GŁnther Schwarz
03-Jul-2013, 16:52
Hardware: Dell PE R620 with PERC H710 RAID controller
System: SLES11 SP2 x86_64
Within the SUSE installation system the first hard disk (RAID1 on RAID
controller consisting of two SAS disks, no other disks are defined)
shows up as /dev/sdb. However, upon first booting the freshly installed
system the kernel finds the disk as /dev/sda. This messes up the
installation completely, of course, as only the root partition as
defined in grub is found.
Any ideas on how to deal with this other than manually repairing fstab,
grub etc after the initial install?

GŁnther

jmozdzen
03-Jul-2013, 18:06
Hi GŁnther,

> Within the SUSE installation system the first hard disk [...] shows up as /dev/sdb. However, upon first booting the freshly installed
> system the kernel finds the disk as /dev/sda.

this is working as expected - device names are not guaranteed in Linux, since... well... way back in time.

Use other persistent names to identify the partition, see the according options ("fstab options") during file system creation. Typical candidates are UUID and volume label. The former is (probably) unique across all and any device, the latter more readable IMHO.

It then maps to /dev/disk/by-uuid/* (or /dev/disk/by-label/*), labled volumes can be mounted by label name directly, too:

somehost:~ # cat /etc/fstab
LABEL=root / ext4 acl,user_xattr 1 1
LABEL=boot /boot ext4 acl,user_xattr 1 2
LABEL=home /home ext4 acl,user_xattr 1 2
LABEL=opt /opt ext4 acl,user_xattr 1 2
LABEL=swap0 swap swap defaults 0 0
LABEL=tmp /tmp ext4 acl,user_xattr 1 2
LABEL=usr /usr ext4 acl,user_xattr 1 2
LABEL=var /var ext4 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

Regards,
Jens

G√ľnther Schwarz
04-Jul-2013, 07:56
jmozdzen wrote:

>> Within the SUSE installation system the first hard disk [...] shows
> up as /dev/sdb. However, upon first booting the freshly installed
>> system the kernel finds the disk as /dev/sda.
>
> this is working as expected - device names are not guaranteed in Linux,
> since... well... way back in time.

Yes, of course it is the SUSE installer that fails here, not the kernel.
Still knowing that it is working as expected does not help me much with
my installation problem.

> Use other persistent names to identify the partition, see the according
> options ("fstab options") during file system creation. Typical
> candidates are UUID and volume label. The former is (probably) unique
> across all and any device, the latter more readable IMHO.

Using the UUID in my AUTOYaST files rather than sd* is probably the way
to go, and I will try this on my next test. Still a PITA as I do have
many systems waiting for installation. Sorting out the UUID of every one
of them before doing to installation is not something I'm looking
forward to do.
Any other ideas or suggestions?

G√ľnther

jmozdzen
04-Jul-2013, 09:58
Hi GŁnther,


jmozdzen wrote:

>> Within the SUSE installation system the first hard disk [...] shows
> up as /dev/sdb. However, upon first booting the freshly installed
>> system the kernel finds the disk as /dev/sda.
>
> this is working as expected - device names are not guaranteed in Linux,
> since... well... way back in time.

Yes, of course it is the SUSE installer that fails here, not the kernel.

I disagree here. If you as the admin decide to use non-persistent device names, I wouldn't call that any other one's fault ;)


Still knowing that it is working as expected does not help me much with
my installation problem.

You didn't tell you knew about the source of what you're seeing, so I guessed it would be nice to point out that this behaviour isn't considered a bug in the Linux community for ages. And there are ways to deal with it - I named two alternative options.


Using the UUID in my AUTOYaST files rather than sd* is probably the way
to go, and I will try this on my next test. Still a PITA as I do have
many systems waiting for installation. Sorting out the UUID of every one
of them before doing to installation is not something I'm looking
forward to do.
Any other ideas or suggestions?

Have you had a look at the various docs floating around, i.e. https://www.suse.com/documentation/sles11/singlehtml/book_autoyast/book_autoyast.html#CreateProfile.Partitioning - it says there's no need to specify the disk device.

Regards,
Jens

G√ľnther Schwarz
09-Jul-2013, 14:54
jmozdzen wrote:

> G√ľnther Schwarz;14256 Wrote:
>> jmozdzen wrote:

> G√ľnther Schwarz;14256 Wrote:
>> Using the UUID in my AUTOYaST files rather than sd* is probably the way
>> to go, and I will try this on my next test. Still a PITA as I do have
>> many systems waiting for installation. Sorting out the UUID of every
>> one
>> of them before doing to installation is not something I'm looking
>> forward to do.
>> Any other ideas or suggestions?
>
> Have you had a look at the various docs floating around, i.e.
> https://www.suse.com/documentation/sles11/singlehtml/book_autoyast/book_autoyast.html#CreateProfile.Partitioning
> - it says there's no need to specify the disk device.

Well, I throw in the towel here. Yet another case of RTFM. But anyway,
thank you for the link to the interesting document.
Omitting the <device> entry completely and not wiping out the partition
table does do the trick indeed for my systems. The <boot> section has to
be tweaked similarly with the <linux> section and proper entries for the
hd(x,y) instructions.

Just for the records the sections for boot and partitioning that work
for me on an Dell PE R620 (PERC H710) which comes with a single
formatted VD with two FAT partitions used by Dell system tools:

<bootloader>
<device_map config:type="list">
<device_map_entry>
<!-- order of devices in target map -->
<firmware>hd0</firmware>
<!-- name of device (disk) -->
<!-- <linux>/dev/sda</linux> -->
</device_map_entry>
</device_map>
<global>
<activate>true</activate>
<default>SUSE Linux Enterprise Server 11 SP2 - 3.0.13-0.27</default>
<generic_mbr>true</generic_mbr>
<gfxmenu>(hd0,2)/message</gfxmenu>
<lines_cache_id>3</lines_cache_id>
<timeout config:type="integer">8</timeout>
</global>
<loader_type>grub</loader_type>
<sections config:type="list">
<section>
<append>resume=/dev/vg1/swap splash=silent
crashkernel=128M-:64M showopts</append>
<image>(hd0,2)/vmlinuz-3.0.13-0.27-default</image>
<initial>1</initial>
<initrd>(hd0,2)/initrd-3.0.13-0.27-default</initrd>
<lines_cache_id>0</lines_cache_id>
<name>SUSE Linux Enterprise Server 11 SP2 - 3.0.13-0.27</name>
<original_name>linux</original_name>
<root>/dev/vg1/root</root>
<type>image</type>
<vgamode>0x314</vgamode>
</section>
<section>
<append>showopts ide=nodma apm=off noresume edd=off
powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset
x11failsafe</append>
<image>(hd0,2)/vmlinuz-3.0.13-0.27-default</image>
<initrd>(hd0,2)/initrd-3.0.13-0.27-default</initrd>
<lines_cache_id>1</lines_cache_id>
<name>Failsafe -- SUSE Linux Enterprise Server 11 SP2 -
3.0.13-0.27</name>
<original_name>failsafe</original_name>
<root>/dev/vg1/root</root>
<type>image</type>
<vgamode>0x314</vgamode>
</section>
</sections>
</bootloader>

<partitioning config:type="list">
<drive>
<!-- device entries are optional - AUTOYaST tries a guess for the
first one -->
<!-- <device>/dev/sda</device> -->
<initialize config:type="boolean">false</initialize>
<use>all</use>
<partitions config:type="list">
<!-- first utility partition on Dell PE servers -->
<partition>
<create config:type="boolean">false</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<partition_nr config:type="integer">1</partition_nr>
<raid_options/>
<resize config:type="boolean">false</resize>
</partition>
<!-- second utility partition on Dell PE servers -->
<partition>
<create config:type="boolean">false</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<partition_nr config:type="integer">2</partition_nr>
<raid_options/>
<resize config:type="boolean">false</resize>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">ext2</filesystem>
<format config:type="boolean">true</format>
<fstopt>acl,user_xattr</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<mount>/boot</mount>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">3</partition_nr>
<raid_options/>
<resize config:type="boolean">false</resize>
<size>192m</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">ext3</filesystem>
<format config:type="boolean">false</format>
<loop_fs config:type="boolean">false</loop_fs>
<lvm_group>vg1</lvm_group>
<mountby config:type="symbol">uuid</mountby>
<partition_id config:type="integer">142</partition_id>
<partition_nr config:type="integer">4</partition_nr>
<raid_options/>
<resize config:type="boolean">false</resize>
<size>max</size>
</partition>
</partitions>
<pesize></pesize>
<type config:type="symbol">CT_DISK</type>
<use>all</use>
</drive>
<drive>
<device>/dev/vg1</device>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<create config:type="boolean">true</create>
<crypt_fs config:type="boolean">false</crypt_fs>
<filesystem config:type="symbol">xfs</filesystem>
<format config:type="boolean">true</format>
<fstopt>defaults</fstopt>
<loop_fs config:type="boolean">false</loop_fs>
<lv_name>root</lv_name>
<mount>/</mount>
<mountby config:type="symbol">device</mountby>
<partition_id config:type="integer">131</partition_id>
<raid_options/>
<resize config:type="boolean">false</resize>
<size>20g</size>
</partition>
</partitions>
<pesize>4M</pesize>
<type config:type="symbol">CT_LVM</type>
<use>all</use>
</drive>

G√ľnther

jmozdzen
09-Jul-2013, 15:14
Hi GŁnther,

thank you for reporting back and sharing your config - I'm sure this will help others, not only in case of similar errors, but as a starting point for a first own configuration, too!

Regards,
Jens

G√ľnther Schwarz
10-Jul-2013, 17:09
jmozdzen wrote:

> thank you for reporting back and sharing your config - I'm sure this
> will help others, not only in case of similar errors, but as a starting
> point for a first own configuration, too!

That was my intention. There is not that much information until now for
AUTOYaST in this section. So my laziness with respect to reading manuals
might result in something useful. Thank for very much again for pointing
me in the right direction.

G√ľnther