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-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"


All times are GMT -5. The time now is 10:37 AM.