Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There is a virtual machine Xen (Centos 5.6). Inside was a lvm volume. At some point, a failure of power and the error appears. Launched fchk, fixed a bug. I launched it one more time - fell errors and the system not loading.
Mounted on another virtual machine (also Centos 5.6), tried to rename VG, but the second VM also stop loading (its data is not so critical, it is a test).
Created a third machine, the system disk without lvm, mounted a problem lvm-partition.
It became visible name given partition in the process of renaming on previous VM. Drive with the necessary data, appear to do was not in volume group. Nothing smarter than create a new vg and mount this disk does not come up.
# Vgdisplay
--- Volume group ---
VG Name resquevol
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read / write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 135.00 GiB
PE Size 4.00 MiB
Total PE 34 559
Alloc PE / Size 0 / 0
Free PE / Size 34 559 / 135.00 GiB
VG UUID Qnva3K-DX6q-a3a2-wqIe-QE0D-MQue-vrGLiw
Initialization of logical partitions did, only created with the disk vg /dev/xvdb3
Does this mean that my data is destroyed? If not, how to restore it?
The next step is to check and see if loop has max_part option. (modinfo loop as root) Reload loop with max_part=16.
Then losetup pointing to the troubled disk image.
From there, things get kind of vague for me because I'm not a Xen guy. You need to see if there's a FUSE module to mount the disk image. If there is, then it's pretty easy. Losetup /dev/loop0 /path/to/disk/image. If you did it right, Linux magically detects the partitions and will have a /dev/loop0 device, and another /dev/loop0p1 device Mount /dev/loop0 /mnt/some_dir -o read-about-fuse-module-options. If that doesn't work, try the /dev/loop0p1 device.
Once you get the file system mounted on a loop device, fdisk and testdisk is your best bets.
I looped my bad partition /dev/xvdc3 to /dev/loop0 , but I get "mount: unknown filesystem type 'LVM2_member'" while trying "mount /dev/loop0 /mnt". Module fuse already loaded
I looped my bad partition /dev/xvdc3 to /dev/loop0 , but I get "mount: unknown filesystem type 'LVM2_member'" while trying "mount /dev/loop0 /mnt". Module fuse already loaded
Code:
lsmod | grep -i fuse
fuse 50924 0
If you reinserted the loop kernel module with the option I mentioned, there will be more than one /dev/loop0, probably a /dev/loop0p1. Try mounting it.
If that doesn't work, still lots of options. You can find the ext3/4/ntfs/whatever partition offset in fdisk (fdisk -l /dev/loop0) and then mount it specifying the offest. Lots of examples of using the offset option around. Another option is to run testdisk on /dev/loop0 and see what it finds. I'm pretty confident the partition is not lost. You are going to know more about partitions/disks by the time you find/mount the partition.
Very last ditch effort, create a backup of the entire disk on /dev/loop0. Then losetup /dev/loop1 /path/to/dd-image Try activating the logical volume using /dev/loop1 as the device. This is a bit tricky because you aren't creating a new logical volume. That would rewrite the partition information. You are just changing the device path of an existing LVM. Which is why doing it on a disk image is strongly recommended.
The issuse solved in such way: I manually edit vgcfgbackup-file, adding there my lost partition (I looked the way in the another my server with almost same lvm config). Then, I make vgcfgrestore and it works fine - losted partition correctly mounted as ext3 so I could navigate there with standard system tools. Data was corrupted, but it was duplicated about 20 times in different places of the FS so I could find a good one.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.