do "dmsetup table" and see if there is a mapping to the device you
want to get rid of.
If there is no mapping you may be able to exclude the device with a
filter in /etc/lvm/lvm.conf or you may have to used the really
dangerous commands to clear the data of the disk.
Doing just about anything is going to be really dangerous and tricky
given the device has duplicate uuids at the LV and PV level. There
are ways to fix it, but most of those ways will either be exactly
right, exactly wrong and you no longer have any data.
I don't think fdisk will prevent you from removing the partitions, but
you will need a reboot or manually delete the live partitions mappings
to get them to disappear from the OS.
On Mon, Dec 2, 2019 at 10:51 AM Patrick O'Callaghan
<pocallaghan(a)gmail.com> wrote:
>
> On Mon, 2019-12-02 at 21:05 +0800, Ed Greshko wrote:
> > > How can I blow away LVM on the cloned drive without having to start
> > > again from scratch?
> > >
> >
> > Are you looking for commands like lvremove and pvremove?
>
> I'd already looked at those.
>
> lvremove takes an LV identifier as argument, but since the cloned
> partition has the same id as the original, and the original is still in
> use on the active system, it won't let me remove it:
>
> $ sudo lvremove -t -f fedora_localhost-live/swap
> TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
> /dev/sde: open failed: No medium found <------------------ I don't know
what this is -------------
> WARNING: Not using device /dev/sdc3 for PV
VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS.
> WARNING: PV VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS prefers device /dev/sda3
because device is used by LV.
> Logical volume fedora_localhost-live/swap in use.
>
>
> pvremove gives the same error as before:
>
> $ sudo pvremove /dev/sdc3
> /dev/sde: open failed: No medium found
> WARNING: Not using device /dev/sdc3 for PV VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS.
> WARNING: PV VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS prefers device /dev/sda3 because
device is used by LV.
> Device /dev/sdc3 excluded by a filter.
>
> I don't know why it's complaining about /dev/sde. There is no such
> device on my system:
>
> $ lsblk -f
> NAME FSTYPE LABEL UUID
FSAVAIL FSUSE% MOUNTPOINT
> sda
> ├─sda1 vfat 13EE-9841
579.2M 3% /boot/efi
> ├─sda2 ext4
39fbc534-68c2-421b-9bcd-96fd22320f37 676.5M 24% /boot
> └─sda3 LVM2_member
VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS
> ├─fedora_localhost--live-swap swap
6c16e7ba-a483-4832-ab9b-a32af7f46d62 [SWAP]
> ├─fedora_localhost--live-home ext4
929f2710-cb9e-44d4-bdd8-52f733a408e6
> └─fedora_localhost--live-root ext4
d38245ca-2e6d-491f-991b-c93cb76ce1af 35.7G 42% /
> sdb
> └─sdb1 btrfs home
6496d6da-6b7a-4cdd-9bb8-767c08d1c84e 364.2G 80% /home
> sdc
> ├─sdc1 vfat 71DB-ECF6
> ├─sdc2 ext4
b35d090b-0072-491b-8664-5c18aa16dd4d 676.5M 24% /home/poc/SDC2
> ├─sdc3 LVM2_member
VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS
> ├─sdc4 swap swap
4712b7bc-be30-467b-a5c5-67dcb8c9eb53
> └─sdc5 ext4 home
c1df25d9-4c89-43a5-886d-3bbbf8513b22 679G 55% /Wim
> sdd
> ├─sdd1 ntfs Recovery DEC47E01C47DDBE9
> ├─sdd2 vfat 6881-A320
> ├─sdd3
> ├─sdd4 ntfs 2224823A248210C9
> └─sdd5 ntfs 1C36E53036E50B98
>
> /dev/sda is the original (source) disk and /dev/sdc the new (cloned)
> disk. Some partition UUIDs on /dev/sdc have been changed using gparted,
> but it refuses to touch /dev/sdc3 which thus has the same UUID as the
> original /dev/sda3. Ignore the temporary mount points for these.
>
> For completeness, here are the current LV and PV listings:
>
> $ sudo lvdisplay
> /dev/sde: open failed: No medium found
> WARNING: Not using device /dev/sdc3 for PV
VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS.
> WARNING: PV VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS prefers device /dev/sda3
because device is used by LV.
> --- Logical volume ---
> LV Path /dev/fedora_localhost-live/swap
> LV Name swap
> VG Name fedora_localhost-live
> LV UUID fTxmLI-LtUa-zBff-Ozyv-GiEY-XKhJ-nLTLFY
> LV Write Access read/write
> LV Creation host, time localhost-live, 2019-11-07 18:23:56 +0000
> LV Status available
> # open 2
> LV Size 7.72 GiB
> Current LE 1977
> Segments 1
> Allocation inherit
> Read ahead sectors auto
> - currently set to 256
> Block device 253:0
>
> --- Logical volume ---
> LV Path /dev/fedora_localhost-live/home
> LV Name home
> VG Name fedora_localhost-live
> LV UUID 20haaX-QwiB-aCN1-acvW-WAZT-JSbP-RoaiVF
> LV Write Access read/write
> LV Creation host, time localhost-live, 2019-11-07 18:23:57 +0000
> LV Status available
> # open 0
> LV Size <33.62 GiB
> Current LE 8606
> Segments 1
> Allocation inherit
> Read ahead sectors auto
> - currently set to 256
> Block device 253:1
>
> --- Logical volume ---
> LV Path /dev/fedora_localhost-live/root
> LV Name root
> VG Name fedora_localhost-live
> LV UUID 7i9QWE-pyJj-MbGC-pAP8-AQsK-Cb6H-1u5LOi
> LV Write Access read/write
> LV Creation host, time localhost-live, 2019-11-07 18:23:57 +0000
> LV Status available
> # open 1
> LV Size <68.86 GiB
> Current LE 17628
> Segments 1
> Allocation inherit
> Read ahead sectors auto
> - currently set to 256
> Block device 253:2
>
> [poc@Bree ~]$ sudo pvdisplay
> /dev/sde: open failed: No medium found
> WARNING: Not using device /dev/sdc3 for PV
VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS.
> WARNING: PV VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS prefers device /dev/sda3
because device is used by LV.
> --- Physical volume ---
> PV Name /dev/sda3
> VG Name fedora_localhost-live
> PV Size 110.20 GiB / not usable 4.00 MiB
> Allocatable yes (but full)
> PE Size 4.00 MiB
> Total PE 28211
> Free PE 0
> Allocated PE 28211
> PV UUID VKT04D-m4CK-6n7L-vSMI-vohC-W8bt-zPVCxS
>
> poc
> _______________________________________________
> users mailing list -- users(a)lists.fedoraproject.org
> To unsubscribe send an email to users-leave(a)lists.fedoraproject.org
> Fedora Code of Conduct:
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines:
https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives:
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org