Re: [Libguestfs] guestfish emergency extension
On Tue, May 18, 2021 at 09:36:12AM +0200, Gottschalk wrote:
Hello Mr. Jones,
we use guestfish 1.4
This version was released 11 years ago??
we have an emergency of Data Recovery. We restored a ESXi 6.7 VMware-Image and wanted to read the data inside with guestfish.
The structure of the vm is based on LVM.
The first disk with the os inside a LV can be mounted correctly.
Two disks a 400GB are covered in a Volumegroup. There is one logical Volume with 800GB in this VG.
Guestfish does not read the filesystem in this LV.
I tried
<fs>add disk1.vmdk
<fs>add disk2.vmdk
<fs>add disk3.vmdk
<fs>run
<fs>list-devices /dev/sda /dev/sdb /dev/sdc
<fs>list-partitions /dev/sda1 On sdb and sdc there are no partitions. The LV resides directly on these disks. I simulated this with partitioned disks and identically result.
behavior without partitions on sdb and sdc
<fs> list-filesystems /dev/mailxxx-vg/root: ext4 /dev/mailxxx-vg/swap_1: swap /dev/vmail-vg/vmail-lv: unknown
<fs> list-filesystems
behavior with partitions on sdb and sdc libguestfs: error: list_filesystems: parted exited with status 1: Error: Can't have a partition outside the disk!
<fs>
<fs>mount /dev/mailxxx-vg/root / works fine <fs>mount/dev/vmail-vg/vmail-lv / libguestfs: error: mount: mount_stub: /dev/vmail-vg/vmail-lv: expecting a device name
How can i get access to this LV? Can you help me please? Thank you very much.
I would suggest enabling debugging to start with, which should give you more information about what is actually going on. This section of the FAQ will explain how to do that: https://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Hello Mr. Jones, thank you for the quick response. Mit freundlichen Grüßen ppa. Olaf Gottschalk raw Rechen-Anlage West GmbH Postfach 1120 | 52368 Kreuzau Empfang: +49 2421 9555-0 <tel:+49 2421 9555-0> | raw@raw.de <mailto:raw@raw.de> Sitz der Gesellschaft: Am Burgholz 33-35 | 52372 Kreuzau-Stockheim Hotline: +49 2421 9555-55 <tel:+49 2421 9555-55> | hotline@raw.de <mailto:hotline@raw.de> Geschäftsführer: Dipl.-Ing. Alexander Kutsch Internet: www.raw.de <https://www.raw.de> Handelsregister: Amtsgericht Düren HRB 134 UST- ID: DE 122 278 535 Der Inhalt dieser E-Mail ist ausschließlich für den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung, Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail unzulässig sind. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen. Aussagen gegenüber dem Adressaten unterliegen den Regelungen des zugrundeliegenden Angebotes bzw. Auftrages, insbesondere den allgemeinen Auftragsbedingungen und der individuellen Haftungsvereinbarung. Der Inhalt dieser E-Mail ist nur rechtsverbindlich, wenn er unsererseits durch einen Brief entsprechend bestätigt wird. Die Versendung von E-Mails an uns hat keine fristwahrende Wirkung. Wir möchten Sie außerdem darauf hinweisen, dass die Kommunikation per E-Mail über das Internet unsicher ist, da für unberechtigte Dritte grundsätzlich die Möglichkeit der Kenntnisnahme und Manipulation besteht. Am 18.05.21 um 11:37 schrieb Richard W.M. Jones:
On Tue, May 18, 2021 at 09:36:12AM +0200, Gottschalk wrote:
Hello Mr. Jones,
we use guestfish 1.4 This version was released 11 years ago??
we have an emergency of Data Recovery. We restored a ESXi 6.7 VMware-Image and wanted to read the data inside with guestfish.
The structure of the vm is based on LVM.
The first disk with the os inside a LV can be mounted correctly.
Two disks a 400GB are covered in a Volumegroup. There is one logical Volume with 800GB in this VG.
Guestfish does not read the filesystem in this LV.
I tried
<fs>add disk1.vmdk <fs>add disk2.vmdk <fs>add disk3.vmdk <fs>run <fs>list-devices /dev/sda /dev/sdb /dev/sdc
<fs>list-partitions /dev/sda1 On sdb and sdc there are no partitions. The LV resides directly on these disks. I simulated this with partitioned disks and identically result.
behavior without partitions on sdb and sdc
<fs> list-filesystems /dev/mailxxx-vg/root: ext4 /dev/mailxxx-vg/swap_1: swap /dev/vmail-vg/vmail-lv: unknown
<fs> list-filesystems
behavior with partitions on sdb and sdc libguestfs: error: list_filesystems: parted exited with status 1: Error: Can't have a partition outside the disk!
<fs>
<fs>mount /dev/mailxxx-vg/root / works fine <fs>mount/dev/vmail-vg/vmail-lv / libguestfs: error: mount: mount_stub: /dev/vmail-vg/vmail-lv: expecting a device name
How can i get access to this LV? Can you help me please? Thank you very much. I would suggest enabling debugging to start with, which should give you more information about what is actually going on. This section of the FAQ will explain how to do that:
https://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
Rich.
Hello Rich, thank you for your information. There are 3 Files attached to this E-Mail. 1. Output of libguestfs-test-tool with Result = OK 2. guestfish session with the first Server mail019001. There are problems with vmail-vg and vmail-lv. This Server is actual productive. 3. guestfish session with the second server mail019000-backup. There are problems with mail-vg and mail-lv. This server is newly installed with comparable VGs and LVs except of Partitions on /dev/sdb and /dev/sdc. The Backupserver, where the images were restored from Bareos, is a Ubuntu 20.04 LTS with actual Updates and Upgrades. root@b019001:/restore/mail019001/mail019001-restore-05# cat /etc/issue Ubuntu 20.04.2 LTS \n \l root@b019001:/restore/mail019001/mail019001-restore-05# uname -a Linux b019001 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux root@b019001:/restore/mail019001/mail019001-restore-05# libguestfs was installed with "apt install libguestfs-tools". Mit freundlichen Grüßen ppa. Olaf Gottschalk raw Rechen-Anlage West GmbH Postfach 1120 | 52368 Kreuzau Empfang: +49 2421 9555-0 <tel:+49 2421 9555-0> | raw@raw.de <mailto:raw@raw.de> Sitz der Gesellschaft: Am Burgholz 33-35 | 52372 Kreuzau-Stockheim Hotline: +49 2421 9555-55 <tel:+49 2421 9555-55> | hotline@raw.de <mailto:hotline@raw.de> Geschäftsführer: Dipl.-Ing. Alexander Kutsch Internet: www.raw.de <https://www.raw.de> Handelsregister: Amtsgericht Düren HRB 134 UST- ID: DE 122 278 535 Der Inhalt dieser E-Mail ist ausschließlich für den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung, Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail unzulässig sind. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen. Aussagen gegenüber dem Adressaten unterliegen den Regelungen des zugrundeliegenden Angebotes bzw. Auftrages, insbesondere den allgemeinen Auftragsbedingungen und der individuellen Haftungsvereinbarung. Der Inhalt dieser E-Mail ist nur rechtsverbindlich, wenn er unsererseits durch einen Brief entsprechend bestätigt wird. Die Versendung von E-Mails an uns hat keine fristwahrende Wirkung. Wir möchten Sie außerdem darauf hinweisen, dass die Kommunikation per E-Mail über das Internet unsicher ist, da für unberechtigte Dritte grundsätzlich die Möglichkeit der Kenntnisnahme und Manipulation besteht. Am 18.05.21 um 11:37 schrieb Richard W.M. Jones:
On Tue, May 18, 2021 at 09:36:12AM +0200, Gottschalk wrote:
Hello Mr. Jones,
we use guestfish 1.4 This version was released 11 years ago??
we have an emergency of Data Recovery. We restored a ESXi 6.7 VMware-Image and wanted to read the data inside with guestfish.
The structure of the vm is based on LVM.
The first disk with the os inside a LV can be mounted correctly.
Two disks a 400GB are covered in a Volumegroup. There is one logical Volume with 800GB in this VG.
Guestfish does not read the filesystem in this LV.
I tried
<fs>add disk1.vmdk <fs>add disk2.vmdk <fs>add disk3.vmdk <fs>run <fs>list-devices /dev/sda /dev/sdb /dev/sdc
<fs>list-partitions /dev/sda1 On sdb and sdc there are no partitions. The LV resides directly on these disks. I simulated this with partitioned disks and identically result.
behavior without partitions on sdb and sdc
<fs> list-filesystems /dev/mailxxx-vg/root: ext4 /dev/mailxxx-vg/swap_1: swap /dev/vmail-vg/vmail-lv: unknown
<fs> list-filesystems
behavior with partitions on sdb and sdc libguestfs: error: list_filesystems: parted exited with status 1: Error: Can't have a partition outside the disk!
<fs>
<fs>mount /dev/mailxxx-vg/root / works fine <fs>mount/dev/vmail-vg/vmail-lv / libguestfs: error: mount: mount_stub: /dev/vmail-vg/vmail-lv: expecting a device name
How can i get access to this LV? Can you help me please? Thank you very much. I would suggest enabling debugging to start with, which should give you more information about what is actually going on. This section of the FAQ will explain how to do that:
https://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs
Rich.
On Wed, May 19, 2021 at 10:01:33AM +0200, Gottschalk wrote:
+ lvm pvs WARNING: Device /dev/sdb has size of 398267904 sectors which is smaller than corresponding PV size of 838860800 sectors. Was device resized? WARNING: One or more devices used as PVs in VG vmail-vg have changed sizes. PV VG Fmt Attr PSize PFree /dev/sda1 mailxxx-vg lvm2 a-- <20.00g 0 /dev/sdb vmail-vg lvm2 a-- <400.00g 0 /dev/sdc vmail-vg lvm2 a-- <400.00g 192.00m + lvm vgs WARNING: Device /dev/sdb has size of 398267904 sectors which is smaller than corresponding PV size of 838860800 sectors. Was device resized? WARNING: One or more devices used as PVs in VG vmail-vg have changed sizes. VG #PV #LV #SN Attr VSize VFree mailxxx-vg 1 2 0 wz--n- <20.00g 0 vmail-vg 2 1 0 wz--n- 799.99g 192.00m + lvm lvs WARNING: Device /dev/sdb has size of 398267904 sectors which is smaller than corresponding PV size of 838860800 sectors. Was device resized? WARNING: One or more devices used as PVs in VG vmail-vg have changed sizes. LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root mailxxx-vg -wi-a----- <19.04g swap_1 mailxxx-vg -wi-a----- 980.00m vmail-lv vmail-vg -wi------- 799.80g
There's the error - the LVM PV is corrupt and/or the underlying disk was shrunk without shrinking the PV. Restoration from backups is the way to go here, but you could also try examining the disk using the "virt-rescue" tool, which may allow you to recover something. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Hello Rich, thank you very much for your help. Mit freundlichen Grüßen ppa. Olaf Gottschalk raw Rechen-Anlage West GmbH Postfach 1120 | 52368 Kreuzau Empfang: +49 2421 9555-0 <tel:+49 2421 9555-0> | raw@raw.de <mailto:raw@raw.de> Sitz der Gesellschaft: Am Burgholz 33-35 | 52372 Kreuzau-Stockheim Hotline: +49 2421 9555-55 <tel:+49 2421 9555-55> | hotline@raw.de <mailto:hotline@raw.de> Geschäftsführer: Dipl.-Ing. Alexander Kutsch Internet: www.raw.de <https://www.raw.de> Handelsregister: Amtsgericht Düren HRB 134 UST- ID: DE 122 278 535 Der Inhalt dieser E-Mail ist ausschließlich für den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung, Vervielfältigung oder Weitergabe des Inhalts dieser E-Mail unzulässig sind. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen. Aussagen gegenüber dem Adressaten unterliegen den Regelungen des zugrundeliegenden Angebotes bzw. Auftrages, insbesondere den allgemeinen Auftragsbedingungen und der individuellen Haftungsvereinbarung. Der Inhalt dieser E-Mail ist nur rechtsverbindlich, wenn er unsererseits durch einen Brief entsprechend bestätigt wird. Die Versendung von E-Mails an uns hat keine fristwahrende Wirkung. Wir möchten Sie außerdem darauf hinweisen, dass die Kommunikation per E-Mail über das Internet unsicher ist, da für unberechtigte Dritte grundsätzlich die Möglichkeit der Kenntnisnahme und Manipulation besteht. Am 19.05.21 um 14:58 schrieb Richard W.M. Jones:
On Wed, May 19, 2021 at 10:01:33AM +0200, Gottschalk wrote:
+ lvm pvs WARNING: Device /dev/sdb has size of 398267904 sectors which is smaller than corresponding PV size of 838860800 sectors. Was device resized? WARNING: One or more devices used as PVs in VG vmail-vg have changed sizes. PV VG Fmt Attr PSize PFree /dev/sda1 mailxxx-vg lvm2 a-- <20.00g 0 /dev/sdb vmail-vg lvm2 a-- <400.00g 0 /dev/sdc vmail-vg lvm2 a-- <400.00g 192.00m + lvm vgs WARNING: Device /dev/sdb has size of 398267904 sectors which is smaller than corresponding PV size of 838860800 sectors. Was device resized? WARNING: One or more devices used as PVs in VG vmail-vg have changed sizes. VG #PV #LV #SN Attr VSize VFree mailxxx-vg 1 2 0 wz--n- <20.00g 0 vmail-vg 2 1 0 wz--n- 799.99g 192.00m + lvm lvs WARNING: Device /dev/sdb has size of 398267904 sectors which is smaller than corresponding PV size of 838860800 sectors. Was device resized? WARNING: One or more devices used as PVs in VG vmail-vg have changed sizes. LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert root mailxxx-vg -wi-a----- <19.04g swap_1 mailxxx-vg -wi-a----- 980.00m vmail-lv vmail-vg -wi------- 799.80g There's the error - the LVM PV is corrupt and/or the underlying disk was shrunk without shrinking the PV.
Restoration from backups is the way to go here, but you could also try examining the disk using the "virt-rescue" tool, which may allow you to recover something.
Rich.
participants (2)
-
Gottschalk -
Richard W.M. Jones