mdadm and lvm how to completely disable and remove vg/pv/lv -

mdadm and lvm how to completely disable and remove vg/pv/lv

In short the solution is just to use vgremove for the actual /dev/mapper device:

vgremove /dev/mapper/backups-backuplv


 

box mnt # mdadm --manage /dev/md8 --stop
mdadm: Cannot get exclusive access to /dev/md8:Perhaps a running process, mounted filesystem or active volume group?
box mnt # lv
lvchange     lvconvert    lvcreate     lvdisplay    lvextend     lvm          lvmchange    lvmconf      lvmdiskscan  lvmdump      lvmsadc      lvmsar       lvreduce     lvremove     lvrename     lvresize     lvs          lvscan
box mnt # pvdisplay
  --- Physical volume ---
  PV Name               /dev/md8
  VG Name               backups
  PV Size               7.28 TiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              1907688
  Free PE               20251
  Allocated PE          1887437
  PV UUID               IDnmlM-2r3q-McwV-y2at-djxK-DvPM-sFqlTo
  
box mnt # pvchange --help
  pvchange: Change attributes of physical volume(s)

pvchange
    [-a|--all]
    [-A|--autobackup y|n]
    [-d|--debug]
    [-f|--force]
    [-h|--help]
    [-t|--test]
    [-u|--uuid]
    [-x|--allocatable y|n]
    [--metadataignore y|n]
    [-v|--verbose]
    [--addtag Tag]
    [--deltag Tag]
    [--version]
    [PhysicalVolumePath...]

box mnt # pvchange --help^C
box mnt # pvremove /dev/md8
  PV /dev/md8 belongs to Volume Group backups so please use vgreduce first.
  (If you are certain you need pvremove, then confirm by using --force twice.)
box mnt # vgdisplay
  --- Volume group ---
  VG Name               backups
  System ID            
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  2
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               7.28 TiB
  PE Size               4.00 MiB
  Total PE              1907688
  Alloc PE / Size       1887437 / 7.20 TiB
  Free  PE / Size       20251 / 79.11 GiB
  VG UUID               DwxSxL-UmcV-TyjM-TUa1-ef4w-lrK5-cipxiI
  
box mnt # vgremove /dev/^C
box mnt # ls /dev/m
mapper/  mcelog   md/      md0      md0p1    md1      md1p1    md2      md20     md2p1    md8      md99     mem      mpt2ctl 
box mnt # ls /dev/m
mapper/  mcelog   md/      md0      md0p1    md1      md1p1    md2      md20     md2p1    md8      md99     mem      mpt2ctl 
box mnt # ls /dev/mapper/
backups-backuplv  control          
box mnt # vgremove /dev/mapper/backups-backuplv
  Invalid volume group name: backups/backuplv
  Run `vgremove --help' for more information.
box mnt # vgremove /dev/mapper/backups
Do you really want to remove volume group "backups" containing 1 logical volumes? [y/n]: y
Do you really want to remove and DISCARD active logical volume backuplv? [y/n]: y
  Logical volume "backuplv" successfully removed
  Volume group "backups" successfully removed
box mnt #
 


  • PHP Migration from 5.3 to 5.4+ and dealing with deprecated functions
  • ffmpeg vidstab to stabilize video
  • userdel user userdel: cannot lock /etc/passwd; try again later.
  • mdadm how to mount inactive array
  • How to find and mount mdadm arrays automatically
  • M2Crypto.SSL.Checker.WrongHost: Peer certificate subjectAltName does not match host, expected fedora-archive.ip-connect.vn.ua, got DNS:mirror.ip-connect.vn.ua
  • [Wed Sep 20 15:34:44 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Wed Sep 20 15:34:44 2017] [error] Init: Unable to read server certificate from file /www/ssl-certs/server.crt [Wed Sep 20 15:34:44 2017] [error] SSL Library Err
  • linux how to answer yes to copy
  • linux cp and mv will not overwrite due to alias!
  • ERROR 2006 (HY000) at line 567: MySQL server has gone away
  • vbulletin 4.2.5 after upgrading from 3.6 white screen fatal php errors
  • iptables v1.4.7: can't initialize iptables table `NAT': Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
  • Linux and FreeBSD how to set time and date
  • FreeBSD/OpenBSD OpenVPN Client error "Cannot allocate TUN/TAP dev dynamically"
  • kdenlive - No LADSPA plugins were found! Check your LADSPA_PATH environment variable. [producer_xml] failed to load transition "qtblend"
  • /usr/bin/supermin-helper exited with error status 1. To see full error messages you may need to enable debugging. See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs at /usr/bin/virt-list-partitions line 177.
  • Linux Unable to mount cifs/smb share in /etc/fstab
  • MySQL: table is marked as crashed solultion
  • bash Linux how to get first or last letters of a word
  • l2tp ipsec VPN Error Sep 12 18:16:25 vps pluto[7299]: ERROR: asynchronous network error report on eth0 (sport=500) for message to 192.5.6.2 port 20640, complainant 192.5.6.2: Connection refused [errno 111, origin ICMP type 3 code 3 (not authenticated