2

I've come across an old hard disk (+15 years) that contains an image of another disk I created using dd.

By using losetup, I can attach it to a loop device.

# lsblk -f /dev/loop0
NAME  FSTYPE      FSVER LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
loop0 LVM1_member             qvBl4K-3QK0-wYyg-la09-LGdg-tjCj-Vz5EIu

But I cannot mount it

# mount /dev/loop0 /mnt
mount: /home/void/mnt: unknown filesystem type 'LVM1_member'.
       dmesg(1) may have more information after failed mount system call.

So, how should I mount an LVM 1 volume on modern distro?

3
  • 1
    LVM1 support was removed in 2018 and buggy before that (lvmetad broke it). Try with LVM 2.02.85 or earlier? Ubuntu 12.04 ISO might work, but it doesn't have LVM2 by default, so you'd also have to edit /etc/apt/sources.list to old-releases.ubuntu.com and install it (or find another ISO that included lvm directly). Spin it up in a VM, see if it works... Commented Nov 26, 2023 at 21:37
  • @frostschutz Do you mean that this FAQ is obsolete and that LVM2 is no longer backward compatible with LVM1? Commented Nov 27, 2023 at 12:59
  • 1
    @xhienne the FAQ is from like 2004, so yes, it's ancient and obsolete Commented Nov 27, 2023 at 13:14

1 Answer 1

0

An LVM volume like you see is not directly mountable. It is a physical LVM volume (PV) that is attached to an LVM volume group (VG) which itself contains zero, one or many LVM logical volumes (LVs). What you can actually mount is those LVs.

The first step is to make your system see your loop file as a PV with pvscan.

If pvscan is sucessful, then:

  • pvs will show your PV and its associated VG
  • lvs name_of_vg will show the LVs contained in that VG

Usually, for each LV, you will find a corresponding device in /dev/name_of_vg (they may have another name/location in /dev, though; anyway, since they are managed by device-mapper, they should appear in dmsetup -ls which will give you their major/minor device numbers)

5
  • pvscan return "No matching physical volume found" Commented Nov 26, 2023 at 21:30
  • @GeorgeLivanoss I assume you still have your /dev/loop0 device. Then your question boils down to « pvscan doesn't see my LVM1 volume » (you can Google that). You can check that your lvm.conf is not filtering out loop devices. Commented Nov 27, 2023 at 0:47
  • Maybe you could restart from the beginning: losetup -d /dev/loop0 then kpartx -a /your/dd_file, then verify that loop devices have been created accordingly, then pvscan. Commented Nov 27, 2023 at 0:58
  • 2
    I think the answer is in the first comment to my question, this is a LVM1 vg, while current distro uses LVM2. I'm gonna try in a vm with an old linux Commented Nov 27, 2023 at 7:56
  • @GeorgeLivanoss You are right. Your VM will allow you to do an LVM1->LVM2 conversion, then my answer will still apply. Commented Nov 27, 2023 at 14:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.