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.
root@ubuntu:~# pvdisplay
Couldn't find device with uuid J3f0bP-yTQW-7yiD-On2Z-17Kw-wPp7-RWH2t9.
--- Physical volume ---
PV Name unknown device
VG Name server-vg
PV Size 99.76 GiB / not usable 2.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25538
Free PE 5
Allocated PE 25533
PV UUID J3f0bP-yTQW-7yiD-On2Z-17Kw-wPp7-RWH2t9
--- Physical volume ---
PV Name /dev/sda4
VG Name server-vg
PV Size 400.00 GiB / not usable 1.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 102400
Free PE 0
Allocated PE 102400
PV UUID VrnOve-rkJU-xmjA-MHqz-4Y3v-Y3NO-G2LnFi
root@ubuntu:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 500G 0 disk
├─sda1 8:1 0 243M 0 part
├─sda2 8:2 0 1K 0 part
├─sda3 8:3 0 1023K 0 part
└─sda4 8:4 0 400G 0 part
sr0 11:0 1 1020M 0 rom /cdrom
loop0 7:0 0 975.9M 1 loop /rofs
Code:
root@ubuntu:~# fdisk -l
Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders, total 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087159
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 209713151 104605697 5 Extended
/dev/sda3 499712 501757 1023 83 Linux
/dev/sda4 209713152 1048575999 419431424 8e Linux LVM
Partition table entries are not in disk order
Code:
root@ubuntu:~# vgdisplay
Couldn't find device with uuid J3f0bP-yTQW-7yiD-On2Z-17Kw-wPp7-RWH2t9.
--- Volume group ---
VG Name server-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 2
Act PV 1
VG Size 499.76 GiB
PE Size 4.00 MiB
Total PE 127938
Alloc PE / Size 127933 / 499.74 GiB
Free PE / Size 5 / 20.00 MiB
VG UUID iCp4mf-34fz-p0Xh-X7lm-uDdG-bKYm-d4yKc2
Code:
root@ubuntu:~# lvdisplay
Couldn't find device with uuid J3f0bP-yTQW-7yiD-On2Z-17Kw-wPp7-RWH2t9.
--- Logical volume ---
LV Path /dev/server-vg/root
LV Name root
VG Name server-vg
LV UUID wfaJpW-TU0v-RvOw-SyKu-bl0g-tmpa-zmI5v0
LV Write Access read/write
LV Creation host, time server, 2016-03-12 19:24:56 +0000
LV Status NOT available
LV Size 491.74 GiB
Current LE 125886
Segments 2
Allocation inherit
Read ahead sectors auto
--- Logical volume ---
LV Path /dev/server-vg/swap_1
LV Name swap_1
VG Name server-vg
LV UUID pddotV-z9eH-xHRJ-sw19-0Kcb-PZCN-v0VmhH
LV Write Access read/write
LV Creation host, time server, 2016-03-12 19:24:56 +0000
LV Status NOT available
LV Size 8.00 GiB
Current LE 2047
Segments 1
Allocation inherit
Read ahead sectors auto
Code:
root@ubuntu:~# fdisk -l /dev/sda
Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders, total 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087159
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 209713151 104605697 5 Extended
/dev/sda3 499712 501757 1023 83 Linux
/dev/sda4 209713152 1048575999 419431424 8e Linux LVM
Partition table entries are not in disk order
It looks like there used to be a 99.76GB partition that was part of the volume group. Adding up the numbers, it appears that partition 2 either was that partition or was an extended partition that contained the 99.76GB logical partition. What does "fdisk -l /dev/sda" show from the live disk?
It looks like there used to be a 99.76GB partition that was part of the volume group. Adding up the numbers, it appears that partition 2 either was that partition or was an extended partition that contained the 99.76GB logical partition. What does "fdisk -l /dev/sda" show from the live disk?
Code:
root@ubuntu:~# fdisk -l /dev/sda
Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders, total 1048576000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00087159
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 499711 248832 83 Linux
/dev/sda2 501758 209713151 104605697 5 Extended
/dev/sda3 499712 501757 1023 83 Linux
/dev/sda4 209713152 1048575999 419431424 8e Linux LVM
Partition table entries are not in disk order
It appears that there was a partition /dev/sda5 that held your missing LVM volume. The partition header, at least, was overwritten. If the LVM PV header is intact, testdisk will be able to recover the partition. Without that LVM PV header, testdisk won't be able to make sense out of what remains.
At this point, you are getting into dangerous territory. I strongly suggest saving an image of that entire extended partition:
That's going to pick up both sda2 and the small sda3 partition that physically precedes it. Because of the way sda2 is aligned, copying just sda2 would require using a painfully small 1024-byte block size (very slow for 100GB).
Next, use fdisk to try to create logical partition 5 using the entire available space in the extended partition. That's probably not going to work since the extended partition header is gone. You will first need to delete the existing extended partition and create a new one at the same location.
Now, you can run "file -s /dev/sda5" and see if it looks like an LVM physical volume. If not, recovery may still be possible, but a bit complicated. Let's see how things appear first.
It appears that there was a partition /dev/sda5 that held your missing LVM volume. The partition header, at least, was overwritten. If the LVM PV header is intact, testdisk will be able to recover the partition. Without that LVM PV header, testdisk won't be able to make sense out of what remains.
At this point, you are getting into dangerous territory. I strongly suggest saving an image of that entire extended partition:
That's going to pick up both sda2 and the small sda3 partition that physically precedes it. Because of the way sda2 is aligned, copying just sda2 would require using a painfully small 1024-byte block size (very slow for 100GB).
Next, use fdisk to try to create logical partition 5 using the entire available space in the extended partition. That's probably not going to work since the extended partition header is gone. You will first need to delete the existing extended partition and create a new one at the same location.
Now, you can run "file -s /dev/sda5" and see if it looks like an LVM physical volume. If not, recovery may still be possible, but a bit complicated. Let's see how things appear first.
Code:
root@ubuntu:~# file -s /dev/sda5
/dev/sda5: ERROR: cannot open `/dev/sda5' (No such file or directory)
Did you first try running testdisk to see if it could find the missing LVM volume? That would be the safest step. Playing with logical partitions always runs the risk of writing a logical partition header in a wrong place and overwriting something important.
Did you first try running testdisk to see if it could find the missing LVM volume? That would be the safest step. Playing with logical partitions always runs the risk of writing a logical partition header in a wrong place and overwriting something important.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.