New installation with LVM didn't work, trying to recover data

Hi everyone; stopping here for some help:
So this is what happened:
I recently got a System76 Meerkat with a 500G HD and obviously PopOs; I had a 1T HD so I included it in the PC and was dualbooting PopOs ans AL, after some time I got fed up with PopOs, it was just a waste of space and a very problematic OS,(could never make RStudio work) so I decided to blow PopOs and just stay with awesome AL.
Here I got greedy and wanted to do a LVM with both HDs and have a 70G “/” and a 1.3T “/home”. Don’t ask me why, but I didn’t do a backup of my AL home data and did the new installation trying with the LVM utility from the installer.
So the installation went fine (kind-of), I have a full working AL install but; the 1.3T LV didn’t mount as home, the hole OS is under the 70G that where supposed to be just /, I have the 1.3T LV but I’m unable to access it, mount it, read it, etc.
My best guess is the data is still there cause I didn’t format it as it was already ext4.
I would like to undo the LV and be able to recover the information of that drive, and just keep stuff as it was on different HDs
Here are some outputs of the lvm and fdisk:
Hope someone can help.



1 Like

Was this all done through the installer?
Did you specify mounting the LVM map as /home during install?
Did you specify to not format the device as a new filesystem and keep the existing?

I’m sorry but I’m not sure if your data can be recovered if it was formatted, have you tried mounting the /home map to see what’s on it?

Also post the output of lsblk -fa

2 Likes

Yes, it was all done through the installer.
Yes, I specified LVM as /home, I have no idea why that did not happen.
Yes, I specified NOT to format the partition selected as part of the “bighome” LVM.
This is lsblk -fa:

When I try to mount “bighome” this is what I get:


So I haven’t been able to mount it anywhere.
ThanX 4 the help

Naming?
You mean like the home folders?
Before I installed I changed the name of my home (cowboycamilo) to cowboycamiloOld… so to not mess it up.
Is that what you are referring ti?

hummm ok.
Well I just created a the folder bighome/home under /mnt, to try and mount there…
But I’ve tried other mount folders without success.

ok, used lvscan to know the lvm name and/or device and it says its /dev/bighome/home and it give the correct size “1.22T”

[root@archlabs home]# lvscan
  ACTIVE            '/dev/bighome/home' [1.22 TiB] inherit

But when I try to mount, in this case another place /mnt/home
I get the save error:

[root@archlabs home]# mount /dev/bighome/home /mnt/home
mount: /mnt/home: wrong fs type, bad option, bad superblock on /dev/mapper/bighome-home, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

:sob:

I think when mounting lvm partitions you need to do it through lvm tools and not like a standard mount. Give me one minute and I should have some step for you to follow.

@altman you’re confusing partition names for the mount location, lvm is a bit more complex. I’ll get it figured out so please try to keep the thread clean.

2 Likes

Ok, makes sense. Cleaned it.

1 Like

this is the output of lvdisplay

[root@archlabs home]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/bighome/home
  LV Name                home
  VG Name                bighome
  LV UUID                p7z1Ob-hFTE-pBwC-zz1t-EK0j-Iflb-KleDmS
  LV Write Access        read/write
  LV Creation host, time archlabs, 2022-12-20 03:04:04 -0500
  LV Status              available
  # open                 0
  LV Size                1.22 TiB
  Current LE             321005
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

I’m just reading up on LVM from the arch wiki, it’s been a long time since I’ve worked with it. You can follow along Install Arch Linux on LVM - ArchWiki

modprobe dm_mod
vgscan
vgchange -ay

This should do the setup needed to be able to mount the volume as a normal partition

Now you should be able to do something like

mount /dev/<volume_group>/<logical_volume> /<mountpoint>

which I think in your case is

mount /dev/bighome/home /mnt

Now like @altman mentioned and I kinda shrugged off you have your LV named “home” which I would assume doesn’t cause conflicts but I’m not 100% and the wiki does use better labeling so you know it’s a logical volume like

mount /dev/VolGroup00/lvolhome /home

So try the above bit and see if you can now mount it, post any output that looks like it might be helpful.

1 Like

Ok, so i did:

[root@archlabs home]# modprobe dm_mod

[root@archlabs home]# vgscan
  Found volume group "bighome" using metadata type lvm2

[root@archlabs home]# vgchange -ay
  1 logical volume(s) in volume group "bighome" now active

[root@archlabs home]# mount /dev/bighome/home /mnt/bighome/
mount: /mnt/bighome: wrong fs type, bad option, bad superblock on /dev/mapper/bighome-home, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

I tried mounting on /mnt/bighome cause I have other folders there to mount external HD so not to cause conflict.
**I get same error:

mount: /mnt/bighome: wrong fs type, bad option, bad superblock on /dev/mapper/bighome-home, missing codepage or helper program, or other error.

:sob:

Hmm, it looks like maybe it never was formatted.

Can I see the output of

lvdisplay
lsblk -fa

sure:

[root@archlabs bighome]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/bighome/home
  LV Name                home
  VG Name                bighome
  LV UUID                p7z1Ob-hFTE-pBwC-zz1t-EK0j-Iflb-KleDmS
  LV Write Access        read/write
  LV Creation host, time archlabs, 2022-12-20 03:04:04 -0500
  LV Status              available
  # open                 0
  LV Size                1.22 TiB
  Current LE             321005
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

and

[root@archlabs bighome]# lsblk -fa
NAME             FSTYPE      FSVER    LABEL    UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
sda
├─sda1
├─sda5           LVM2_member LVM2 001          guVGQ2-e0U3-M4rp-s7Rd-w78N-Tj9Q-Drq8Eo
│ └─bighome-home
└─sda6           ext4        1.0               bd759fb9-c4c9-4457-ba72-87ec1cd4f2bb
nvme0n1
├─nvme0n1p1      vfat        FAT32             C05B-7A6D                               392.6M    21% /boot
├─nvme0n1p2
├─nvme0n1p3      ext4        1.0               b278b90f-2134-4856-aa01-8fec8250a19b       42G    33% /
└─nvme0n1p4      LVM2_member LVM2 001          Lc4Ow8-Vhp3-gEIc-NOeu-KSSd-T6uW-YzCCwn

Very strange, I just want to see what (if any filesystem is on the volume), this might do it

file -s /dev/bighome/home
[root@archlabs bighome]# file -s /dev/bighome/home
/dev/bighome/home: symbolic link to ../dm-0

???

Oh my bad, you’ll need to use the -L flag to follow the link

file -s -L /dev/bighome/home
[root@archlabs bighome]# file -s -L /dev/bighome/home
/dev/bighome/home: data

Ok so it’s not actually formatted as anything.

I’m really not sure if you can just revert the volume right now and get back the old data you lost or is that important to you? We can also just go ahead with a format to ext4 or whatever and try to get it mounting properly.

Well there is some DATA that I would really like to recover… :sob:
But If I format to ext4 wouldn’t that just eliminate all data (and the possibility of recovery)??
Both HD where ext4 in the beginning

Is there a way to make it ext4 without “formating” (I guess this is a dumb question…)