AutoYAST install with LVM without underlying partition

I´m trying to do an unattendet autoyast install on SLES 11 SP3 with a harddisk layout that looks as follows:

/dev/sda1 /boot ext3
/dev/sdb complete disk without making a partition /dev/sdb1 in volume group vg0
/dev/sdc complete disk without making a partition /dev/sdb1 in volume group vg1

/dev/vg0/lv_root /root xfs
/dev/vg0/lvxxxxx … …

/dev/vg1/lv_userdata /userdata xfs

Unfortunately the installation stops with the error: “Bei der folgenden Aktion ist ein Fehler aufgetreten: Volumegroup vg0 (0 B) wird aus erstellt.
Systemfehlercode -4004”
“Volumegroup vg0 (0 B) will be created from . Systemerror -4004”

Is it possible to do this setup with autoyast. I can make the setup interactive with these settings. The server works fine.
Cloning this fresh server and deploying the created autoinst.xml results in the above error.

Hi Alexander,

this response is pure guesswork, but: I’m pretty sure someone simply made partitioning an implicit requirement.

So in the end, even if it is a waste of a number of blocks, I recommend to create that single partition covering (almost) the whole disk, even if it seems a waste of space. If for nothing else, be motivated by the poor admin soul following you and scratching his/her head, trying to grasp what had happened that the partition table got lost on those two disks :wink:

In people’s mind, “disks” have to be partitioned.

If this really is more than an annoyance to you, please either open a service request or use http://support.novell.com/additional/bugreport.html?sourceidint=suplnav4a_bug to report it without any means to trace the issue.

BTW: Things get worse when you use USB devices - there are different OS assumptions about different types of “USB media” (including making assumptions based on the “removable media” flag). You may end up partitioning a device just for good measure, but the next system you plug the device (or i.e. CF card) into won’t work, because it assumes the FS is using the complete device…

Regards,
Jens

Hi,

