Skip to content

Commit

Permalink
Do not use pvcreate -f option
Browse files Browse the repository at this point in the history
Do not use pvcreate -f option instead wipe signatures explicitly on the
partition device. Reason being that -f is not very well defined and 
tomorrow it can be overloaded to do more things. So it is safer to wipe
signatures explicitly and use pvcreate without -f.

At this point we own the disk. If there are any signatures on disk to
being with, we will not be here until and unless user asked to wipe
signatures using WIPE_SIGNATURES=true. We will not care for any signatures
found on disk after creating partition.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>

Closes: #124
Approved by: cgwalters
  • Loading branch information
rhvgoyal authored and cgwalters-bot committed Apr 26, 2016
1 parent 8064872 commit df2af94
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docker-storage-setup.sh
Expand Up @@ -651,10 +651,13 @@ create_disk_partitions() {
create_partition $dev

# By now we have ownership of disk and we have checked there are no
# signatures on disk or signatures have been overridden. Don't care
# signatures on disk or signatures should be wiped. Don't care
# about any signatures found in the middle of disk after creating
# partition and use force option.
pvcreate -f ${dev}1
# partition and wipe signatures if any are found.
if ! wipefs -a ${dev}1; then
Fatal "Failed to wipe signatures on device ${dev}1"
fi
pvcreate ${dev}1
PVS="$PVS ${dev}1"
done
}
Expand Down

0 comments on commit df2af94

Please sign in to comment.