I'm trying to mount a volume taken from an old EC2 to a new EC2 instance, however, this volume has an "unknown filesystem type of "LVM2_member". I tried all this with the original volume, then I made a volume from the snapshot, thinking it would not be an LVM2_member, but it was identical , but without the nested structure of the volume. I found some instructions here, but apparently that doesn't quite apply to this as it is not being viewed as a group or my syntax is wrong, or something else entirely different. Everything I try from whatever page I find doesn't work for one reason or another. One thing to note, the guy this volume belonged to said he thought this was originally a shared volume with another coworker. That coworker has a similarly named volume that wasn't mounted on his EC2 and he was ignoring it. I don't know how long ago this was supposed to have been the case. This guy's volume that I am trying to mount was successfully mounted and he thinks he was using it.
I'll go through the steps I have tried.
STEP 1: attach volume
STEP 2: lsblk
# will show me the root volume and other volumes I have tried. mine is
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme4n1 259:6 0 100G 0 disk
STEP 3: blkid
# Gets me the UUID of the volume and shows me the TYPE
/dev/nvme4n1: UUID="n91234-wabc-Ua12-kabc-cabc-Gabc-oabc12" TYPE="LVM2_member"
STEP 4: If I try to mount it: mount n91234-wabc-Ua12-kabc-cabc-Gabc-oabc12 /data
mount: special device n91234-wabc-Ua12-kabc-cabc-Gabc-oabc12 does not exist
STEP 5: Looking up that message it indicates that I need to make sure it is in my /etc/fstab file.
vim /etc/fstab
Yes, it is in there, because I put it there, but the type 'LVM2_member' isn't green, as the type is green for the other volumes. Thus unknown type error probably as the type isn't being recognized.
UUID=n91234-wabc-Ua12-kabc-cabc-Gabc-oabc12 /home/ec2-user/data LVM2_member defaults,nofail 0 2
STEP 6: pvs
# shows me the physical volumes on my device
PV VG Fmt Attr PSize PFree
/dev/dsa12 VolGroup00 lvm2 a-- 99.53g 19.00g
/dev/sdi VolGroup00 lvm2 a-- <100.0g <27.00g
[unknown] VolGroup00 lvm2 a-m 19.53g 0
I know the /dev/sdi is the volume I am trying to attach. So we see there is a duplicate Volume Group name, and I already know they have different UUIDs.
STEP 7: lvs VolGroup00 --config 'devices { filter=["a|/dev/sdi|", "r|.*|"]}'
Couldn't find device with uuid c61234-9Mab-P12a-kabc-nab1-Fabc1-t1abcd.
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
auditVol VolGroup00 -wi-----p- 8.53g
dataVol VolGroup00 -wi-a----- 5.00g
homeVol VolGroup00 -wi-----p- 20.00g
logVol VolGroup00 -wi-----p- 4.00g
rootVol VolGroup00 -wi-----p- 40.00g
swapVol VolGroup00 -wi-----p- 2.00g
tmpVol VolGroup00 -wi------- 4.00g
varVol VolGroup00 -wi-----p- 9.00g
The /dev/sda12 shows similar info but without the "couldn't find xxx".
STEP 8: vgs -o +vg_uuid --config 'devices {filter = ["a|/dev/sdi|", "r|.*|" ]}'
# to get the volume ID
VG #PV #LV #SN Attr VSize VFree VG UUID
VolGroup00 2 8 0 wz-pn- <119.53g <27.00g jmt123-iabc-babc-Uabc-rabc-habc-gabcdef.
STEP 9: vgrename jmt123-iabc-babc-Uabc-rabc-habc-gabcdef volnew
# rename volume using uuid
Couldn't find device with uuid c61234-9Mab-P12a-kabc-nab1-Fabc1-t1abcd.
Cannot change VG VolGroup00 while PVs are missing.
Consider vgreduce --removemissing.
Cannot process volume group VolGroup00
STEP 10: vgreduce --removemissing jmt123-iabc-babc-Uabc-rabc-habc-gabcdef
# Remove missing PVs
Cannot process volume group jmt123-iabc-babc-Uabc-rabc-habc-gabcdef
STEP 11: vgreduce jmt123-iabc-babc-Uabc-rabc-habc-gabcdef c61234-9Mab-P12a-kabc-nab1-Fabc1-t1abcd
# I even tried that command using the id of the missing PV.
Volume group "jmt123-iabc-babc-Uabc-rabc-habc-gabcdef" not found
Cannot process volume group jmt123-iabc-babc-Uabc-rabc-habc-gabcdef
STEP 12: I found this link that talks about recovering LVM metadata Linux. cat /etc/lvm/archive/* | grep -i “jmt123-iabc-babc-Uabc-rabc-habc-gabcdef”
# it shows what looks like history of the volume group before certain executions like vgchange
and vgimport
and reference to the volume id, n91234-wabc-Ua12-kabc-cabc-Gabc-oabc12.
STEP 13: pvcreate --uuid "n91234-wabc-Ua12-kabc-cabc-Gabc-oabc12" --restorefile /etc/lvm/backup/VolGroup00 /dev/sdi
Couldn't find device with uuid n91234-wabc-Ua12-kabc-cabc-Gabc-oabc12.
Can't find uuid in backup file /etc/lvm/backup/VolGroup00
There is nothing in that file, I think. I can't actually cd to the backup folder, but if I ls /etc/lvm/backup
it shows VolGroup00
. So vim to the file name VolGroup00 shows it is empty.
And now I am out of ideas and can't find any other pages/threads to give me further ideas to progress with the mounting of this volume on his EC2 instance.
My ultimate goal is to create a tar file of the data and upload it to an S3 bucket and then terminate the volume.