Removing LVM

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Removing LVM

Patrick O'Callaghan-2
I'm in the process of trying to clone an existing drive to a new SSD.
The existing drive was created by a fresh F31 install, which used LVM
for root and swap. I normally turn this off when installing but didn't
this time, either because it's not possible or because I couldn't find
the magic button.

Anyway, I cloned each partition using dd, but of course that also
cloned the LVM stuff, including the LVM identifiers. Now I'd like to
roll back the clone of root and just format the partition as ext4, plus
an extra swap partition, but gparted won't let me, as it thinks the
cloned LVM stuff is part of an active LVM setup. The specific error 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.
Device /dev/sdc3 excluded by a filter.

Same thing happens if I try to delete the partition.

How can I blow away LVM on the cloned drive without having to start
again from scratch?

poc
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Ed Greshko


On Mon, Dec 2, 2019, 20:47 Patrick O'Callaghan <[hidden email]> wrote:
I'm in the process of trying to clone an existing drive to a new SSD.
The existing drive was created by a fresh F31 install, which used LVM
for root and swap. I normally turn this off when installing but didn't
this time, either because it's not possible or because I couldn't find
the magic button.

Anyway, I cloned each partition using dd, but of course that also
cloned the LVM stuff, including the LVM identifiers. Now I'd like to
roll back the clone of root and just format the partition as ext4, plus
an extra swap partition, but gparted won't let me, as it thinks the
cloned LVM stuff is part of an active LVM setup. The specific error 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.
Device /dev/sdc3 excluded by a filter.

Same thing happens if I try to delete the partition.

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?

_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Patrick O'Callaghan-2
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 -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Roger Heflin-3
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
<[hidden email]> 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 -- [hidden email]
> To unsubscribe send an email to [hidden email]
> 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@...
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Patrick O'Callaghan-2
On Mon, 2019-12-02 at 11:19 -0600, Roger Heflin wrote:
>
> 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.

Very scary. This is exactly why I don't want to use LVM. I don't
understand it.

> 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.

I'm considering either fdisk or a 'dd if=/dev/zero ..." on the
offending partition, followed by a format with gparted.

poc
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Alasdair G Kergon
In reply to this post by Patrick O'Callaghan-2
On Mon, Dec 02, 2019 at 12:46:57PM +0000, Patrick O'Callaghan wrote:
> Anyway, I cloned each partition using dd, but of course that also
> cloned the LVM stuff, including the LVM identifiers

> How can I blow away LVM on the cloned drive without having to start
> again from scratch?

Maybe vgimportclone would help?

DESCRIPTION
       vgimportclone  is  used  to import a duplicated VG (e.g. hardware snap-
       shot).  Duplicate VG(s) and PV(s) are not able to be  used  until  they
       are  made  to  coexist  with the origin VG(s) and PV(s).  vgimportclone
       renames the VG associated with the  specified  PV(s)  and  changes  the
       associated VG and PV UUIDs.

(But if you already used 'dd' to create the problem you should be willing to
use 'dd' again to revert it).

Alasdair
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Roger Heflin-3
In reply to this post by Patrick O'Callaghan-2
The easiest way to move an vg to a new device is partitioning the new
device, create a pv on the correct device, and then add that device to
the vg and then do a pvmove to move the data to the new device.  Once
done you remove the device from the vg.

cloning the boot can be done with dd, but if you do that it is best to
only do up to were the 2nd partition starts and deal with the 2nd
partition with the above lvm commands.

On Mon, Dec 2, 2019 at 12:00 PM Patrick O'Callaghan
<[hidden email]> wrote:

>
> On Mon, 2019-12-02 at 11:19 -0600, Roger Heflin wrote:
> >
> > 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.
>
> Very scary. This is exactly why I don't want to use LVM. I don't
> understand it.
>
> > 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.
>
> I'm considering either fdisk or a 'dd if=/dev/zero ..." on the
> offending partition, followed by a format with gparted.
>
> poc
> _______________________________________________
> users mailing list -- [hidden email]
> To unsubscribe send an email to [hidden email]
> 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@...
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Patrick O'Callaghan-2
In reply to this post by Alasdair G Kergon
On Mon, 2019-12-02 at 18:12 +0000, Alasdair G Kergon wrote:

> On Mon, Dec 02, 2019 at 12:46:57PM +0000, Patrick O'Callaghan wrote:
> > Anyway, I cloned each partition using dd, but of course that also
> > cloned the LVM stuff, including the LVM identifiers
> > How can I blow away LVM on the cloned drive without having to start
> > again from scratch?
>
> Maybe vgimportclone would help?
>
> DESCRIPTION
>        vgimportclone  is  used  to import a duplicated VG (e.g. hardware snap-
>        shot).  Duplicate VG(s) and PV(s) are not able to be  used  until  they
>        are  made  to  coexist  with the origin VG(s) and PV(s).  vgimportclone
>        renames the VG associated with the  specified  PV(s)  and  changes  the
>        associated VG and PV UUIDs.

Could be. I'll have a look.

> (But if you already used 'dd' to create the problem you should be willing to
> use 'dd' again to revert it).

'dd' of /dev/zero is an option.

poc
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Patrick O'Callaghan-2
In reply to this post by Roger Heflin-3
On Mon, 2019-12-02 at 12:16 -0600, Roger Heflin wrote:
> The easiest way to move an vg to a new device is partitioning the new
> device, create a pv on the correct device, and then add that device to
> the vg and then do a pvmove to move the data to the new device.  Once
> done you remove the device from the vg.

Thanks. Something to bear in mind if I ever have to do this again, but
not that useful in the current situation I think.

poc
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Roger Heflin-3
it might be if you use dd to clear only the duplicate pv/lvm partition
header and then start with the pvcreate/vgextend/pvmove/vgreduce
steps.

On Mon, Dec 2, 2019 at 12:39 PM Patrick O'Callaghan
<[hidden email]> wrote:

>
> On Mon, 2019-12-02 at 12:16 -0600, Roger Heflin wrote:
> > The easiest way to move an vg to a new device is partitioning the new
> > device, create a pv on the correct device, and then add that device to
> > the vg and then do a pvmove to move the data to the new device.  Once
> > done you remove the device from the vg.
>
> Thanks. Something to bear in mind if I ever have to do this again, but
> not that useful in the current situation I think.
>
> poc
> _______________________________________________
> users mailing list -- [hidden email]
> To unsubscribe send an email to [hidden email]
> 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@...
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM

Samuel Sieb
In reply to this post by Patrick O'Callaghan-2
On 12/2/19 9:59 AM, Patrick O'Callaghan wrote:
> On Mon, 2019-12-02 at 11:19 -0600, Roger Heflin wrote:
>>
>> 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.
>
> Very scary. This is exactly why I don't want to use LVM. I don't
> understand it.

The big problem here is that you cloned the drive and then had both
copies available to the system.  You're already in a very dangerous
situation.  I would suggest booting a live image and clean the
partitions with that.  If that's still a problem, then first unplug the
original drives and then use the live boot to erase the new ones.
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM (SOLVED - kind of)

Patrick O'Callaghan-2
In reply to this post by Roger Heflin-3
On Mon, 2019-12-02 at 12:44 -0600, Roger Heflin wrote:
> it might be if you use dd to clear only the duplicate pv/lvm partition
> header and then start with the pvcreate/vgextend/pvmove/vgreduce
> steps.

I crossed my fingers and tried it, and it worked. Rather than removing
LVM I've decided to just live with it. The alternative is a system
reinstall.

Thanks for your help.

poc
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM (SOLVED - kind of)

Roberto Ragusa
On 12/3/19 12:58 PM, Patrick O'Callaghan wrote:
> On Mon, 2019-12-02 at 12:44 -0600, Roger Heflin wrote:
>> it might be if you use dd to clear only the duplicate pv/lvm partition
>> header and then start with the pvcreate/vgextend/pvmove/vgreduce
>> steps.
>
> I crossed my fingers and tried it, and it worked. Rather than removing
> LVM I've decided to just live with it. The alternative is a system
> reinstall.

You were in the lucky position of having LVM, which makes this kind of
"move to new disk" operations trivial. Doing a disk clone was
exactly the wrong way to do it, you've inadvertently turned LVM against
yourself.

Regards.

--
    Roberto Ragusa    mail at robertoragusa.it
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...
Reply | Threaded
Open this post in threaded view
|

Re: Removing LVM (SOLVED - kind of)

Patrick O'Callaghan-2
On Wed, 2019-12-04 at 17:15 +0100, Roberto Ragusa wrote:

> On 12/3/19 12:58 PM, Patrick O'Callaghan wrote:
> > On Mon, 2019-12-02 at 12:44 -0600, Roger Heflin wrote:
> > > it might be if you use dd to clear only the duplicate pv/lvm partition
> > > header and then start with the pvcreate/vgextend/pvmove/vgreduce
> > > steps.
> >
> > I crossed my fingers and tried it, and it worked. Rather than removing
> > LVM I've decided to just live with it. The alternative is a system
> > reinstall.
>
> You were in the lucky position of having LVM, which makes this kind of
> "move to new disk" operations trivial. Doing a disk clone was
> exactly the wrong way to do it, you've inadvertently turned LVM against
> yourself.

Well I know that now. Had I not had LVM it would have been (for me) a
lot simpler. I do understand the benefits LVM brings, especially to
servers with stringent uptime requirements, but for a single-user
desktop it's less clear and does require a good deal more knowledge.

Still, live and learn.

poc
_______________________________________________
users mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
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@...