LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 09-17-2016, 03:56 PM   #1
herkalurk
Member
 
Registered: Oct 2012
Location: Portland
Distribution: CentOS 6/7 at home, RHEL5/6/7 at work
Posts: 34

Rep: Reputation: 2
LVM issue with transferred disks


I upgraded my home server from Centos 6 to 7. I actually got a new computer, installed 7 on it and started to move all of the files and services from the old. My final move was to shut off the old server and take the main hard drive pair out with the primary / and /boot file systems. I put one of the hard drives into the new server, formatted the drive with an xfs file system, and put it in /etc/fstab. Just did a LVS and I see that the LVM metadata is saying the VG and LV info is still there(/dev/sdi vg_00).

Code:
[root@mythtv ~]# lvs -a -o +devices
  WARNING: Device for PV EAfO0e-33M9-7shI-FkxF-1y51-ithW-K4dccs not found or rejected by a filter.
  LV                  VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log       Cpy%Sync Convert Devices
  LV_root             centos -wi-ao---- 112.41g                                                           /dev/sda2(0)
  LV_root             centos -wi-ao---- 112.41g                                                           /dev/sda3(0)
  LV_swap             centos -wi-ao----   8.00g                                                           /dev/sda2(16384)
  LV_tmp              centos -wi-ao----   8.00g                                                           /dev/sda2(18432)
  LV_var_log          centos -wi-ao----   8.00g                                                           /dev/sda2(20480)
  LogVol00            vg_00  rwi---r-p- 139.50g                                                           LogVol00_rimage_0(0),LogVol00_rimage_1(0)
  [LogVol00_rimage_0] vg_00  Iwi---r--- 139.50g                                                           /dev/sdi(0)
  [LogVol00_rimage_0] vg_00  Iwi---r--- 139.50g                                                           /dev/sdi(24193)
  [LogVol00_rimage_1] vg_00  Iwi---r-p- 139.50g                                                           unknown device(1)
  [LogVol00_rmeta_0]  vg_00  ewi---r---   4.00m                                                           /dev/sdi(61313)
  [LogVol00_rmeta_1]  vg_00  ewi---r-p-   4.00m                                                           unknown device(0)
  newz                vg_00  rwi---r-p- 100.00g                                                           newz_rimage_0(0),newz_rimage_1(0)
  [newz_rimage_0]     vg_00  Iwi---r--- 100.00g                                                           /dev/sdi(35713)
  [newz_rimage_1]     vg_00  Iwi---r-p- 100.00g                                                           unknown device(35714)
  [newz_rmeta_0]      vg_00  ewi---r---   4.00m                                                           /dev/sdi(24192)
  [newz_rmeta_1]      vg_00  ewi---r-p-   4.00m                                                           unknown device(35713)
  swap                vg_00  mwi---m-p-   6.00g                                swap_mlog                  swap_mimage_0(0),swap_mimage_1(0)
  [swap_mimage_0]     vg_00  Iwi---m---   6.00g                                                           /dev/sdi(61314)
  [swap_mimage_1]     vg_00  Iwi---m-p-   6.00g                                                           unknown device(61314)
  [swap_mlog]         vg_00  lwi---m-p-   4.00m                                                           unknown device(62850)
Just wondering what the best way to get rid of those LVs are. I've already over written the actual data so I don't care about the LV metadata.

Last edited by herkalurk; 09-17-2016 at 04:00 PM.
 
Old 09-17-2016, 07:13 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Write filter rule to ignore /dev/sdi
KISS.
 
Old 09-17-2016, 09:59 PM   #3
herkalurk
Member
 
Registered: Oct 2012
Location: Portland
Distribution: CentOS 6/7 at home, RHEL5/6/7 at work
Posts: 34

Original Poster
Rep: Reputation: 2
Well, that would work for sure, but isn't there a way to remove the data from the drive? I have another drive I haven't mounted yet that also will have the same data since they were paired in LVM.
 
Old 09-17-2016, 10:02 PM   #4
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Just create the filesystem on the drive without partitioning it, e. g. mkfs /dev/sdb.
 
Old 09-17-2016, 10:11 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Or pvremove.
Would probably need to be forced for that drive you are already using - never done it on a live system. But that is why we take backups, isn't it ...
 
Old 09-17-2016, 11:03 PM   #6
herkalurk
Member
 
Registered: Oct 2012
Location: Portland
Distribution: CentOS 6/7 at home, RHEL5/6/7 at work
Posts: 34

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by Emerson View Post
Just create the filesystem on the drive without partitioning it, e. g. mkfs /dev/sdb.
When I made the XFS file system it was on the device /dev/sdi, not a partition. Clearly it didn't remove the metadata.
 
Old 09-18-2016, 12:41 AM   #7
herkalurk
Member
 
Registered: Oct 2012
Location: Portland
Distribution: CentOS 6/7 at home, RHEL5/6/7 at work
Posts: 34

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by syg00 View Post
Or pvremove.
Would probably need to be forced for that drive you are already using - never done it on a live system. But that is why we take backups, isn't it ...
That sort of worked. I was getting errors about it not being able to write any lvm data to the drive (/dev/sdi), but I added in the other drive unmodified, then ran the lvremove commands and because the other drive data was completely intact, it just dropped them. Then I did the VG remove and now it's all gone.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LVM on different disks zkab Linux - Server 6 03-24-2014 07:14 AM
LVM or Bunch of DISKS skc-jju256 Linux - Server 2 09-26-2013 09:41 AM
LVM , RAID and new disks Ammad Linux - General 3 01-10-2009 11:00 AM
LVM and multiple iSCSI disks performance of LVM xxx_anuj_xxx Linux - Server 4 05-01-2008 12:26 PM
Setting up LVM with full disks... s2cuts Linux - Server 2 01-13-2008 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 12:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration