Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 59

Thread: Partition table messed up - hundreds of "ghost" partitions

  1. #31
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Partition table messed up - hundreds of "ghost" partitions

    Stay focussed on my prescriptions for the moment or it will all go wrong.

    It will be helpful to run a fs dump on sda7 and sda8. This reads the fs superblock and will reveal if it cannot be found because it is in the wrong place relative to the start sector:

    sudo dumpe2fs -h /dev/sda7

    sudo dumpe2fs -h /dev/sda8


    If they are obviously broken then the next step is to change the start sectors of those partitions back to what they originally were. But again, I would be cautious and clone the drive before doing this. Unless you are in a really hurry.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  2. #32
    Join Date
    Jul 2007
    Beans
    142

    Re: Partition table messed up - hundreds of "ghost" partitions

    Hehe, you all gave me a lot to read and do... but I'm leaving the office in 5 minutes, so I can't do it right now. I'll try your suggestions in a couple of hours hopefully, and then I'll report back.
    And tomorrow I'll try to buy a new hd to make a clone, and to replace the stolen one in the future...

    I don't know how to express my gratitude for the help you're giving me!

    Cristian

  3. #33
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,195

    Re: Partition table messed up - hundreds of "ghost" partitions

    Quote Originally Posted by YesWeCan View Post
    Stay focussed on my prescriptions for the moment or it will all go wrong.
    I disagree. I believe my suggestion to combine the output of two sfdisk outputs (if the earlier ones exist) will be a quicker, easier, and safer approach than doing it piecemeal. Attempting to diagnose filesystems from partitions that have had their start points changed, as you're now suggesting, is almost certainly a wild goose chase.
    If I've suggested a solution to a problem and you're not the original poster, do not try my solution! Problems can seem similar but be different, and a good solution to one problem can make another worse. Post a new thread with your problem details.

  4. #34
    Join Date
    Jul 2007
    Beans
    142

    Re: Partition table messed up - hundreds of "ghost" partitions

    Update... I have followed the advice from comment #27 (resizing extended partition sda4) and it appears to have worked - at least, GParted now sees the partitioning. Now, before doing more damage, I'll wait until tomorrow, when I can buy a new external drive, to clone this one.

    This error normally concerns Network File System mounting of partitions. It could be a red herring. Were you using NFS mounting before this incident occurred?
    No, never used NFS. It was an ext3. And as I said above, trying to mount it as ext3 gives an error.

    In post #10, you said that you made a backup of the partition table. If you did this with "sfdisk -d", you should be able to combine its good entries with the current partition table's good entries to fix everything in one fell swoop
    What I have is what I posted in this post and my previous post (see http://ubuntuforums.org/showthread.php?t=1848954 ). Unfortunately I don't have a backup from when it was working.

    Cristian

  5. #35
    Join Date
    Jul 2007
    Beans
    142

    Re: Partition table messed up - hundreds of "ghost" partitions

    To add to my previous message: it is true that I don't have a partition table from when everything was OK, but I do have the output of "fdisk -lu" from before the modifications made by testdisk. The output is quoted on message #3 of this thread.

    Interesting thing: now that GParted sees the partitions, I noticed that it says that sda11 is about 40% full, which would make sense... but if I mount it, it gets mounted without errors, but it appears empty... ?!?

    Cristian

  6. #36
    Join Date
    Mar 2010
    Location
    Woonsocket, RI USA
    Beans
    3,195

    Re: Partition table messed up - hundreds of "ghost" partitions

    Quote Originally Posted by Quaxo76 View Post
    Update... I have followed the advice from comment #27 (resizing extended partition sda4) and it appears to have worked - at least, GParted now sees the partitioning. Now, before doing more damage, I'll wait until tomorrow, when I can buy a new external drive, to clone this one.
    At least you've making progress! Cloning the disk at this point certainly makes sense.

    Quote Originally Posted by Quaxo76 View Post
    To add to my previous message: it is true that I don't have a partition table from when everything was OK, but I do have the output of "fdisk -lu" from before the modifications made by testdisk. The output is quoted on message #3 of this thread.
    It's possible to edit the file you get from "sfdisk -d" using that output, but you've got to do some math to convert the partitions' end points to size values. In your case, you've got, from fdisk:

    Code:
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda7       276817920   308142079    15662080   83  Linux
    /dev/sda8       308144128   369606655    30731264   83  Linux
    Equivalent sfdisk values would keep the start point and convert the end point via the formula size = end - start + 1. Thus, you'd get sfdisk entries like this:

    Code:
    /dev/sda7 : start=276817920, size= 31324160, Id=83
    /dev/sda8 : start=308144128, size= 61462528, Id=83
    Please check my arithmetic on those values. I've checked twice, but checking again is in order.

    Before you implement this change, though, was it possible to access those partitions before you used TestDisk? If so, those values are almost certainly correct and it should be safe to use them. If not, there's a possibility that they were incorrect before, that TestDisk has found the correct values, and that both partitions have filesystem damage. This seems very improbable to me, but I can't rule out the possibility entirely.

    The dilemma is that correcting either problem is risky if you correct the wrong problem. If you make the changes using sfdisk, thus restoring the old partitions, and in fact the new partition locations determined by TestDisk are correct, then you'll write one sector into a location within the valid filesystem, which could be harmless or could damage the filesystem. This risk is fairly low because it's one sector and because the partition table had been set up this way, so chances are the same sector was already used in this way. Still, it's possible that you'll do significant damage to the filesystem.

    OTOH, if you assume the new partition table is correct, you can use fsck or e2fsck to try to fix it, as in "sudo fsck /dev/sda7". The danger here is that fsck might become confused and write a whole bunch of data in inappropriate locations, thus making things much worse than they are now.

    Perhaps YesWeCan's suggestion to use dumpe2fs is intended to gather information intended to help discriminate between these cases; but it's rather unlikely to discover such information if the partition's start point is incorrect. If you've got a backup, and given the likelihood that the original partition table was correct for these two partitions, you'll probably get a much quicker fix by re-writing the partition table, rebooting into an emergency disk that won't auto-mount the filesystems, and then attempt a read-only mount, as in:

    Code:
    sudo mount -o ro /dev/sda7 /mnt
    If that works and you can access the filesystems, then you might unmount them and use fsck on them just to be sure they're clean.

    If this fails, it might be necessary to restore the partitions to their current state, use dd to restore the first 1 MiB or so of /dev/sda7 and /dev/sda8, and try again in another way.

    Interesting thing: now that GParted sees the partitions, I noticed that it says that sda11 is about 40% full, which would make sense... but if I mount it, it gets mounted without errors, but it appears empty... ?!?
    It could be that TestDisk has misdetected /dev/sda11, or it could be that it's suffered some damage. It's probably best to attempt a repair of it after you make a backup and deal with the earlier partitions.

    If you're lucky, fsck may be able to repair the problems. If not, there are at least two alternatives:


    • The type of dumpe2fs command that YesWeCan suggested for /dev/sda7 and /dev/sda8 might produce useful data. (It might do so here because there seems to be data that's properly aligned for some tools to detect, but that's not the case for /dev/sda7, and probably not for /dev/sda8.)
    • You can try GParted's partition-recovery tool. You'd need to delete /dev/sda11 and then use Device -> Attempt Data Rescue in GParted. I've heard of cases in which it does a better job than TestDisk, so it might work even when TestDisk failed.



    None of these options is guaranteed to work.
    If I've suggested a solution to a problem and you're not the original poster, do not try my solution! Problems can seem similar but be different, and a good solution to one problem can make another worse. Post a new thread with your problem details.

  7. #37
    Join Date
    Jul 2007
    Beans
    142

    Re: Partition table messed up - hundreds of "ghost" partitions

    OK, thanks, I'm going to buy the new disk now, then make the backup. It scares me that if the backup process takes hours, and a single mistake while trying to fix the backup forces me to re-do it from scratch... it's going to be a lengthy process!

    As for the damaged partitions... GParted shows that sda8 has data, too - about 7GB, or about 25%.
    sda11 shows 31% used.
    The only one that is really unrecognized is sda7, which also has a red circle with a ! next to it.

    Cristian

  8. #38
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Partition table messed up - hundreds of "ghost" partitions

    Quote Originally Posted by Quaxo76 View Post
    OK, thanks, I'm going to buy the new disk now, then make the backup. It scares me that if the backup process takes hours, and a single mistake while trying to fix the backup forces me to re-do it from scratch... it's going to be a lengthy process!

    As for the damaged partitions... GParted shows that sda8 has data, too - about 7GB, or about 25%.
    sda11 shows 31% used.
    The only one that is really unrecognized is sda7, which also has a red circle with a ! next to it.

    Cristian
    GParted working - good.

    Please post sudo fdisk -lu when you have the new drive connected up and I'll tell you the correct cloning instruction.

    Please also post the dumpe2fs outputs.

    Don't do anything else.

    The only one that is really unrecognized is sda7, which also has a red circle with a ! next to it.
    I think if you right-click the red circle it should give you information.
    Last edited by YesWeCan; September 26th, 2011 at 03:53 PM.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  9. #39
    Join Date
    Jul 2007
    Beans
    142

    Re: Partition table messed up - hundreds of "ghost" partitions

    I'm back... The clone is done (I didn't wait for instructions because cloning is one thing I can do having done it several times in the past).

    Output from fdisk -lu:
    Code:
    ubuntu@ubuntu:~$ sudo fdisk -lu
    
    Disk /dev/sda: 500.1 GB, 500107862016 bytes
    255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x9bca9bca
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048    91411824    45704888+   7  HPFS/NTFS/exFAT
    /dev/sda2        94928024   129092767    17082372   83  Linux
    /dev/sda3       129437696   190996479    30779392   83  Linux
    /dev/sda4       190996846   976773119   392888137    f  W95 Ext'd (LBA)
    Partition 4 does not start on physical sector boundary.
    /dev/sda5       190996848   194900559     1951856   82  Linux swap / Solaris
    /dev/sda6       194900643   276816010    40957684   83  Linux
    Partition 6 does not start on physical sector boundary.
    /dev/sda7       276816078   308142757    15663340   83  Linux
    Partition 7 does not start on physical sector boundary.
    /dev/sda8       308142828   369607451    30732312   83  Linux
    Partition 8 does not start on physical sector boundary.
    /dev/sda9       369607518   459282277    44837380   83  Linux
    Partition 9 does not start on physical sector boundary.
    /dev/sda10      459282348   542049163    41383408   83  Linux
    Partition 10 does not start on physical sector boundary.
    /dev/sda11      542049165   748982428   103466632   83  Linux
    Partition 11 does not start on physical sector boundary.
    /dev/sda12      947476480   976773119    14648320   83  Linux
    
    Disk /dev/sdb: 640.1 GB, 640135028736 bytes
    255 heads, 63 sectors/track, 77825 cylinders, total 1250263728 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: 0x9bca9bca
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *        2048    91411824    45704888+   7  HPFS/NTFS/exFAT
    /dev/sdb2        94928024   129092767    17082372   83  Linux
    /dev/sdb3       129437696   190996479    30779392   83  Linux
    /dev/sdb4       190996846   976773119   392888137    f  W95 Ext'd (LBA)
    /dev/sdb5       190996848   194900559     1951856   82  Linux swap / Solaris
    /dev/sdb6       194900643   276816010    40957684   83  Linux
    /dev/sdb7       276816078   308142757    15663340   83  Linux
    /dev/sdb8       308142828   369607451    30732312   83  Linux
    /dev/sdb9       369607518   459282277    44837380   83  Linux
    /dev/sdb10      459282348   542049163    41383408   83  Linux
    /dev/sdb11      542049165   748982428   103466632   83  Linux
    /dev/sdb12      947476480   976773119    14648320   83  Linux
    
    Disk /dev/sdc: 16.1 GB, 16053960192 bytes
    16 heads, 32 sectors/track, 61240 cylinders, total 31355391 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: 0x00000000
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdc1   *          32    31355390    15677679+   b  W95 FAT32
    Other commands:

    Code:
    ubuntu@ubuntu:~$ sudo dumpe2fs -h /dev/sda7
    dumpe2fs 1.41.14 (22-Dec-2010)
    Filesystem volume name:   VecchioRoot
    Last mounted on:          <not available>
    Filesystem UUID:          fdc98e9a-0d4d-41fe-bc2d-436e1a4fd9e6
    Filesystem magic number:  0xEF53
    Filesystem revision #:    1 (dynamic)
    Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
    Filesystem flags:         signed_directory_hash 
    Default mount options:    (none)
    Filesystem state:         clean
    Errors behavior:          Continue
    Filesystem OS type:       Linux
    Inode count:              981120
    Block count:              3915835
    Reserved block count:     195791
    Free blocks:              2353243
    Free inodes:              752794
    First block:              0
    Block size:               4096
    Fragment size:            4096
    Reserved GDT blocks:      894
    Blocks per group:         32768
    Fragments per group:      32768
    Inodes per group:         8176
    Inode blocks per group:   511
    Filesystem created:       Sun Apr 26 20:51:08 2009
    Last mount time:          Mon May  3 13:57:05 2010
    Last write time:          Mon May  3 13:57:24 2010
    Mount count:              2
    Maximum mount count:      21
    Last checked:             Sun May  2 20:04:02 2010
    Check interval:           15552000 (6 months)
    Next check after:         Fri Oct 29 20:04:02 2010
    Reserved blocks uid:      0 (user root)
    Reserved blocks gid:      0 (group root)
    First inode:              11
    Inode size:	          256
    Required extra isize:     28
    Desired extra isize:      28
    Journal inode:            8
    Default directory hash:   half_md4
    Directory Hash Seed:      e89e7d46-c15f-4d47-81e6-8dcbf7a182b0
    Journal backup:           inode blocks
    Journal superblock magic number invalid!
    and

    Code:
    ubuntu@ubuntu:~$ sudo dumpe2fs -h /dev/sda8
    dumpe2fs 1.41.14 (22-Dec-2010)
    Filesystem volume name:   Home
    Last mounted on:          <not available>
    Filesystem UUID:          ab9b0a2b-0c46-4f86-a5cb-448ec40a74ba
    Filesystem magic number:  0xEF53
    Filesystem revision #:    1 (dynamic)
    Filesystem features:      ext_attr resize_inode dir_index filetype extent sparse_super large_file
    Filesystem flags:         signed_directory_hash 
    Default mount options:    (none)
    Filesystem state:         not clean with errors
    Errors behavior:          Continue
    Filesystem OS type:       Linux
    Inode count:              1913840
    Block count:              7683078
    Reserved block count:     384152
    Free blocks:              5795503
    Free inodes:              1893293
    First block:              0
    Block size:               4096
    Fragment size:            4096
    Reserved GDT blocks:      1022
    Blocks per group:         32768
    Fragments per group:      32768
    Inodes per group:         8144
    Inode blocks per group:   509
    Filesystem created:       Thu Oct 29 18:35:54 2009
    Last mount time:          Mon Oct 11 18:10:11 2010
    Last write time:          Sun Sep 25 09:45:06 2011
    Mount count:              12
    Maximum mount count:      20
    Last checked:             Sat Oct  2 09:48:17 2010
    Check interval:           15552000 (6 months)
    Next check after:         Thu Mar 31 09:48:17 2011
    Reserved blocks uid:      0 (user root)
    Reserved blocks gid:      0 (group root)
    First inode:              11
    Inode size:	          256
    Required extra isize:     28
    Desired extra isize:      28
    Default directory hash:   half_md4
    Directory Hash Seed:      82b2aeac-97c9-4433-a790-1b19ec777ce6
    Journal backup:           inode blocks
    
    ubuntu@ubuntu:~$
    And for sda11, which is very important too:

    Code:
    ubuntu@ubuntu:~$ sudo dumpe2fs -h /dev/sda11
    dumpe2fs 1.41.14 (22-Dec-2010)
    Filesystem volume name:   Appoggio
    Last mounted on:          /Appoggio
    Filesystem UUID:          520e87f0-76c4-48ab-a2b3-9dd6594b7bc3
    Filesystem magic number:  0xEF53
    Filesystem revision #:    1 (dynamic)
    Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
    Filesystem flags:         signed_directory_hash 
    Default mount options:    (none)
    Filesystem state:         clean with errors
    Errors behavior:          Continue
    Filesystem OS type:       Linux
    Inode count:              6471680
    Block count:              25866658
    Reserved block count:     1293332
    Free blocks:              17872022
    Free inodes:              6442273
    First block:              0
    Block size:               4096
    Fragment size:            4096
    Reserved GDT blocks:      1017
    Blocks per group:         32768
    Fragments per group:      32768
    Inodes per group:         8192
    Inode blocks per group:   512
    RAID stride:              1
    Flex block group size:    16
    Filesystem created:       Sat May 15 12:13:48 2010
    Last mount time:          Sun Sep 25 21:51:36 2011
    Last write time:          Sun Sep 25 21:52:54 2011
    Mount count:              9
    Maximum mount count:      22
    Last checked:             Sat May 15 12:13:48 2010
    Check interval:           15552000 (6 months)
    Next check after:         Thu Nov 11 12:13:48 2010
    Lifetime writes:          31 GB
    Reserved blocks uid:      0 (user root)
    Reserved blocks gid:      0 (group root)
    First inode:              11
    Inode size:	          256
    Required extra isize:     28
    Desired extra isize:      28
    Journal inode:            8
    Default directory hash:   half_md4
    Directory Hash Seed:      80fcc56d-6347-45a2-92a7-cbb5b4a03d69
    Journal backup:           inode blocks
    FS Error count:           68
    First error time:         Sat Sep 24 20:57:48 2011
    First error function:     htree_dirblock_to_tree
    First error line #:       586
    First error inode #:      2
    First error block #:      9249
    Last error time:          Sun Sep 25 21:52:48 2011
    Last error function:      htree_dirblock_to_tree
    Last error line #:        587
    Last error inode #:       2
    Last error block #:       9249
    Journal features:         (none)
    Journal size:             128M
    Journal length:           32768
    Journal sequence:         0x00000346
    Journal start:            0
    
    ubuntu@ubuntu:~$
    Whew... It took 5 hours to make the clone, I hope I don't have to do it many times!
    By the way... the transfer (over USB) was 31MB/s, much faster than the 6-10 MB/s I get when transfering regular files... Is the OS overhead really that much during normal writes?!?

    Cristian

  10. #40
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Partition table messed up - hundreds of "ghost" partitions

    Quote Originally Posted by Quaxo76 View Post
    I'm back... The clone is done (I didn't wait for instructions because cloning is one thing I can do having done it several times in the past).
    Good stuff. That's a long time - USB is slow. As you may know the cloned partitions will have identical UUIDs to the original so booting will malfunction if you try to boot one with the other still connected.

    Whew... It took 5 hours to make the clone, I hope I don't have to do it many times!
    By the way... the transfer (over USB) was 31MB/s, much faster than the 6-10 MB/s I get when transfering regular files... Is the OS overhead really that much during normal writes?!?
    Something is causing overheads - it will depend on file sizes and how fragmented they are on the source disk. dd is simpler as it just does a byte by byte copy and so there is no fs overhead.


    So all partitions have valid superblocks. sda7 is missing a journal - was it ext3?

    Try a fs check on each:
    sudo e2fsck -f /dev/sdaX

    Don't let it make any changes at this stage, just see what it reports.
    Last edited by YesWeCan; September 26th, 2011 at 09:32 PM.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

Page 4 of 6 FirstFirst ... 23456 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •