teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame fedora-crypto-lvm-hack

Michal Schmidt 0afbbc
#!/bin/sh
Michal Schmidt 0afbbc
#
Michal Schmidt 0afbbc
# Test if the given device is an LVM PV. If yes, activate its VG.
Michal Schmidt 0afbbc
#
Michal Schmidt 0afbbc
# Suggested by Milan Brož in
Michal Schmidt 0afbbc
# https://bugzilla.redhat.com/show_bug.cgi?id=741655#c19
Michal Schmidt 0afbbc
Michal Schmidt 0afbbc
device="$1"
Michal Schmidt 0afbbc
[ -b "$device" ] || exit 1
Michal Schmidt 0afbbc
Michal Schmidt 0afbbc
blkid -t TYPE=LVM2_member "$device" > /dev/null && \
Michal Schmidt 0afbbc
    vgchange -a y $(pvs --noheadings -o vg_name "$device")