Recovering data from a hard drive with LVM a partition
Hello all,
I have an external USB hard drive that I need to recover some data from, but I see from fdisk -l that the partition uses LVM: Code:
[root@localhost ~]# fdisk -l /dev/sdd I have had a go anyway and may have now lost my data. Here's what I've ended up with (the partition in question is sdd1): Code:
[root@localhost ~]# pvdisplay Code:
[root@localhost ~]# vgdisplay Code:
[root@localhost ~]# lvdisplay Code:
[root@localhost ~]# mkdir /media/sdd1/ Can anyone help me recover my data please? Thanks, Craig |
Use "/sbin/vgmknodes" to create the /dev/dm-* nodes for the logical partition on the LVM volume. Then mount those nodes.
|
Hi jschiwal,
Thanks for your reply, unfortunately it didn't help on this occasion. At first vgmknodes didn't seem to do anything, especially as nothing appears in /dev/dm-*, not even for the working LVM drives. So I ran 'vgmknodes -v -v', part of the output is here: Code:
/dev/sdd1: lvm2 label detected Next I tried 'mount /dev/mapper/vg02-lv02 /media/sdd1'', this failed as before, the same goes for using -t: Code:
[root@localhost ~]# mount /dev/mapper/vg02-lv02 /media/sdd1/ Craig |
You are mounting the correct device (either path should work). I think the problem is either with broken filesystem (try fsck) or another filesystem type (try using mount without the -t option).
|
A quick check on a partition is to run "sudo file -s /dev/<device>". It will tell you what filesystem is on it. Then you can run fsck.<filesystem> to check the filesystem for errors.
Sometimes there is a filesystem in /dev/mapper/ and another such as /dev/dm-0. Also look at "ls -l /dev/disk/by-uuid/" and follow the links. Using UUID=<UUID #> in /etc/fstab is preferable for external drives. |
given up
Quote:
Quote:
Unfortunately I think I have a stuffed file system :-( as 'file' doesn't come back with anything useful, and I think I've done everything correctly. I'll have to read up on the UUID stuff as it didn't make sense on my system, the UUIDs in there weren't used by anything listed by pv/vg/lvdisplay. Thanks for the pointer though. Thanks for your help but I'll give up on this now, Craig |
Be sure you use "file -s" on the logical volume. Using it on a Physical volume or volume group won't give you a filesystem.
If the logical volumes were used to create a raid array, then you may not have a filesystem on the logical volume. |
All times are GMT -5. The time now is 10:05 PM. |