LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ubuntu server disk failed, help me (https://www.linuxquestions.org/questions/linux-newbie-8/ubuntu-server-disk-failed-help-me-4175591867/)

prowas 10-20-2016 06:48 PM

ubuntu server disk failed, help me
 
Hello

server gives an error

Failed screen ;
http://i.hizliresim.com/rEb0VV.jpg

Os : UBUNTU 14.04 - vmware virtual server

Live disk os print screen

Code:

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

Code:

root@ubuntu:~# blkid
/dev/loop0: TYPE="squashfs"
/dev/sr0: LABEL="Ubuntu 14.04.4 LTS amd64" TYPE="iso9660"
/dev/sda1: UUID="21e32c1c-be2e-4f55-b6d2-11fdd34ebabc" TYPE="ext2"
/dev/sda4: UUID="VrnOve-rkJU-xmjA-MHqz-4Y3v-Y3NO-G2LnFi" TYPE="LVM2_member"

Code:

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


frankbell 10-21-2016 06:15 PM

It appears to be DOA. What kind of help exactly are you looking for?

descendant_command 10-21-2016 06:47 PM

Replace disk.
Reinstall and/or restore backup.
Have beer. :)

rknichols 10-21-2016 07:01 PM

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?

prowas 10-22-2016 03:49 AM

Quote:

Originally Posted by rknichols (Post 5621232)
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


prowas 10-22-2016 03:50 AM

Quote:

Originally Posted by frankbell (Post 5621209)
It appears to be DOA. What kind of help exactly are you looking for?

HDD data recovery

prowas 10-22-2016 03:51 AM

Quote:

Originally Posted by descendant_command (Post 5621226)
Replace disk.
Reinstall and/or restore backup.
Have beer. :)

To access the old data ?? help me

BW-userx 10-22-2016 08:24 AM

check this out for data recovery

TestDisk

PhotoRec

rknichols 10-22-2016 10:18 AM

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:
Code:

dd if=/dev/sda bs=1M skip=244 count=102155 of=/path/to/some/file
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.

prowas 10-22-2016 02:49 PM

Quote:

Originally Posted by rknichols (Post 5621439)
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:
Code:

dd if=/dev/sda bs=1M skip=244 count=102155 of=/path/to/some/file
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)


rknichols 10-22-2016 04:42 PM

Quote:

Originally Posted by prowas (Post 5621541)
Code:

