Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: Error! Partition outsite disk

  1. #1
    Join Date
    Aug 2008
    Beans
    6

    [Solved]Error! Partition outsite disk

    Hi,
    I have a problem when I try booting GParted from a live cd or running it in Ubuntu I get this error:
    Code:
    ======================
    libparted : 1.8.9
    ======================
    Can't have a partition outside the disk!
    GParted then opens but declares my hd as 300gb of unallocated space. I believe this is because I have corrupted the partition table.

    fdisk from within ubuntu
    Code:
    sudo fdisk -l
    returns this:
    Code:
    Disk /dev/sda: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0009b837
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1        2432    19535008   83  Linux
    /dev/sda2            2433       10718    66557292   83  Linux
    /dev/sda3   *       10719       13315    20860396+   7  HPFS/NTFS
    /dev/sda4           13316       38914   205623967+   f  W95 Ext'd (LBA)
    /dev/sda5           13316       15865    20480000    7  HPFS/NTFS
    /dev/sda6           15866       28613   102398278+   7  HPFS/NTFS
    /dev/sda7           28614       38403    78638143+   7  HPFS/NTFS
    Briefly:
    sda1 is an Ubuntu installation
    sda2 is my /home
    sda3 is a windows xp installation
    sda5 is a Windows 7 beta installation (I was curious - I think it was the built-in partition editor that caused this problem =S)
    sda6 and sda7 contain media and work documents
    *sda8 was a 4gb logical swap partition but I deleted it as it was ending outside the 38913 cylinders. (I thought I might be able to resize sda4 after removing it then recreate the swap partition).

    All the OS installations boot (with GRUB) and run fine. The only thing that is concerning is that GParted wont read my hard disk. After a few hours of Googling i am pretty sure the problem is to do with my disk having 38913 cylinders and the extended partition (sda4) ending on 38914. Is there a way I can correct the boundaries of sda4 without losing any data from the logical partitions within it? Or is this even a serious issue? It would be nice to get a swap partition again in any case =P

    I found this post in ubuntu forums: (excuse the google cache, the forums have been down all day).

    http://ubuntuforums.org/archive/index.php/t-352723.html

    The above post seems to be about a similar problem. User houseam suggests deleting the extended partition with fdisk then creating a new one within the cylinder boundaries. I am unsure whether it is safe to do this however as I am not too keen on unnecessarily losing the logical partitions.

    If anyone can offer me some advice it would be greatly appreciated.
    Thanks,
    Tom
    Last edited by thegreat; January 15th, 2009 at 12:51 AM. Reason: Solved

  2. #2
    Join Date
    Aug 2007
    Location
    PA
    Beans
    363
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Error! Partition outsite disk

    First advice, ALWAYS WORK IN POWERS OF 4. hard drives like 4.
    Now, personally i think the way to go, would be to back everything up, and delte a few and move em around.

    id look into the id's of the 4 part's being 7, and the other f. looks, weird...
    Linux.

  3. #3
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Error! Partition outsite disk

    Quote Originally Posted by thegreat View Post

    Code:
    Disk /dev/sda: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0009b837
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1        2432    19535008   83  Linux
    /dev/sda2            2433       10718    66557292   83  Linux
    /dev/sda3   *       10719       13315    20860396+   7  HPFS/NTFS
    /dev/sda4           13316       38914   205623967+   f  W95 Ext'd (LBA)
    /dev/sda5           13316       15865    20480000    7  HPFS/NTFS
    /dev/sda6           15866       28613   102398278+   7  HPFS/NTFS
    /dev/sda7           28614       38403    78638143+   7  HPFS/NTFS
    It looks like you're right, the extended partition ending point exceeds the maximum number of cylinders of your drive (38914 > 38913), and that's why gparted is complaining. If that's the only problem with your partition table, it should be easy to correct, so how about posting:
    Code:
    sudo fdisk -lu
    sudo sfdisk -d
    And we can work from there if you want.

  4. #4
    Join Date
    Aug 2008
    Beans
    6

    Re: Error! Partition outsite disk

    Thanks for the quick response guys.

    Here are the results:
    sudo fdisk -lu
    Code:
    Disk /dev/sda: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0x0009b837
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1              63    39070078    19535008   83  Linux
    /dev/sda2        39070080   172184663    66557292   83  Linux
    /dev/sda3   *   172184670   213905462    20860396+   7  HPFS/NTFS
    /dev/sda4       213905475   625153409   205623967+   f  W95 Ext'd (LBA)
    /dev/sda5       213907456   254867455    20480000    7  HPFS/NTFS
    /dev/sda6       254871288   459667844   102398278+   7  HPFS/NTFS
    /dev/sda7       459667908   616944194    78638143+   7  HPFS/NTFS
    sudo sfdisk -d
    Code:
    # partition table of /dev/sda
    unit: sectors
    
    /dev/sda1 : start=       63, size= 39070016, Id=83
    /dev/sda2 : start= 39070080, size=133114584, Id=83
    /dev/sda3 : start=172184670, size= 41720793, Id= 7, bootable
    /dev/sda4 : start=213905475, size=411247935, Id= f
    /dev/sda5 : start=213907456, size= 40960000, Id= 7
    /dev/sda6 : start=254871288, size=204796557, Id= 7
    /dev/sda7 : start=459667908, size=157276287, Id= 7
    Cheers

  5. #5
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Error! Partition outsite disk

    OK, so it looks like the only problem with your partition table is that the sda4 extended partition ends at a point past the end of the drive, because it ends on sector 625153409 while the HDD only has 625142448 sectors. Fortunately correcting that type of problem is usually easy, so how about doing the following:
    Code:
    echo "213905475,411236974,f" | sudo sfdisk -f -uS /dev/sda -N4 -O sda_sectors_modified.save
    Please post the output of the above command. Also, the above command will create a small "sda_sectors_modified.save" file to your desktop; please save that file to another drive or some place like your email account, just not on the same drive as sda. If for any reason something were to go wrong with the sfdisk command above, all you need is the "sda_sectors_modified.save" file in order to restore your HDD/partition table back to its original state, so that is your insurance against any possible problems. Next reboot, and once you get back into Ubuntu, please post the new output of:
    Code:
    sudo fdisk -lu
    sudo sfdisk -d
    sudo parted /dev/sda print
    And we can work from there.
    Last edited by caljohnsmith; January 14th, 2009 at 06:20 PM.

  6. #6
    Join Date
    Aug 2008
    Beans
    6

    Re: Error! Partition outsite disk

    Ok, that spits this out:
    Code:
    tom@labuntu:~$ echo "213905475,411236974,f" | sudo sfdisk -f -uS /dev/sda -N4 -O sda_sectors_modified.save
    [sudo] password for tom: 
    Checking that no-one is using this disk right now ...
    BLKRRPART: Device or resource busy
    
    This disk is currently in use - repartitioning is probably a bad idea.
    Umount all file systems, and swapoff all swap partitions on this disk.
    Use the --no-reread flag to suppress this check.
    
    Disk /dev/sda: 38913 cylinders, 255 heads, 63 sectors/track
    Old situation:
    Units = sectors of 512 bytes, counting from 0
    
       Device Boot    Start       End   #sectors  Id  System
    /dev/sda1            63  39070078   39070016  83  Linux
    /dev/sda2      39070080 172184663  133114584  83  Linux
    /dev/sda3   * 172184670 213905462   41720793   7  HPFS/NTFS
    /dev/sda4     213905475 625142448  411236974   f  W95 Ext'd (LBA)
    /dev/sda5     213907456 254867455   40960000   7  HPFS/NTFS
    /dev/sda6     254871288 459667844  204796557   7  HPFS/NTFS
    /dev/sda7     459667908 616944194  157276287   7  HPFS/NTFS
    Warning: given size (411236974) exceeds max allowable size (411231870)
    New situation:
    Units = sectors of 512 bytes, counting from 0
    
       Device Boot    Start       End   #sectors  Id  System
    /dev/sda1            63  39070078   39070016  83  Linux
    /dev/sda2      39070080 172184663  133114584  83  Linux
    /dev/sda3   * 172184670 213905462   41720793   7  HPFS/NTFS
    /dev/sda4     213905475 625142448  411236974   f  W95 Ext'd (LBA)
    /dev/sda5     213907456 254867455   40960000   7  HPFS/NTFS
    /dev/sda6     254871288 459667844  204796557   7  HPFS/NTFS
    /dev/sda7     459667908 616944194  157276287   7  HPFS/NTFS
    Warning: partition 4 extends past end of disk
    Successfully wrote the new partition table
    
    Re-reading the partition table ...
    BLKRRPART: Device or resource busy
    The command to re-read the partition table failed
    Reboot your system now, before using mkfs
    
    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).)
    Should I boot a live disk (ubuntu/knoppix) and try this again?
    Thanks heaps for your help!

  7. #7
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Error! Partition outsite disk

    Quote Originally Posted by thegreat View Post
    Should I boot a live disk (ubuntu/knoppix) and try this again?
    Thanks heaps for your help!
    Your sda4 extended partition now ends on the last sector of the drive as planned, so I think you should be fine. How about rebooting and posting the output of the commands at the end of post #5, and we can work from there.
    Last edited by caljohnsmith; January 15th, 2009 at 12:07 AM.

  8. #8
    Join Date
    Aug 2008
    Beans
    6

    Re: Error! Partition outsite disk

    Sorry I jumped to conculsions about the errors, here is the output:
    sudo fdisk -lu
    Code:
    Disk /dev/sda: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0x0009b837
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1              63    39070078    19535008   83  Linux
    /dev/sda2        39070080   172184663    66557292   83  Linux
    /dev/sda3   *   172184670   213905462    20860396+   7  HPFS/NTFS
    /dev/sda4       213905475   625142448   205618487    f  W95 Ext'd (LBA)
    /dev/sda5       213907456   254867455    20480000    7  HPFS/NTFS
    /dev/sda6       254871288   459667844   102398278+   7  HPFS/NTFS
    /dev/sda7       459667908   616944194    78638143+   7  HPFS/NTFS
    sudo sfdisk -d
    Code:
    # partition table of /dev/sda
    unit: sectors
    
    /dev/sda1 : start=       63, size= 39070016, Id=83
    /dev/sda2 : start= 39070080, size=133114584, Id=83
    /dev/sda3 : start=172184670, size= 41720793, Id= 7, bootable
    /dev/sda4 : start=213905475, size=411236974, Id= f
    /dev/sda5 : start=213907456, size= 40960000, Id= 7
    /dev/sda6 : start=254871288, size=204796557, Id= 7
    /dev/sda7 : start=459667908, size=157276287, Id= 7
    sudo parted /dev/sda print
    Code:
    Error: Can't have a partition outside the disk!
    Cheers,
    Tom

  9. #9
    Join Date
    Mar 2008
    Location
    California, USA
    Beans
    8,111

    Re: Error! Partition outsite disk

    I didn't think that having the extended partition end on the last sector of the drive would cause any problems, but it looks like parted is still complaining about it. But that's OK, how about we just make sda4 end on a cylinder boundary before the end of the drive, and hopefully parted will be happy with that. How about doing:
    Code:
    echo "213905475,411231871,f" | sudo sfdisk -f -uS /dev/sda -N4 -O sda_sectors_modified.save
    And again reboot, post the output of the commands at the end of post #5 again, and we can work from there.
    Last edited by caljohnsmith; January 15th, 2009 at 06:32 AM.

  10. #10
    Join Date
    Aug 2008
    Beans
    6

    Re: Error! Partition outsite disk

    This looks better

    sudo fdisk -lu
    Code:
    Disk /dev/sda: 320.0 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0x0009b837
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1              63    39070078    19535008   83  Linux
    /dev/sda2        39070080   172184663    66557292   83  Linux
    /dev/sda3   *   172184670   213905462    20860396+   7  HPFS/NTFS
    /dev/sda4       213905475   625137345   205615935+   f  W95 Ext'd (LBA)
    /dev/sda5       213907456   254867455    20480000    7  HPFS/NTFS
    /dev/sda6       254871288   459667844   102398278+   7  HPFS/NTFS
    /dev/sda7       459667908   616944194    78638143+   7  HPFS/NTFS
    sudo sfdisk -d
    Code:
    # partition table of /dev/sda
    unit: sectors
    
    /dev/sda1 : start=       63, size= 39070016, Id=83
    /dev/sda2 : start= 39070080, size=133114584, Id=83
    /dev/sda3 : start=172184670, size= 41720793, Id= 7, bootable
    /dev/sda4 : start=213905475, size=411231871, Id= f
    /dev/sda5 : start=213907456, size= 40960000, Id= 7
    /dev/sda6 : start=254871288, size=204796557, Id= 7
    /dev/sda7 : start=459667908, size=157276287, Id= 7
    sudo parted /dev/sda print
    Code:
    Model: ATA ST9320320AS (scsi)
    Disk /dev/sda: 320GB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    
    Number  Start   End     Size    Type      File system  Flags
     1      32.3kB  20.0GB  20.0GB  primary   ext3              
     2      20.0GB  88.2GB  68.2GB  primary   ext3              
     3      88.2GB  110GB   21.4GB  primary   ntfs         boot 
     4      110GB   320GB   211GB   extended               lba  
     5      110GB   130GB   21.0GB  logical   ntfs              
     6      130GB   235GB   105GB   logical   ntfs              
     7      235GB   316GB   80.5GB  logical   ntfs
    Thanks!

Page 1 of 3 123 LastLast

Tags for this Thread

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
  •