I’m trying to accomplish the same as Alexander but get obviously the same error.
Also did a manual install with the option to create an autoinst.xml file. In this manual install i could use /dev/sdb as PV and did not need to create a partition, but the generated xml file is not working (and indeed makes no sense when I try to analyze it)
If people think that disks have to be partioned, well then IMHO they should not be working in a operating system company.
There is even a similar post from jan 2012 (https://forums.suse.com/archive/index.php/t-39.html). So had hoped that novell had fixed or changed it by now, but I’m afraid not :frowning:

Cheers
Christof

Hi Christof,

There is even a similar post from jan 2012 (https://forums.suse.com/archive/index.php/t-39.html). So had hoped that novell had fixed or changed it by now

these forums are run by users for users, there’s no official SUSE/Novell participation and this is not the way to report bugs. Have you opened a service request? Then I’d like to have a peek at what the “officials” are saying on the subject…

Regards,
Jens

Hi,

I don’t have created a service request (yet), since I need the future now. So the request might still be an action to do.

For those interested, I have created some config which gets the job done. It’s odne via the postpartitioning-scripts. I have first tried every option to do it via the pre-scripts but it failed every time somewhere.
So the approach is to have the partitioning done by autoyast (but then it uses lvm on a partition) and after the partition is done, to backup some files, destroy the lvm config of yast and rebuild the lvm on top of sdb. Code snipptes from the xml file are below:

disk layout for yast:

/dev/sda true true false ext3 false false max device 131 1 /boot true defaults CT_DISK all
<drive>
  <device>/dev/sdb</device>
  <initialize config:type="boolean">true</initialize>
  <partitions config:type="list">
    <partition>
      <lvm_group>vgsystem</lvm_group>
      <partition_type>primary</partition_type>
      <size>max</size>
    </partition>
  </partitions>
  <use>all</use>
</drive>

<drive>
  <device>/dev/vgsystem</device>
  <is_lvm_vg config:type="boolean">true</is_lvm_vg>
  <initialize config:type="boolean">true</initialize>
  <pesize>4194304</pesize>
  <use>all</use>
  <partitions config:type="list">
                                    <partition>
      <filesystem config:type="symbol">ext3</filesystem>
      <size>6G</size>
      <mount>/</mount>
      <lv_name>lvroot</lv_name>
      <format config:type="boolean">true</format>
      <fstopt>defaults</fstopt>
    </partition>
                                    <partition>
      <filesystem config:type="symbol">ext3</filesystem>
      <size>1G</size>
      <mount>/home</mount>
      <lv_name>lvhome</lv_name>
      <format config:type="boolean">true</format>
      <fstopt>defaults</fstopt>
    </partition>
                                    <partition>
      <filesystem config:type="symbol">ext3</filesystem>
      <size>1G</size>
      <mount>/opt</mount>
      <lv_name>lvopt</lv_name>
      <format config:type="boolean">true</format>
      <fstopt>defaults</fstopt>
    </partition>
                                            <partition>
      <filesystem config:type="symbol">swap</filesystem>
      <size>2G</size>
      <mount>swap</mount>
      <lv_name>lvswap</lv_name>
      <format config:type="boolean">true</format>
      <fstopt>defaults</fstopt>
    </partition>
                                    <partition>
      <filesystem config:type="symbol">ext3</filesystem>
      <size>2G</size>
      <mount>/tmp</mount>
      <lv_name>lvtmp</lv_name>
      <format config:type="boolean">true</format>
      <fstopt>defaults</fstopt>
    </partition>
                                    <partition>
      <filesystem config:type="symbol">ext3</filesystem>
      <size>1G</size>
      <mount>/var</mount>
      <lv_name>lvvar</lv_name>
      <format config:type="boolean">true</format>
      <fstopt>defaults</fstopt>
    </partition>
          </partitions>
</drive>

and the postpartitioning-scripts part: (I know there is some funny looking code in it but this is because our xml files are generated from an internal cmdb tool, so because of that some dirty hacks were needed :-))

true shell false <![CDATA[#!/bin/bash
      umount /mnt/boot
      mkdir -p /tmp/boot && mount /dev/sda1 /tmp/boot


      umount /mnt/proc
      umount /mnt/dev
      umount /mnt/sys

      cd /mnt && tar --exclude=lost+found -czf /tmp/boot/root.tgz .
      cd /
      umount -a -t ext3
      swapoff /dev/vgsystem/lvswap ; 
      lvremove -f vgsystem/lvroot ; lvremove -f vgsystem/lvhome ; lvremove -f vgsystem/lvopt ; lvremove -f vgsystem/lvswap ; lvremove -f vgsystem/lvtmp ; lvremove -f vgsystem/lvvar ; 
      vgremove -f vgsystem
      pvremove /dev/sdb1
      dd if=/dev/zero of=/dev/sdb bs=512 count=1
      sfdisk -R /dev/sdb
      pvcreate /dev/sdb
      vgcreate vgsystem /dev/sdb
      lvcreate -n lvroot -L 6G vgsystem ; lvcreate -n lvhome -L 1G vgsystem ; lvcreate -n lvopt -L 1G vgsystem ; lvcreate -n lvswap -L 2G vgsystem ; lvcreate -n lvtmp -L 2G vgsystem ; lvcreate -n lvvar -L 1G vgsystem ; 
      mkfs -t ext3 -j /dev/vgsystem/lvroot ; tune2fs -c 0 -i 0 /dev/vgsystem/lvroot ; mkfs -t ext3 -j /dev/vgsystem/lvhome ; tune2fs -c 0 -i 0 /dev/vgsystem/lvhome ; mkfs -t ext3 -j /dev/vgsystem/lvopt ; tune2fs -c 0 -i 0 /dev/vgsystem/lvopt ; mkfs -t swap -j /dev/vgsystem/lvswap ; tune2fs -c 0 -i 0 /dev/vgsystem/lvswap ; mkfs -t ext3 -j /dev/vgsystem/lvtmp ; tune2fs -c 0 -i 0 /dev/vgsystem/lvtmp ; mkfs -t ext3 -j /dev/vgsystem/lvvar ; tune2fs -c 0 -i 0 /dev/vgsystem/lvvar ; 
      for fs in  /:/dev/vgsystem/lvroot /home:/dev/vgsystem/lvhome /opt:/dev/vgsystem/lvopt swap:/dev/vgsystem/lvswap /tmp:/dev/vgsystem/lvtmp /var:/dev/vgsystem/lvvar ; do echo $fs >> /tmp/fslist ; done
      
      for fs in $(cut -d ":" -f 1 /tmp/fslist | sort ) ; do
        dev=$(grep "^${fs}:" /tmp/fslist | head -1 | cut -d ":" -f 2)
        case $fs in
          swap)
            ;;
          *)
            mkdir -p /mnt$fs && mount $dev /mnt$fs
            ;;
        esac
      done
      
      mkswap -f /dev/vgsystem/lvswap ; swapon /dev/vgsystem/lvswap ; 
      mkdir -p /tmp/boot && mount /dev/sda1 /tmp/boot
      cd /mnt && tar xzf /tmp/boot/root.tgz
      cd /
      umount /tmp/boot
      mount /dev/sda1 /mnt/boot
      mount -t proc proc /mnt/proc
      mount -t sysfs sysfs /mnt/sys
      mount --bind /dev /mnt/dev

      ]]>
    </source>
  </script>
</postpartitioning-scripts>

Hi Guys,

I am getting same issue. Autoinstall fails during VG creation. Any solution? Please help me.

See the partitioning xml code in my previous post, that works if it’s fine with you to get your PV on a partition instead of the whole disk.
If you need the PV to cover the whole disk without partition, then it’s not possible unless you use the postpartitioning-scripts.
Can you post your partitioning xml?