31 May 2013 @ 2:39 PM 

My server is dead now and I have 2 HDD drives with LVM on them. So I’ve decided to add these drives into another server, so I’ll be able to get data.
So what I’m going to do?
1. You need to add your drives into your server, and reboot it (if you have hot-swap HDDs, no reboot is required).

2. Your system should find those HDDs, check yourself:
fdisk -l
There should be few drives to be sure you see your new drives you can compare serials on the HDD side and via:
hdparm -i /dev/sd* or
hdparm -i /dev/hd* or
hdparm -i /dev/your_drive_name (usually its sda hda, anyway correct name you can see in result of fdisk -l)

3. Now you need to check, if your system can see your LVM Volume Groups:
vgscan
vgdisplay

Example of my one:
— Volume group —
VG Name vgdisk4
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 931,51 GB
PE Size 4,00 MB
Total PE 238466
Alloc PE / Size 238080 / 930,00 GB
Free PE / Size 386 / 1,51 GB
VG UUID 1yehuY-dAfQ-Ki2r-reMY-P33U-vlJg-Jyug7u

— Volume group —
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 1,82 TB
PE Size 4,00 MB
Total PE 476931
Alloc PE / Size 476160 / 1,82 TB
Free PE / Size 771 / 3,01 GB
VG UUID lmlalk-2oOz-r75Z-kSs1-7EnV-rSxt-ZkBqMy

— Volume group —
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 698,53 GB
PE Size 32,00 MB
Total PE 22353
Alloc PE / Size 22353 / 698,53 GB
Free PE / Size 0 / 0
VG UUID uPrHjm-rJ6n-g4UD-onIk-Mmxa-0lIM-Bo1Jgd

4. As you see I have 2 similar Volume Groups “VolGroup00”, and I need to rename VG of my new HDD (it is 1,82 TB size):
vgrename lmlalk-2oOz-r75Z-kSs1-7EnV-rSxt-ZkBqMy vgdisk3
as you see I’ve used “VG UUID” identificator, as a result we have:

— Volume group —
VG Name vgdisk4
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 931,51 GB
PE Size 4,00 MB
Total PE 238466
Alloc PE / Size 238080 / 930,00 GB
Free PE / Size 386 / 1,51 GB
VG UUID 1yehuY-dAfQ-Ki2r-reMY-P33U-vlJg-Jyug7u

— Volume group —
VG Name vgdisk3
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 1,82 TB
PE Size 4,00 MB
Total PE 476931
Alloc PE / Size 476160 / 1,82 TB
Free PE / Size 771 / 3,01 GB
VG UUID lmlalk-2oOz-r75Z-kSs1-7EnV-rSxt-ZkBqMy

— Volume group —
VG Name VolGroup00
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 698,53 GB
PE Size 32,00 MB
Total PE 22353
Alloc PE / Size 22353 / 698,53 GB
Free PE / Size 0 / 0
VG UUID uPrHjm-rJ6n-g4UD-onIk-Mmxa-0lIM-Bo1Jgd

5. Now we need to activate these Volume Groups:
vgchange -a y vgdisk3 vgdisk4

6. And mount our drives to some folder:
mkdir /disk3
mkdir /disk4
mount -t ext3 /dev/vgdisk3/lvdisk3 /disk3
mount -t ext3 /dev/vgdisk4/lvdisk4 /disk4

Note: Full path to Logical disk you can find via lvdisplay

7. And the last step, add changes into /etc/fstab:
/dev/vgdisk3/lvdisk3 /disk1 ext3 defaults 1 1
/dev/vgdisk4/lvdisk4 /disk2 ext3 defaults 1 1

/dev/mapper/vgdisk4-lvdisk4 /disk2                       ext3    defaults        1 1
Posted By: lvlind
Last Edit: 06 Oct 2016 @ 03:54 PM

EmailPermalink
Tags
Tags: , ,
Categories: Uncategorized


 

Responses to this post » (None)

 

Sorry, but comments are closed. Check out another post and speak up!

Tags
Comment Meta:
RSS Feed for comments

 Last 50 Posts
Change Theme...
  • Users » 1
  • Posts/Pages » 35
  • Comments » 0
Change Theme...
  • VoidVoid « Default
  • LifeLife
  • EarthEarth
  • WindWind
  • WaterWater
  • FireFire
  • LightLight

About



    No Child Pages.

Need Help?



    No Child Pages.

Check your IP



    No Child Pages.