Ok, this will need some more experimental work I'm afraid. Could you try to do
some manual steps and report back before we actually build this into
setup-storage?

On that particular host, I'd like to know how

parted -s /dev/sda mklabel msdos
parted -s /dev/sda mkpart primary ext3 512B 536871423B
parted -s /dev/sda mkpart primary  536871424B 80026361855B
parted -s /dev/sda set 1 boot on
mkfs.ext3  /dev/sda1
parted -s /dev/sda set 2 lvm on
vgchange -a y vg0

behaves in comparison to

vgchange -a n vg0
parted -s /dev/sda mklabel msdos
parted -s /dev/sda mkpart primary ext3 512B 536871423B
parted -s /dev/sda mkpart primary  536871424B 80026361855B
parted -s /dev/sda set 1 boot on
mkfs.ext3  /dev/sda1
parted -s /dev/sda set 2 lvm on
vgchange -a y vg0

Apart from the extra output line, I can see no difference : in both cases, the LVM volumes are back and active after the last vgchange.
Here's the full output of the second command list.

r...@lutil:~# vgchange -a n vg0
 0 logical volume(s) in volume group "vg0" now active
r...@lutil:~# parted -s /dev/sda mklabel msdos
r...@lutil:~# parted -s /dev/sda mkpart primary ext3 512B 536871423B
r...@lutil:~# parted -s /dev/sda mkpart primary  536871424B 80026361855B
r...@lutil:~# parted -s /dev/sda set 1 boot on
r...@lutil:~# mkfs.ext3  /dev/sda1
mke2fs 1.41.11 (14-Mar-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768 inodes, 131072 blocks
6553 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=134217728
4 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
       32768, 98304

Writing inode tables: done Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
r...@lutil:~# parted -s /dev/sda set 2 lvm on
r...@lutil:~# vgchange -a y vg0
 7 logical volume(s) in volume group "vg0" now active
r...@lutil:~#

--
Nicolas


Antwort per Email an