setup-storage fails on blank disk
wfai at parplies.de
Wed Jan 3 17:28:36 CET 2018
Andreas Heinlein wrote on 2018-01-03 13:53:40 +0100 [setup-storage fails on blank disk]:
> I have encountered a problem with setup-storage which occurs only when
> the disk is blank, i.e. wiped with nwipe/dban or brand new. It then
> fails on creating the LVM; running 'pvcreate' returns 'cannot open
> /dev/sda5 exclusively'.
this is probably unrelated, but is there any reason to put the LVM PV inside
a "logical" volume? DOS extended partitions seem to be the worst hack ever
invented to get around a limitation in a bad design, yet they repeatedly
and apparently unnecessarily pop up in quoted disk_configs:
> This is your disk_config file:
> # generic disk configuration for one small disk
> # disk size from 500Mb up to what you can buy today
> # <type> <mountpoint> <size in mb> <fstype> <mount options> [extra options]
> disk_config disk1 disklabel:msdos bootable:1 preserve_lazy:6 align-at:1M fstabkey:uuid
> primary /boot 300 ext4 rw createopts="-O ^64bit,^metadata_csum"
> logical - 29500-30000 - -
> logical /media/daten 1024- ext4 acl createopts="-O ^64bit,^metadata_csum -L Daten"
I count three partitions, which would work perfectly with primary partitions
(furthermore, you are using LVM to have an arbitrary number of named and
dynamic "volumes" (i.e. partitions) anyway, so if you needed more, LVM would
be the superior mechanism; of course, your specific requirements may vary).
Ok, you are preserving a logical partition, so in this particular case you'd
actually need to stick with logical partitions, but the partition in question
is ext4, not FAT-based, so it doesn't appear to be a legacy Windoze issue.
My point: am I missing something, and there is some obscure benefit of putting
an LVM container within an extended-partition-container (such as hiding it
from something), or is it simply a common misconception that you for some
reason cannot or should not put an LVM PV (or even several individual native
Linux partitions - such as /, /var and /tmp) into primary partitions -
assuming you only need upto four of them (and, obviously, assuming you are
still using MSDOS partition tables)?
Or, differently: for a *blank disk*, you obviously won't be preserving sda6,
and you probably aren't referencing it by partition number ("fstabkey:uuid"),
so does using 'primary' instead of 'logical' for all three partitions change
anything concerning the error you are experiencing?
Hope that helps someone (perhaps me ;-) ...
More information about the linux-fai