Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 59

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

  1. #21
    Join Date
    Jul 2007
    Beans
    140

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

    The new sda3 that appeared from nowhere, and that has the same size as sda8, might be an old home partition. I usually keep two "root" partitions and two "home" partitions, of the same size, so that when I install a new Ubuntu, I can leave the old one alone, to "fall back" to if something goes wrong. Then at the next cycle, I wipe the oldest one and start again. So, sda3 might be legit.

    Cristian

  2. #22
    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
    Code:
    cristian@cristian-laptop:~$ sudo mount /dev/sda2 /mnt
    
    
    
    cristian@cristian-laptop:~$ cat /mnt/etc/fstab
    
    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc                                       /proc        proc  nodev,noexec,nosuid  0  0  
    # / was on /dev/sdb2 during installation
    UUID=67c95e1b-d39b-42af-972c-777ad1df53f1  /            ext4  errors=remount-ro    0  1  
    # /home was on /dev/sdb13 during installation
    UUID=cdd507e5-77ce-4acf-8373-097a1bb74eee  /home        ext4  defaults             0  2  
    # swap was on /dev/sdb5 during installation
    UUID=cb5c309c-6a23-458e-bf41-229127bc260e  none         swap  sw                   0  0  
    /dev/sda7                                  /VirtualBoxVDI  ext3  defaults             0  0 
    /dev/sda12				/Dati	ext4	defaults	0	0
    /dev/sda10				/XPlane	ext3	defaults	0	0
    /dev/sda6				/Musica	ext3	defaults	0	0
    
    
    
    cristian@cristian-laptop:~$ sudo umount /mnt
    
    
    
    cristian@cristian-laptop:~$ sudo blkid
    
    /dev/sda1: UUID="1BC30EAA31150B1E" TYPE="ntfs" 
    /dev/sda2: UUID="67c95e1b-d39b-42af-972c-777ad1df53f1" TYPE="ext4" 
    /dev/sda3: UUID="9d3d9054-1332-45af-b3d8-5fa4669f35f9" TYPE="ext4" 
    /dev/sda5: UUID="cb5c309c-6a23-458e-bf41-229127bc260e" TYPE="swap" 
    /dev/sda6: UUID="5f8a414f-37d8-4b4a-a3ac-186d3de737c1" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda7: LABEL="VecchioRoot" UUID="fdc98e9a-0d4d-41fe-bc2d-436e1a4fd9e6" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda8: LABEL="Home" UUID="ab9b0a2b-0c46-4f86-a5cb-448ec40a74ba" TYPE="ext4" 
    /dev/sda9: LABEL="VirtualBoxVDI" UUID="05e65efa-3dc8-4207-a5f8-3f6a79be5cb9" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda10: LABEL="Musica" UUID="ebe89e5f-2777-48ac-ab36-c3a8e8462153" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda11: LABEL="Appoggio" UUID="520e87f0-76c4-48ab-a2b3-9dd6594b7bc3" TYPE="ext4" 
    /dev/sda12: UUID="729d163f-7515-428b-9eec-fe9ff65d7a61" TYPE="ext4" 
    
    cristian@cristian-laptop:~$
    I should add that (as I posted on another thread) when I try to access the disc with Gparted, it says "unallocated" - as if it was unpartitioned. Accessing it with Disk Utility does show the partitions.
    I read somewhere that this can happen when there is an overlap, or when a partition exceeds the disk's boundaries.

    Is it possible that all those start/end points were changed by testdisk because they weren't aligned with cylinder boundaries?

    Cristian
    The fact that GParted is showing "unallocated" is not good. Does it show a red circle with a ! that you can right click to see the information - what is it?

    You'll need to edit fstab. The UUID for /home is no longer valid and should be replaced with the one from blkid. The /dev/sd7/12/10/6 entries should be replaced with UUID entries, again using the UUIDs from blkid.
    sudo mount /dev/sda2 /mnt
    sudo gedit /mnt/etc/fstab
    sudo umount /mnt

    Please post the new version for double-checking.

    The thing I am concerned about is that you could not mount /home without that "Stale NFS file handle" error. I don't know what that means. If it were me, as a precaution, I'd back up sda7 & sda8 and then run a file system check before trying to boot the main Ubuntu. Have you got a spare drive?
    file system check:
    sudo e2fsck /dev/sda8
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  3. #23
    Join Date
    Jul 2007
    Beans
    140

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

    Quote Originally Posted by YesWeCan View Post
    The fact that GParted is showing "unallocated" is not good. Does it show a red circle with a ! that you can right click to see the information - what is it?
    It's not a red circle, but a yellow triangle; anyway, it says "Warning: Can't have a partition outside the disk!"

    Now I'll try fixing fstab as you said...

    Cristian

  4. #24
    Join Date
    Jul 2007
    Beans
    140

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

    This is the output of blkid:
    Code:
    cristian@cristian-laptop:~$ blkid
    /dev/sda1: UUID="1BC30EAA31150B1E" TYPE="ntfs" 
    /dev/sda2: UUID="67c95e1b-d39b-42af-972c-777ad1df53f1" TYPE="ext4" 
    /dev/sda3: UUID="9d3d9054-1332-45af-b3d8-5fa4669f35f9" TYPE="ext4" 
    /dev/sda5: UUID="cb5c309c-6a23-458e-bf41-229127bc260e" TYPE="swap" 
    /dev/sda6: UUID="5f8a414f-37d8-4b4a-a3ac-186d3de737c1" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda7: LABEL="VecchioRoot" UUID="fdc98e9a-0d4d-41fe-bc2d-436e1a4fd9e6" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda8: LABEL="Home" UUID="ab9b0a2b-0c46-4f86-a5cb-448ec40a74ba" TYPE="ext4" 
    /dev/sda9: LABEL="VirtualBoxVDI" UUID="05e65efa-3dc8-4207-a5f8-3f6a79be5cb9" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda10: LABEL="Musica" UUID="ebe89e5f-2777-48ac-ab36-c3a8e8462153" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda11: LABEL="Appoggio" UUID="520e87f0-76c4-48ab-a2b3-9dd6594b7bc3" TYPE="ext4" 
    /dev/sda12: UUID="729d163f-7515-428b-9eec-fe9ff65d7a61" TYPE="ext4"
    And this is the fstab I edited:
    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc                                       /proc        proc  nodev,noexec,nosuid  0  0  
    # / was on /dev/sdb2 during installation
    UUID=67c95e1b-d39b-42af-972c-777ad1df53f1  /            ext4  errors=remount-ro    0  1  
    # /home was on /dev/sdb13 during installation
    UUID=ab9b0a2b-0c46-4f86-a5cb-448ec40a74ba  /home        ext4  defaults             0  2  
    # swap was on /dev/sdb5 during installation
    UUID=cb5c309c-6a23-458e-bf41-229127bc260e  none         swap  sw                   0  0  
    UUID=05e65efa-3dc8-4207-a5f8-3f6a79be5cb9  /VirtualBoxVDI  ext3  defaults             0  0 
    /dev/sda12				/Dati	ext4	defaults	0	0
    UUID=5f8a414f-37d8-4b4a-a3ac-186d3de737c1	/XPlane	ext3	defaults	0	0
    UUID=ebe89e5f-2777-48ac-ab36-c3a8e8462153      /Musica	ext3	defaults	0	0
    As for the old /dev/sda12, called "Dati" in the old fstab, I don't know what to do, as I can't find it in blkid... I suppose it might be what now is sda7, but I seem to recall that it was quite larger than that...

    Cristian

  5. #25
    Join Date
    Jul 2007
    Beans
    140

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

    I was wondering, if tomorrow I buy a large external drive, and start backing up the data in known good partitions, and then delete those partitions, making the disk structure progressively emptier and simpler... would that help in recovering the lost ones?

    Or even install a new system on the new disk, use the old one as external, and then proceed to move the data to the new disk? Would you say there are chances of saving the data that was in my /home and /Dati partitions?

    Cristian

  6. #26
    Join Date
    Oct 2009
    Beans
    2,199
    Distro
    Ubuntu 10.10 Maverick Meerkat

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

    Sorry, I have to rush out for an hour or two. Back later.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  7. #27
    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
    It's not a red circle, but a yellow triangle; anyway, it says "Warning: Can't have a partition outside the disk!"
    Yes, testdisk has cocked-up the extended partition end sector address. It is now 976784129 but the maximum is 976773167. The extended partition should finish at the last sector of sda12 which is 976773119.

    To fix that you need to copy the partition table to a file and then edit the sda4 "size" value from 785787345 to 785776335. Then write it back to the MBR.
    sudo sfdisk -d /dev/sda > pt.txt
    sudo cp pt.txt ptbackup.txt
    sudo gedit pt.txt

    (and change the sda4 size entry)
    sudo sh -c "cat pt.txt | sfdisk /dev/sda"
    It is possible sfdisk will complain, post the error if so.
    Once done GParted should show all the partitions.
    Last edited by YesWeCan; September 25th, 2011 at 06:26 PM.
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  8. #28
    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
    This is the output of blkid:
    Code:
    cristian@cristian-laptop:~$ blkid
    /dev/sda1: UUID="1BC30EAA31150B1E" TYPE="ntfs" 
    /dev/sda2: UUID="67c95e1b-d39b-42af-972c-777ad1df53f1" TYPE="ext4" 
    /dev/sda3: UUID="9d3d9054-1332-45af-b3d8-5fa4669f35f9" TYPE="ext4" 
    /dev/sda5: UUID="cb5c309c-6a23-458e-bf41-229127bc260e" TYPE="swap" 
    /dev/sda6: UUID="5f8a414f-37d8-4b4a-a3ac-186d3de737c1" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda7: LABEL="VecchioRoot" UUID="fdc98e9a-0d4d-41fe-bc2d-436e1a4fd9e6" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda8: LABEL="Home" UUID="ab9b0a2b-0c46-4f86-a5cb-448ec40a74ba" TYPE="ext4" 
    /dev/sda9: LABEL="VirtualBoxVDI" UUID="05e65efa-3dc8-4207-a5f8-3f6a79be5cb9" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda10: LABEL="Musica" UUID="ebe89e5f-2777-48ac-ab36-c3a8e8462153" SEC_TYPE="ext2" TYPE="ext3" 
    /dev/sda11: LABEL="Appoggio" UUID="520e87f0-76c4-48ab-a2b3-9dd6594b7bc3" TYPE="ext4" 
    /dev/sda12: UUID="729d163f-7515-428b-9eec-fe9ff65d7a61" TYPE="ext4"
    And this is the fstab I edited:
    Code:
    # /etc/fstab: static file system information.
    #
    # Use 'blkid -o value -s UUID' to print the universally unique identifier
    # for a device; this may be used with UUID= as a more robust way to name
    # devices that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    proc                                       /proc        proc  nodev,noexec,nosuid  0  0  
    # / was on /dev/sdb2 during installation
    UUID=67c95e1b-d39b-42af-972c-777ad1df53f1  /            ext4  errors=remount-ro    0  1  
    # /home was on /dev/sdb13 during installation
    UUID=ab9b0a2b-0c46-4f86-a5cb-448ec40a74ba  /home        ext4  defaults             0  2  
    # swap was on /dev/sdb5 during installation
    UUID=cb5c309c-6a23-458e-bf41-229127bc260e  none         swap  sw                   0  0  
    UUID=05e65efa-3dc8-4207-a5f8-3f6a79be5cb9  /VirtualBoxVDI  ext3  defaults             0  0 
    /dev/sda12				/Dati	ext4	defaults	0	0
    UUID=5f8a414f-37d8-4b4a-a3ac-186d3de737c1	/XPlane	ext3	defaults	0	0
    UUID=ebe89e5f-2777-48ac-ab36-c3a8e8462153      /Musica	ext3	defaults	0	0
    As for the old /dev/sda12, called "Dati" in the old fstab, I don't know what to do, as I can't find it in blkid... I suppose it might be what now is sda7, but I seem to recall that it was quite larger than that...

    Cristian
    Maybe best to comment it out for now: #/dev/sda12
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

  9. #29
    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 was wondering, if tomorrow I buy a large external drive, and start backing up the data in known good partitions, and then delete those partitions, making the disk structure progressively emptier and simpler... would that help in recovering the lost ones?

    Or even install a new system on the new disk, use the old one as external, and then proceed to move the data to the new disk? Would you say there are chances of saving the data that was in my /home and /Dati partitions?

    Cristian
    Removing existing partitions doesn't help. So I would be inclined to clone the whole thing to the new disk. Then one can experiment on the original knowing one can always restore the original state.

    I don't know what testdisk can do. It concerns me that the start sectors of sda 7 & sda8 have changed because, to this this properly, the whole filesystem inside the partitions need to be moved too. When you do this with GParted, for example, it can take a very long time. I don't know whether the partitions were moved properly or just the start and end sectors were changed.

    There are various ways to figure it out but I am feeling a little cautious at this stage about doing anything that might write to those partitions before they are backed up.

    When I try to mount sda7, I get this: mount: wrong fs type, bad option, bad superblock on /dev/sda7, missing codepage or helper program, or other error
    This is a serious error. This could be caused by the start sector being wrong.

    When I try to mount the /home partition (sda8 ), I get an error saying "Stale NFS file handle".
    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?
    ASRock P67 Extreme6, Intel i5 2500K, 8GB RAM, nVidia 6600GT, 4x1TB RAID1+0

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

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

    First, I recommend doing a low-level backup before you do anything else:


    1. Get another hard disk that's at least as large as the one you've got now, plug it in, and boot to an emergency system
    2. Verify that your current disk is /dev/sda when you reboot and that the new disk is /dev/sdb. (You can use fdisk to check the partition tables to verify disks' identities.) If these values have changed, it's OK, but you must adjust your procedures appropriately.
    3. Type "sudo dd if=/dev/sda of=/dev/sdb". This will back up /dev/sda to /dev/sdb. Thus, it's imperative that you get the device filenames right, or you'll wipe out all your data! Take your hands off the keyboard and triple-check the values before you hit the Enter key! This command is likely to take hours to complete, since it copies everything on the hard disk (even empty space).



    With this low-level backup in place, you'll be protected against further damage.

    Editing the partition table using sfdisk as YesWeCan suggests can work; however, /dev/sda3 isn't the only problem partition. /dev/sda7 and /dev/sda8 are messed up, too, so they need to be changed, as well. You can try making these changes all at once or one at a time. Personally, I think I'd try all at once, out of concern that attempts to mount and access the filesystems during intervening steps might end up damaging them while they're in an improper state. OTOH, doing them one at a time reduces the number of variables in any one change, which can minimize the risk of confusion.

    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. Specifically, the earlier backup should have correct entries for /dev/sda3, /dev/sda7, and /dev/sda8. A current "sfdisk -d" output will have correct entries for /dev/sda11 and /dev/sda12. Thus, you can start from the current partition table's backup file and replace its entries for /dev/sda3, /dev/sda7, and /dev/sda8 from the earlier one to create a 100% correct partition table file. You could then input this new file with "sfdisk -f /dev/sda < correct-parts.txt" (assuming you store the edited file as "correct-parts.txt").
    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.

Page 3 of 6 FirstFirst 12345 ... 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
  •