Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Ubuntu This forum is for the discussion of Ubuntu Linux.


  Search this Thread
Old 02-28-2011, 10:04 PM   #1
LQ Newbie
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
sudo parted /dev/sda print Error: Can't have a partition outside the disk!

Hello, I have seen various other post similar to mine but nothing I have tried has fixed the problem.

My back up drive crashed and I managed to save most of everything on it (my only copies of my children's pictures since they were born are the most important) on my primary drive, but it completely filled my Home partition. I booted from the live cd and moved the partitions around and when I was done I was resizing my saved data partition so that I would have more space till I got another backup drive. in the middle of resizing it my two year old bumped the flash drive and it shut down with 11 min left. When I rebooted in the live cd (which I am using right now) it showed all m partitions as fine except /dev/sda4. So I used test disk to fix it, now gparted won't recognize my drive at all. Disk utility reads the partitions but it made /dev/sda4 into an extended partition with my data on one partition and free space in the other. and then it up some extra partition at the end. I can read my data from the live cd but I don't have any means by which to transfer it somewhere else. I need help fixing it, Please anyone that can help!

Gparted reads the entire drive as unallocated and gives a warning that you can't have a partition outside of the disk.

sudo parted /dev/sda4
Error: Can't have a partition outside the disk!

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 / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 209717247 104857600 c W95 FAT32 (LBA)
/dev/sda2 209717248 293603327 41943040 83 Linux
/dev/sda3 293603328 306186223 6291448 82 Linux swap / Solaris
/dev/sda4 306198900 976784129 335292615 f W95 Ext'd (LBA)
/dev/sda5 527826944 976773119 224473088 83 Linux

Any more info needed let me know.
Old 02-28-2011, 10:42 PM   #2
LQ Newbie
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0

sudo sfdisk -d /dev/sda > parts.txt

edit parts.txt to what it should be

sudo sfdisk --force /dev/sda < parts.txt


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: /dev/sda: unrecognised disk label. >>Want to rescue data, but cannot mount it. hector3rd Linux - Hardware 6 08-20-2010 02:26 PM
Accessing the hard disk using the /dev/sda interface aneeshcav Linux - Newbie 7 03-30-2010 03:49 AM
clone hard disk with: cat /dev/sda >/media/disk/backup deathalele Linux - Security 3 04-17-2009 01:29 AM
boot disk no longer /dev/sda when adding ext. disks rspielma Linux - Hardware 5 12-26-2007 07:21 PM
[SOLVED] system disk moves from /dev/sda to /dev/sdm gdevaucorbeil Linux - Hardware 4 03-10-2007 10:30 AM > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 11:11 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration