linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Identifying Unused VG
@ 2020-10-15 10:02 Annamalai Gurusami
  2020-10-16 14:52 ` John Stoffel
  0 siblings, 1 reply; 6+ messages in thread
From: Annamalai Gurusami @ 2020-10-15 10:02 UTC (permalink / raw)
  To: linux-lvm

Hi All,

I am new user of LVM.  At home, in a desktop machine, I installed Ubuntu
20.04 LTS and while doing so I opted for LVM.  This desktop computer has
2 hard disks.  I want to remove 1 hard disk and use it for another
computer.  But I need to remove the hard disk without loss of data.  The
problem now is that there are two VG listed, while I think it should be
only one.  How to identify the unwanted VG? Maybe this is because of
multiple attempts at installation.  Any help on this is much
appreciated.

Here are some of the output of the commands in that desktop:

root@desktop02:~# lsblk --scsi
NAME HCTL       TYPE VENDOR   MODEL                 REV TRAN
sda  2:0:0:0    disk ATA      ST2000DM005-2CW102   0001 sata
sdb  8:0:0:0    disk ATA      WDC_WD20EZAZ-00GGJB0 0A80 sata
root@desktop02:~# vgs
  VG       #PV #LV #SN Attr   VSize  VFree
  vgubuntu   1   2   0 wz--n- <1.82t    0 
  vgubuntu   1   2   0 wz--n- <1.82t    0 
root@desktop02:~# pvs
  PV         VG       Fmt  Attr PSize  PFree
  /dev/sda2  vgubuntu lvm2 a--  <1.82t    0 
  /dev/sdb5  vgubuntu lvm2 a--  <1.82t    0 
root@desktop02:~# lvs
  LV     VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root   vgubuntu -wi-ao----  <1.82t                                                    
  root   vgubuntu -wi-------  <1.82t                                                    
  swap_1 vgubuntu -wi-ao---- 976.00m                                                    
  swap_1 vgubuntu -wi------- 976.00m                                                    
root@desktop02:~# lsblk
NAME                MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0                 7:0    0    55M  1 loop /snap/core18/1880
loop1                 7:1    0   251M  1 loop /snap/gimp/292
loop2                 7:2    0 161.4M  1 loop /snap/gnome-3-28-1804/128
loop3                 7:3    0   251M  1 loop /snap/gimp/297
loop4                 7:4    0 162.9M  1 loop /snap/gnome-3-28-1804/145
loop5                 7:5    0  55.3M  1 loop /snap/core18/1885
loop6                 7:6    0 255.6M  1 loop /snap/gnome-3-34-1804/36
loop7                 7:7    0 217.9M  1 loop /snap/gnome-3-34-1804/60
loop8                 7:8    0  62.1M  1 loop /snap/gtk-common-themes/1506
loop9                 7:9    0 138.4M  1 loop /snap/inkscape/7947
loop10                7:10   0 260.7M  1 loop /snap/kde-frameworks-5-core18/32
loop11                7:11   0  43.2M  1 loop /snap/snap-store/415
loop12                7:12   0  50.7M  1 loop /snap/snap-store/481
loop13                7:13   0  30.3M  1 loop /snap/snapd/9279
loop14                7:14   0    31M  1 loop /snap/snapd/9607
loop15                7:15   0 217.5M  1 loop /snap/supertux/229
loop16                7:16   0 290.4M  1 loop /snap/vlc/1700
sda                   8:0    0   1.8T  0 disk 
����sda1                8:1    0   512M  0 part 
����sda2                8:2    0   1.8T  0 part 
sdb                   8:16   0   1.8T  0 disk 
����sdb1                8:17   0   512M  0 part /boot/efi
����sdb2                8:18   0     1K  0 part 
����sdb5                8:21   0   1.8T  0 part 
  ����vgubuntu-root   253:0    0   1.8T  0 lvm  /
  ����vgubuntu-swap_1 253:1    0   976M  0 lvm  [SWAP]
root@desktop02:~# 

Since both the VG is named as "vgubuntu", I am wondering how to identify
the unused or unwanted VG.  And I need to identify which hard disk (sda
or sdb) I can remove.  And what I need to do before unplugging it.

I would appreciate if you people can point me in the right
direction. Thank you.

Rgds,
anna

-- 
mysql> help year data type;
Name: 'YEAR DATA TYPE'
Description:
YEAR[(4)]

A year in 4-digit format. MySQL displays YEAR values in YYYY format,
but permits assignment of values to YEAR columns using either strings
or numbers. Values display as 1901 to 2155, or 0000.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Identifying Unused VG
  2020-10-15 10:02 [linux-lvm] Identifying Unused VG Annamalai Gurusami
@ 2020-10-16 14:52 ` John Stoffel
  2020-10-19  4:17   ` Annamalai Gurusami
  2020-11-03  8:49   ` Annamalai Gurusami
  0 siblings, 2 replies; 6+ messages in thread
From: John Stoffel @ 2020-10-16 14:52 UTC (permalink / raw)
  To: LVM general discussion and development

>>>>> "Annamalai" == Annamalai Gurusami <annamalai.gurusami@oracle.com> writes:

Annamalai> I am new user of LVM.  At home, in a desktop machine, I
Annamalai> installed Ubuntu 20.04 LTS and while doing so I opted for
Annamalai> LVM.  This desktop computer has 2 hard disks.  I want to
Annamalai> remove 1 hard disk and use it for another computer.  But I
Annamalai> need to remove the hard disk without loss of data.  The
Annamalai> problem now is that there are two VG listed, while I think
Annamalai> it should be only one.  How to identify the unwanted VG?
Annamalai> Maybe this is because of multiple attempts at installation.
Annamalai> Any help on this is much appreciated.

Ugh!  How did you do this?  Did you clone one disk on top of another?

Can you boot off a liveCD and do the same command again please?   Also
please run the 'blkid' command show that output as well.  And show the
output of 'cat /proc/partitions' and /proc/mdstat as well.  Are you
running RAID on this system?  Or did you try to do that?  
 
Annamalai> Here are some of the output of the commands in that desktop:

Looking at your 'lsblk' output, I suspect you can remove drive sda,
the Seagate.  So I'd probably try to shutdown cleanly, then remove
that drive and boot up again.  


Annamalai> root@desktop02:~# lsblk --scsi
Annamalai> NAME HCTL       TYPE VENDOR   MODEL                 REV TRAN
Annamalai> sda  2:0:0:0    disk ATA      ST2000DM005-2CW102   0001 sata
Annamalai> sdb  8:0:0:0    disk ATA      WDC_WD20EZAZ-00GGJB0 0A80 sata
Annamalai> root@desktop02:~# vgs
Annamalai>   VG       #PV #LV #SN Attr   VSize  VFree
Annamalai>   vgubuntu   1   2   0 wz--n- <1.82t    0 
Annamalai>   vgubuntu   1   2   0 wz--n- <1.82t    0 
Annamalai> root@desktop02:~# pvs
Annamalai>   PV         VG       Fmt  Attr PSize  PFree
Annamalai>   /dev/sda2  vgubuntu lvm2 a--  <1.82t    0 
Annamalai>   /dev/sdb5  vgubuntu lvm2 a--  <1.82t    0 
Annamalai> root@desktop02:~# lvs
Annamalai>   LV     VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
Annamalai>   root   vgubuntu -wi-ao----  <1.82t                                                    
Annamalai>   root   vgubuntu -wi-------  <1.82t                                                    
Annamalai>   swap_1 vgubuntu -wi-ao---- 976.00m                                                    
Annamalai>   swap_1 vgubuntu -wi------- 976.00m                                                    
Annamalai> root@desktop02:~# lsblk
Annamalai> NAME                MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
Annamalai> loop0                 7:0    0    55M  1 loop /snap/core18/1880
Annamalai> loop1                 7:1    0   251M  1 loop /snap/gimp/292
Annamalai> loop2                 7:2    0 161.4M  1 loop /snap/gnome-3-28-1804/128
Annamalai> loop3                 7:3    0   251M  1 loop /snap/gimp/297
Annamalai> loop4                 7:4    0 162.9M  1 loop /snap/gnome-3-28-1804/145
Annamalai> loop5                 7:5    0  55.3M  1 loop /snap/core18/1885
Annamalai> loop6                 7:6    0 255.6M  1 loop /snap/gnome-3-34-1804/36
Annamalai> loop7                 7:7    0 217.9M  1 loop /snap/gnome-3-34-1804/60
Annamalai> loop8                 7:8    0  62.1M  1 loop /snap/gtk-common-themes/1506
Annamalai> loop9                 7:9    0 138.4M  1 loop /snap/inkscape/7947
Annamalai> loop10                7:10   0 260.7M  1 loop /snap/kde-frameworks-5-core18/32
Annamalai> loop11                7:11   0  43.2M  1 loop /snap/snap-store/415
Annamalai> loop12                7:12   0  50.7M  1 loop /snap/snap-store/481
Annamalai> loop13                7:13   0  30.3M  1 loop /snap/snapd/9279
Annamalai> loop14                7:14   0    31M  1 loop /snap/snapd/9607
Annamalai> loop15                7:15   0 217.5M  1 loop /snap/supertux/229
Annamalai> loop16                7:16   0 290.4M  1 loop /snap/vlc/1700
Annamalai> sda                   8:0    0   1.8T  0 disk 
Annamalai> ├─sda1                8:1    0   512M  0 part 
Annamalai> └─sda2                8:2    0   1.8T  0 part 
Annamalai> sdb                   8:16   0   1.8T  0 disk 
Annamalai> ├─sdb1                8:17   0   512M  0 part /boot/efi
Annamalai> ├─sdb2                8:18   0     1K  0 part 
Annamalai> └─sdb5                8:21   0   1.8T  0 part 
Annamalai>   ├─vgubuntu-root   253:0    0   1.8T  0 lvm  /
Annamalai>   └─vgubuntu-swap_1 253:1    0   976M  0 lvm  [SWAP]
Annamalai> root@desktop02:~# 

Annamalai> Since both the VG is named as "vgubuntu", I am wondering how to identify
Annamalai> the unused or unwanted VG.  And I need to identify which hard disk (sda
Annamalai> or sdb) I can remove.  And what I need to do before unplugging it.

Annamalai> I would appreciate if you people can point me in the right
Annamalai> direction. Thank you.

Annamalai> Rgds,
Annamalai> anna

Annamalai> -- 
mysql> help year data type;
Annamalai> Name: 'YEAR DATA TYPE'
Annamalai> Description:
Annamalai> YEAR[(4)]

Annamalai> A year in 4-digit format. MySQL displays YEAR values in YYYY format,
Annamalai> but permits assignment of values to YEAR columns using either strings
Annamalai> or numbers. Values display as 1901 to 2155, or 0000.



Annamalai> _______________________________________________
Annamalai> linux-lvm mailing list
Annamalai> linux-lvm@redhat.com
Annamalai> https://www.redhat.com/mailman/listinfo/linux-lvm
Annamalai> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Identifying Unused VG
  2020-10-16 14:52 ` John Stoffel
@ 2020-10-19  4:17   ` Annamalai Gurusami
  2020-10-19 19:53     ` John Stoffel
  2020-11-03  8:49   ` Annamalai Gurusami
  1 sibling, 1 reply; 6+ messages in thread
From: Annamalai Gurusami @ 2020-10-19  4:17 UTC (permalink / raw)
  To: John Stoffel; +Cc: LVM general discussion and development

"John Stoffel" <john@stoffel.org> writes:

>>>>>> "Annamalai" == Annamalai Gurusami <annamalai.gurusami@oracle.com> writes:
>
> Annamalai> I am new user of LVM.  At home, in a desktop machine, I
> Annamalai> installed Ubuntu 20.04 LTS and while doing so I opted for
> Annamalai> LVM.  This desktop computer has 2 hard disks.  I want to
> Annamalai> remove 1 hard disk and use it for another computer.  But I
> Annamalai> need to remove the hard disk without loss of data.  The
> Annamalai> problem now is that there are two VG listed, while I think
> Annamalai> it should be only one.  How to identify the unwanted VG?
> Annamalai> Maybe this is because of multiple attempts at installation.
> Annamalai> Any help on this is much appreciated.
>
> Ugh!  How did you do this?  Did you clone one disk on top of another?

I did installation two times.  My first installation attempt failed and
I repeated the process.  I don't remember what exactly failed in the
first attempt. In the two attempts, I guess I might have given different
hard disk for the root file system.  In each attempt, I told Ubuntu to
use both the hard disks with LVM.

Suppose Ubuntu is installed on both the hard disks, then I should be
able to boot Ubuntu from either of them.  But currently I can boot from
only one of them.

> Can you boot off a liveCD and do the same command again please?   Also
> please run the 'blkid' command show that output as well.  And show the
> output of 'cat /proc/partitions' and /proc/mdstat as well.  Are you
> running RAID on this system?  Or did you try to do that?

I don't have a live CD ready with me.  I'll try the other simpler option
(below) first and will come back to this if that didn't work.

> Annamalai> Here are some of the output of the commands in that desktop:
>
> Looking at your 'lsblk' output, I suspect you can remove drive sda,
> the Seagate.  So I'd probably try to shutdown cleanly, then remove
> that drive and boot up again.

I'll try this first and let you know how it goes.

Thanks.

Rgds,
anna

-- 
mysql> help year data type;
Name: 'YEAR DATA TYPE'
Description:
YEAR[(4)]

A year in 4-digit format. MySQL displays YEAR values in YYYY format,
but permits assignment of values to YEAR columns using either strings
or numbers. Values display as 1901 to 2155, or 0000.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Identifying Unused VG
  2020-10-19  4:17   ` Annamalai Gurusami
@ 2020-10-19 19:53     ` John Stoffel
  0 siblings, 0 replies; 6+ messages in thread
From: John Stoffel @ 2020-10-19 19:53 UTC (permalink / raw)
  To: Annamalai Gurusami; +Cc: LVM general discussion and development

>>>>> "Annamalai" == Annamalai Gurusami <annamalai.gurusami@oracle.com> writes:

Annamalai> "John Stoffel" <john@stoffel.org> writes:
>>>>>>> "Annamalai" == Annamalai Gurusami <annamalai.gurusami@oracle.com> writes:
>> 
Annamalai> I am new user of LVM.  At home, in a desktop machine, I
Annamalai> installed Ubuntu 20.04 LTS and while doing so I opted for
Annamalai> LVM.  This desktop computer has 2 hard disks.  I want to
Annamalai> remove 1 hard disk and use it for another computer.  But I
Annamalai> need to remove the hard disk without loss of data.  The
Annamalai> problem now is that there are two VG listed, while I think
Annamalai> it should be only one.  How to identify the unwanted VG?
Annamalai> Maybe this is because of multiple attempts at installation.
Annamalai> Any help on this is much appreciated.
>> 
>> Ugh!  How did you do this?  Did you clone one disk on top of another?

Annamalai> I did installation two times.  My first installation
Annamalai> attempt failed and I repeated the process.  I don't
Annamalai> remember what exactly failed in the first attempt. In the
Annamalai> two attempts, I guess I might have given different hard
Annamalai> disk for the root file system.  In each attempt, I told
Annamalai> Ubuntu to use both the hard disks with LVM.

So once you find out which disk boots Linux ok, note down the
partition layout.  Then reboot with the second disk attached and make
sure you do something like:

  dd if=/dev/zero bs=64k count=512 /dev/sd<second disk>

which will be either sda or sdb.  This 'dd' command will wipe the
partition table and all the LVM data as well, so you can install
windows on it.

Good luck.


Annamalai> Suppose Ubuntu is installed on both the hard disks, then I should be
Annamalai> able to boot Ubuntu from either of them.  But currently I can boot from
Annamalai> only one of them.

>> Can you boot off a liveCD and do the same command again please?   Also
>> please run the 'blkid' command show that output as well.  And show the
>> output of 'cat /proc/partitions' and /proc/mdstat as well.  Are you
>> running RAID on this system?  Or did you try to do that?

Annamalai> I don't have a live CD ready with me.  I'll try the other simpler option
Annamalai> (below) first and will come back to this if that didn't work.

Annamalai> Here are some of the output of the commands in that desktop:
>> 
>> Looking at your 'lsblk' output, I suspect you can remove drive sda,
>> the Seagate.  So I'd probably try to shutdown cleanly, then remove
>> that drive and boot up again.

Annamalai> I'll try this first and let you know how it goes.

Annamalai> Thanks.

Annamalai> Rgds,
Annamalai> anna

Annamalai> -- 
mysql> help year data type;
Annamalai> Name: 'YEAR DATA TYPE'
Annamalai> Description:
Annamalai> YEAR[(4)]

Annamalai> A year in 4-digit format. MySQL displays YEAR values in YYYY format,
Annamalai> but permits assignment of values to YEAR columns using either strings
Annamalai> or numbers. Values display as 1901 to 2155, or 0000.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Identifying Unused VG
  2020-10-16 14:52 ` John Stoffel
  2020-10-19  4:17   ` Annamalai Gurusami
@ 2020-11-03  8:49   ` Annamalai Gurusami
  2020-11-03 14:40     ` John Stoffel
  1 sibling, 1 reply; 6+ messages in thread
From: Annamalai Gurusami @ 2020-11-03  8:49 UTC (permalink / raw)
  To: John Stoffel; +Cc: LVM general discussion and development

"John Stoffel" <john@stoffel.org> writes:

> Looking at your 'lsblk' output, I suspect you can remove drive sda,
> the Seagate.  So I'd probably try to shutdown cleanly, then remove
> that drive and boot up again.

Finally I was able to spend sometime doing this.  And you are correct.
I shutdown the computer and removed the Seagate HDD and started the
computer.  Everything went smooth.

Thanks for helping me.

Rgds,
anna

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [linux-lvm] Identifying Unused VG
  2020-11-03  8:49   ` Annamalai Gurusami
@ 2020-11-03 14:40     ` John Stoffel
  0 siblings, 0 replies; 6+ messages in thread
From: John Stoffel @ 2020-11-03 14:40 UTC (permalink / raw)
  To: Annamalai Gurusami; +Cc: LVM general discussion and development

>>>>> "Annamalai" == Annamalai Gurusami <annamalai.gurusami@oracle.com> writes:

Annamalai> "John Stoffel" <john@stoffel.org> writes:
>> Looking at your 'lsblk' output, I suspect you can remove drive sda,
>> the Seagate.  So I'd probably try to shutdown cleanly, then remove
>> that drive and boot up again.

Annamalai> Finally I was able to spend sometime doing this.  And you are correct.
Annamalai> I shutdown the computer and removed the Seagate HDD and started the
Annamalai> computer.  Everything went smooth.

Annamalai> Thanks for helping me.

Great!  Gald to help.  Now what I would do is re-install the Seagte
drive, boot up and then once you've identified it properly, I would
wipe the beginning of the disk with:

  dd if=/dev/zero of=/dev/sd<letter> count=10000

where <letter> would *probably* be 'b' without quotes.  But confirm!

Then just reboot the system and you should see only the boot disk,
along with a new blank disk.  Then you can do what you want with it.

John

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-03 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15 10:02 [linux-lvm] Identifying Unused VG Annamalai Gurusami
2020-10-16 14:52 ` John Stoffel
2020-10-19  4:17   ` Annamalai Gurusami
2020-10-19 19:53     ` John Stoffel
2020-11-03  8:49   ` Annamalai Gurusami
2020-11-03 14:40     ` John Stoffel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).