root@ubuntu:~# file -s /dev/sda5
/dev/sda5: ERROR: cannot open `/dev/sda5' (No such file or directory)


Did you use fdisk and create partition 5 on that disk? Were there any error messages when you did that?

prowas 10-22-2016 04:56 PM

Quote:

Originally Posted by rknichols (Post 5621574)
Did you use fdisk and create partition 5 on that disk? Were there any error messages when you did that?

I needed to write what commands?

rknichols 10-22-2016 10:46 PM

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.

prowas 10-23-2016 02:24 AM

Quote:

Originally Posted by rknichols (Post 5621668)
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.

how can I do it ?

Jjanel 10-23-2016 03:10 AM

Enter the command testdisk at a root prompt.

# testdisk

Can you describe/discuss/explain *in detail*: what disk drives you had, and what *might* have happened to them?

prowas 10-23-2016 05:09 AM

No error HDD
LVM redefine?
vmware virtual disk

prowas 10-23-2016 05:31 AM

No disk failure
LVM structure is broken
How can I re-introduced?

vmware virtual disk

Jjanel 10-23-2016 06:40 AM

testdisk ('bad' name!) isn't testing a physical hdd; it's looking for LVM clues! From #8: read:
http://www.cgsecurity.org/wiki/TestDisk_Step_By_Step

prowas 10-23-2016 07:07 AM

Code:

Sun Oct 23 10:00:58 2016
Command line: TestDisk

TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org
OS: Linux, kernel 4.2.0-27-generic (#32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016) x86_64
Compiler: GCC 4.8
Compilation date: 2013-10-29T01:29:29
ext2fs lib: 1.42.9, ntfs lib: libntfs-3g, reiserfs lib: none, ewf lib: none
Warning: can't get size for Disk /dev/mapper/control - 0 B - 1 sectors, sector size=512
/dev/sr0 is not an ATA disk
Hard disk list
Disk /dev/sda - 536 GB / 500 GiB - CHS 65270 255 63, sector size=512 - VMware Virtual disk, FW:1.0
Disk /dev/sr0 - 1069 MB / 1020 MiB - 522240 sectors (RO), sector size=2048 - VMware Virtual IDE CDROM Drive, S/N:00000000000000000001, FW:00000001

Partition table type (auto): Intel
Disk /dev/sda - 536 GB / 500 GiB - VMware Virtual disk
Partition table type: Intel

Analyse Disk /dev/sda - 536 GB / 500 GiB - CHS 65270 255 63
Geometry from i386 MBR: head=255 sector=63
check_part_i386 failed for partition type 83

LVM2 magic value at 13054/10/13
Current partition structure:
 1 * Linux                    0  32 33    31  26 59    497664
 2 E extended                31  59 27 13054  10 12  209211394
No ext2, JFS, Reiser, cramfs or XFS marker
 3 P Linux                  31  26 60    31  59 26      2046
 3 P Linux                  31  26 60    31  59 26      2046
 4 P Linux LVM            13054  10 13 65270 213 31  838862848

search_part()
Disk /dev/sda - 536 GB / 500 GiB - CHS 65270 255 63

recover_EXT2: s_block_group_nr=0/30, s_mnt_count=11/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 33    31  26 59    497664
    ext2 blocksize=1024 Sparse superblock, 254 MB / 243 MiB

LVM2 magic value at 31/59/29
part_size 209211392
    Linux LVM              31  59 29 13054  10 12  209211392
    LVM2, 107 GB / 99 GiB

LVM2 magic value at 13054/10/13
part_size 838862848
    Linux LVM            13054  10 13 65270 213 31  838862848
    LVM2, 429 GB / 400 GiB

Results
  * Linux                    0  32 33    31  26 59    497664
    ext2 blocksize=1024 Sparse superblock, 254 MB / 243 MiB
  P Linux LVM              31  59 29 13054  10 12  209211392
    LVM2, 107 GB / 99 GiB
  P Linux LVM            13054  10 13 65270 213 31  838862848
    LVM2, 429 GB / 400 GiB

interface_write()
 1 * Linux                    0  32 33    31  26 59    497664
 2 P Linux LVM              31  59 29 13054  10 12  209211392
 3 P Linux LVM            13054  10 13 65270 213 31  838862848

search_part()
Disk /dev/sda - 536 GB / 500 GiB - CHS 65270 255 63

recover_EXT2: s_block_group_nr=0/30, s_mnt_count=11/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 33    31  26 59    497664
    ext2 blocksize=1024 Sparse superblock, 254 MB / 243 MiB

block_group_nr 1

recover_EXT2: "e2fsck -b 8193 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=1/30, s_mnt_count=0/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB

block_group_nr 3

recover_EXT2: "e2fsck -b 24577 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=3/30, s_mnt_count=0/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB

block_group_nr 5

recover_EXT2: "e2fsck -b 40961 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=5/30, s_mnt_count=0/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB

block_group_nr 7

recover_EXT2: "e2fsck -b 57345 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=7/30, s_mnt_count=0/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB

block_group_nr 9

recover_EXT2: "e2fsck -b 73729 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=9/30, s_mnt_count=0/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB

block_group_nr 25

recover_EXT2: "e2fsck -b 204801 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=25/30, s_mnt_count=0/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB

block_group_nr 27

recover_EXT2: "e2fsck -b 221185 -B 1024 device" may be needed
recover_EXT2: s_block_group_nr=27/30, s_mnt_count=0/4294967295, s_blocks_per_group=8192, s_inodes_per_group=2008
recover_EXT2: s_blocksize=1024
recover_EXT2: s_blocks_count 248832
recover_EXT2: part_size 497664
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB

LVM2 magic value at 31/59/29
part_size 209211392
    Linux LVM              31  59 29 13054  10 12  209211392
    LVM2, 107 GB / 99 GiB

recover_EXT2: s_block_group_nr=0/3933, s_mnt_count=9/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 128907264
recover_EXT2: part_size 1031258112
    Linux                  31  91 61 64224  53 21 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB

recover_EXT2: s_block_group_nr=0/3933, s_mnt_count=9/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 128907264
recover_EXT2: part_size 1031258112
    Linux                5793 205 45 69986 167  5 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
This partition ends after the disk limits. (start=93077504, size=1031258112, end=1124335615, disk end=1048576000)

recover_EXT2: s_block_group_nr=0/3933, s_mnt_count=9/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 128907264
recover_EXT2: part_size 1031258112
    Linux                5794 210 49 69987 172  9 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
This partition ends after the disk limits. (start=93093888, size=1031258112, end=1124351999, disk end=1048576000)

recover_EXT2: s_block_group_nr=0/3933, s_mnt_count=9/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 128907264
recover_EXT2: part_size 1031258112
    Linux                5798 100 63 69991  62 23 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
This partition ends after the disk limits. (start=93151232, size=1031258112, end=1124409343, disk end=1048576000)

recover_EXT2: s_block_group_nr=0/3933, s_mnt_count=9/4294967295, s_blocks_per_group=32768, s_inodes_per_group=8192
recover_EXT2: s_blocksize=4096
recover_EXT2: s_blocks_count 128907264
recover_EXT2: part_size 1031258112
    Linux                5804  1 22 69996 217 45 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
This partition ends after the disk limits. (start=93241344, size=1031258112, end=1124499455, disk end=1048576000)
    Linux Swap          12007 137 35 13051  92 17  16769008
    SWAP2 version 1, pagesize=4096, 8585 MB / 8187 MiB

LVM2 magic value at 13054/10/13
part_size 838862848
    Linux LVM            13054  10 13 65270 213 31  838862848
    LVM2, 429 GB / 400 GiB
Disk /dev/sda - 536 GB / 500 GiB - CHS 65270 255 63
Check the harddisk size: HD jumpers settings, BIOS detection...
The harddisk (536 GB / 500 GiB) seems too small! (< 575 GB / 536 GiB)
The following partitions can't be recovered:
    Linux                5793 205 45 69986 167  5 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
    Linux                5794 210 49 69987 172  9 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
    Linux                5798 100 63 69991  62 23 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
    Linux                5804  1 22 69996 217 45 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB

Results
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB
    Linux                    0  32 33    31  26 59    497664
    ext2 blocksize=1024 Sparse superblock, 254 MB / 243 MiB
    Linux LVM              31  59 29 13054  10 12  209211392
    LVM2, 107 GB / 99 GiB
    Linux                  31  91 61 64224  53 21 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
    Linux Swap          12007 137 35 13051  92 33  16769024
    SWAP2 version 1, pagesize=4096, 8585 MB / 8188 MiB
    Linux LVM            13054  10 13 65270 213 31  838862848
    LVM2, 429 GB / 400 GiB

interface_write()
 
No partition found or selected for recovery


rknichols 10-23-2016 09:36 AM

Quote:

Originally Posted by prowas (Post 5621754)
Code:

Results
    Linux                    0  32 31    31  26 57    497664
    ext2 blocksize=1024 Sparse superblock Backup superblock, 254 MB / 243 MiB
    Linux                    0  32 33    31  26 59    497664
    ext2 blocksize=1024 Sparse superblock, 254 MB / 243 MiB
    Linux LVM              31  59 29 13054  10 12  209211392
    LVM2, 107 GB / 99 GiB

    Linux                  31  91 61 64224  53 21 1031258112
    ext4 blocksize=4096 Large file Sparse superblock Recover, 528 GB / 491 GiB
    Linux Swap          12007 137 35 13051  92 33  16769024
    SWAP2 version 1, pagesize=4096, 8585 MB / 8188 MiB
    Linux LVM            13054  10 13 65270 213 31  838862848
    LVM2, 429 GB / 400 GiB


That is excellent! The result that I colored "Red" is your LVM volume right where it should be in the extended partition, and with the correct size. Those CHS addresses work out to starting LBA 501760 and ending LBA 209713151. You can either select that partition for recovery and let testdisk write out the repaired partition table, or else use fdisk to create a logical partition with those starting and ending sector numbers. That should be all you need to do.

prowas 10-23-2016 09:44 AM

Quote:

Originally Posted by rknichols (Post 5621799)
That is excellent! The result that I colored "Red" is your LVM volume right where it should be in the extended partition, and with the correct size. Those CHS addresses work out to starting LBA 501760 and ending LBA 209713151. You can either select that partition for recovery and let testdisk write out the repaired partition table, or else use fdisk to create a logical partition with those starting and ending sector numbers. That should be all you need to do.

Which command should I use?
What should I do to solve?

solution: do I recover the disk?
solution: LVM been to identify the disk?

I do not understand English more
I would be glad if you give commands for simple solutions.

thank you

rknichols 10-23-2016 10:52 AM

Since you are unfamiliar with the commands, this is the simplest way. First, copy and paste the text below to a file named parts.out:
Code:

label: dos
device: /dev/sda
unit: sectors

/dev/sda1 : start=        2048, size=      497664, type=83
/dev/sda2 : start=      501758, size=  209211394, type=5
/dev/sda3 : start=      499712, size=        2046, type=83
/dev/sda4 : start=  209713152, size=  838862848, type=8e
/dev/sda5 : start=      501760, size=  209211392, type=8e

Then, run the command
Code:

sfdisk /dev/sda <parts.out
That should repair your partitioning. The LVM volume should now be seen properly.

prowas 10-23-2016 10:55 AM

Code:

root@ubuntu:~# sfdisk /dev/sda <parts.out
Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 65270 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sda1  *      0+    31-    31-    248832  83  Linux
/dev/sda2        31+  13054-  13023- 104605697    5  Extended
/dev/sda3        31+    31-      1-      1023  83  Linux
/dev/sda4      13054+  65270-  52217- 419431424  8e  Linux LVM
                start: (c,h,s) expected (1023,254,63) found (766,10,13)
                end: (c,h,s) expected (1023,254,63) found (758,213,31)

sfdisk: unrecognized input: dos
root@ubuntu:~#


rknichols 10-23-2016 12:44 PM

This is the fundamental problem with Linux. There are over 100 distributions, each with its own versions of tools. I'll have to download Ubuntu 14.04 and see what version of sfdisk it uses and what it will accept. You can try just removing the "label: dos" line from that file and trying again.

prowas 10-23-2016 01:00 PM

Code:

root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:        14.04
Codename:      trusty


rknichols 10-23-2016 01:08 PM

This file should work for you:
Code:

unit: sectors

/dev/sda1 : start=        2048, size=      497664, Id=83
/dev/sda2 : start=      501758, size=  209211394, Id=5
/dev/sda3 : start=      499712, size=        2046, Id=83
/dev/sda4 : start=  209713152, size=  838862848, Id=8e
/dev/sda5 : start=      501760, size=  209211392, Id=8e


prowas 10-23-2016 01:42 PM

Quote:

Originally Posted by rknichols (Post 5621901)
This file should work for you:
Code:

unit: sectors

/dev/sda1 : start=        2048, size=      497664, Id=83
/dev/sda2 : start=      501758, size=  209211394, Id=5
/dev/sda3 : start=      499712, size=        2046, Id=83
/dev/sda4 : start=  209713152, size=  838862848, Id=8e
/dev/sda5 : start=      501760, size=  209211392, Id=8e



Code:

root@ubuntu:~# sfdisk /dev/sda <parts.out
Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 65270 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sda1  *      0+    31-    31-    248832  83  Linux
/dev/sda2        31+  13054-  13023- 104605697    5  Extended
/dev/sda3        31+    31-      1-      1023  83  Linux
/dev/sda4      13054+  65270-  52217- 419431424  8e  Linux LVM
                start: (c,h,s) expected (1023,254,63) found (766,10,13)
                end: (c,h,s) expected (1023,254,63) found (758,213,31)

sfdisk: long or incomplete input line - quitting


rknichols 10-23-2016 01:56 PM

What is the output from "sfdisk --version" ?

prowas 10-23-2016 01:57 PM

Quote:

Originally Posted by rknichols (Post 5621924)
What is the output from "sfdisk --version" ?




Code:

root@ubuntu:~# sfdisk --version
sfdisk from util-linux 2.20.1


rknichols 10-23-2016 02:34 PM

It works fine for me with that same version of sfdisk in xubuntu 14.04. The only way I could duplicate your result was by deleting the newline at the very end of the file. Make sure one is there. If that doesn't fix the problem, to prove that the file is not corrupted post the output from "hexdump -C parts.out"

prowas 10-23-2016 02:39 PM

Quote:

Originally Posted by rknichols (Post 5621946)
It works fine for me with that same version of sfdisk in xubuntu 14.04. The only way I could duplicate your result was by deleting the newline at the very end of the file. Make sure one is there. If that doesn't fix the problem, to prove that the file is not corrupted post the output from "hexdump -C parts.out"


Code:

root@ubuntu:~# hexdump -C parts.out
00000000  75 6e 69 74 3a 20 73 65  63 74 6f 72 73 0a 0a 2f  |unit: sectors../|
00000010  64 65 76 2f 73 64 61 31  20 3a 20 73 74 61 72 74  |dev/sda1 : start|
00000020  3d 20 20 20 20 20 20 20  20 32 30 34 38 2c 20 73  |=        2048, s|
00000030  69 7a 65 3d 20 20 20 20  20 20 34 39 37 36 36 34  |ize=      497664|
00000040  2c 20 49 64 3d 38 33 0a  2f 64 65 76 2f 73 64 61  |, Id=83./dev/sda|
00000050  32 20 3a 20 73 74 61 72  74 3d 20 20 20 20 20 20  |2 : start=      |
00000060  35 30 31 37 35 38 2c 20  73 69 7a 65 3d 20 20 20  |501758, size=  |
00000070  32 30 39 32 31 31 33 39  34 2c 20 49 64 3d 35 0a  |209211394, Id=5.|
00000080  2f 64 65 76 2f 73 64 61  33 20 3a 20 73 74 61 72  |/dev/sda3 : star|
00000090  74 3d 20 20 20 20 20 20  34 39 39 37 31 32 2c 20  |t=      499712, |
000000a0  73 69 7a 65 3d 20 20 20  20 20 20 20 20 32 30 34  |size=        204|
000000b0  36 2c 20 49 64 3d 38 33  0a 2f 64 65 76 2f 73 64  |6, Id=83./dev/sd|
000000c0  61 34 20 3a 20 73 74 61  72 74 3d 20 20 20 32 30  |a4 : start=  20|
000000d0  39 37 31 33 31 35 32 2c  20 73 69 7a 65 3d 20 20  |9713152, size=  |
000000e0  20 38 33 38 38 36 32 38  34 38 2c 20 49 64 3d 38  | 838862848, Id=8|
000000f0  65 0a 2f 64 65 76 2f 73  64 61 35 20 3a 20 73 74  |e./dev/sda5 : st|
00000100  61 72 74 3d 20 20 20 20  20 20 35 30 31 37 36 30  |art=      501760|
00000110  2c 20 73 69 7a 65 3d 20  20 20 32 30 39 32 31 31  |, size=  209211|
00000120  33 39 32 2c 20 49 64 3d  38 65                    |392, Id=8e|
0000012a


rknichols 10-23-2016 03:29 PM

As expected, there is no newline (hex 0a) character at the end of the file. Read the file into an editor, add a newline at the end, and write it back out.

prowas 10-23-2016 03:31 PM

Quote:

Originally Posted by rknichols (Post 5621978)
As expected, there is no newline (hex 0a) character at the end of the file. Read the file into an editor, add a newline at the end, and write it back out.


Code:

root@ubuntu:~# sfdisk /dev/sda < parts.out
Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 65270 cylinders, 255 heads, 63 sectors/track
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

  Device Boot Start    End  #cyls    #blocks  Id  System
/dev/sda1  *      0+    31-    31-    248832  83  Linux
/dev/sda2        31+  13054-  13023- 104605697    5  Extended
/dev/sda3        31+    31-      1-      1023  83  Linux
/dev/sda4      13054+  65270-  52217- 419431424  8e  Linux LVM
                start: (c,h,s) expected (1023,254,63) found (766,10,13)
                end: (c,h,s) expected (1023,254,63) found (758,213,31)
New situation:
Units = sectors of 512 bytes, counting from 0

  Device Boot    Start      End  #sectors  Id  System
/dev/sda1          2048    499711    497664  83  Linux
/dev/sda2        501758 209713151  209211394  5  Extended
/dev/sda3        499712    501757      2046  83  Linux
/dev/sda4    209713152 1048575999  838862848  8e  Linux LVM
/dev/sda5        501760 209713151  209211392  8e  Linux LVM
Warning: partition 1 does not end at a cylinder boundary
Warning: partition 2 does not start at a cylinder boundary
Warning: partition 2 does not end at a cylinder boundary
Warning: partition 3 does not start at a cylinder boundary
Warning: partition 3 does not end at a cylinder boundary
Warning: partition 4 does not start at a cylinder boundary
Warning: partition 4 does not end at a cylinder boundary
Warning: partition 5 does not end at a cylinder boundary
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes:  dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)


rknichols 10-23-2016 03:45 PM

Is the problem now fixed? I believe that vgdisplay should no longer complain about a missing device.

Because of the way you are violating LQ rules by spamming the forums with links to this thread, I do not intend to investigate this any further.

prowas 10-23-2016 03:46 PM

Quote:

Originally Posted by rknichols (Post 5621989)
Is the problem now fixed? I believe that vgdisplay should no longer complain about a missing device.

Because of the way you are violating LQ rules by spamming the forums with links to this thread, I do not intend to investigate this any further.


Code:

root@ubuntu:~# vgdisplay
  --- Volume group ---
  VG Name              server-vg
  System ID
  Format                lvm2
  Metadata Areas        2
  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                2
  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


prowas 10-23-2016 04:04 PM

"rknichols" Thank you for your interest

prowas 10-23-2016 04:42 PM

How can I access the HDD?
Can I mount?
How can I get access to the files?

rknichols 10-23-2016 07:50 PM

As far as I can see, the LVM structure has been fixed. Does that disk still fail to boot? What happens now?

prowas 10-24-2016 09:15 AM

"rknichols"
I mount the disk

Thank you very much for your help

You know this job

thanks thanks thanks


All times are GMT -5. The time now is 01:07 AM.