LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-04-2008, 05:56 PM   #1
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Rep: Reputation: 49
Why won't testdisk let me label partition as extended?


I was trying to help a friend who was using testdisk to fix his corrupted partition table, and he claimed that testdisk wasn't letting him mark his extended partition as extended; his only options were primary, bootable, and deleted.

So I fired up testdisk on my own HDD (which is healthy), and after doing testdisk's deep search and showing all my partitions, I found out my friend was right; I could not mark my extended partition as an extended partition, and I even checked the start/stop points to make sure I had the correct partition.

On top of that, my friend's linux swap partition used to be in his extended partition, but testdisk would not give him the option to make it a logical partition (only primary, bootable, or deleted). So what are we missing here with testdisk? Why won't testdisk allow us to do these simple tasks? Thanks for any help.
 
Old 09-04-2008, 08:08 PM   #2
/usr/darien
Member
 
Registered: Mar 2008
Location: Virginia
Distribution: RHEL 4/5, Fedora 6-9, SuSE 10.1-11, Open Solaris 10.8, WinXP,2003,Vista
Posts: 59

Rep: Reputation: 15
In short, you can’t. An extended partition is pretty much a placeholder for additional logical partitions. Normally, you can only have four primary partitions; if you need more, you will have three primary partitions with an extended partition that holds the additional, required partitions.

You can only label partitions that have files systems associated with them. Since an extended partition does not have an associated file system, you cannot label it.

What you describe is actually normal behavior.
 
Old 09-05-2008, 09:51 AM   #3
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Original Poster
Rep: Reputation: 49
Thanks for the reply, Darien, that makes sense about extended partitions. But what about the fact that my friend couldn't make his swap partition a logical partition, when that is what it was before? Why wouldn't testdisk give him that option? I should mention that the logical swap partition followed directly after his main linux partition, which was also logical, so it wasn't like they were in separate places on the HDD and obviously wouldn't be able to be a part of one extended partition.

Any ideas why?
 
Old 09-05-2008, 10:07 AM   #4
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
If it was "inside" an extended partition, then it was already a logical partition. No need to create what's already there; just reformat it from the swap filesystem to the one you want.
 
Old 09-05-2008, 03:55 PM   #5
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by David the H. View Post
If it was "inside" an extended partition, then it was already a logical partition. No need to create what's already there; just reformat it from the swap filesystem to the one you want.
I think you might be misunderstanding me; as far as I know, while testdisk reports all the partitions it can find on the HDD after doing a deep scan, it is up to the user to figure which are valid and which are not. Also, the user has to decide whether the partition is primary, logical, or bootable (bootable just being primary + boot flag on). So I'm not trying to create what's all ready there, I just want to give it the correct label. And for some reason, testdisk would not allow my friend to label his logical swap partition as logical, only primary. That's what we don't understand at this point.
 
Old 09-05-2008, 06:22 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Testdisk can't find an extended from a scan because there's nothing to find - but it will find logical(s) and wrap an extended around it/them when it writes the partition table back (my recollection of how it worked).
If your friend can't find a logical, then there are other issues in play. Did he screw this up with PartitionMagic by any chance ???.
 
Old 09-05-2008, 08:59 PM   #7
CJS
Member
 
Registered: May 2008
Location: California, USA
Distribution: Ubuntu 8.10
Posts: 247

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by syg00 View Post
Testdisk can't find an extended from a scan because there's nothing to find - but it will find logical(s) and wrap an extended around it/them when it writes the partition table back (my recollection of how it worked).
If your friend can't find a logical, then there are other issues in play. Did he screw this up with PartitionMagic by any chance ???.
Actually my whole point was testdisk did find the logical partition, but testdisk just wouldn't let my friend label it as logical; his only choices were primary, bootable, and deleted. So when I say that testdisk "found" the partition, I mean it found a partition having the correct start/stop points as the logical partition in question, but it would not let him label it as logical.
 
Old 09-06-2008, 04:21 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
If it doesn't have the structure of a logical, it ain't a logical.
Hence the question in my previous post.
 
Old 05-11-2009, 12:21 AM   #9
zorkerz
LQ Newbie
 
Registered: May 2009
Posts: 3

Rep: Reputation: 0
hi there I just joined to respond to this thread. I realize its getting pretty old but I was wondering if anyone ever found a solution.

I am having a similar if not identical problem. Testisk will not allow one of my partitions to be marked as logical even though I'm sure it was originally. I have gone into much more detail here http://ubuntuforums.org/showthread.php?t=1155584

thanks for the input
 
Old 11-12-2009, 09:56 AM   #10
ganz
LQ Newbie
 
Registered: Jun 2007
Posts: 6

Rep: Reputation: 0
Tetsdisk

I've got this problem too. I actually used testdisk on a working system to see if testdisk worked before using on my 'real' system. I had two WinXP partitions, One Mandriva / partition, one swap partition and a mandriva home partition. Before I used testdisk it booted up into the grub menu (not lilo). When I ran testdisk I set the hda1 as bootable*, the second NTFS partition comes up as Deleted only. When I try to set this to anything else such as logical or primary it says its a 'bad structure'. Deleted seems to be the only thing that makes it an OK structure.

The linux root / partition I can set as primary, the swap can only be set as deleted and finally the home partition I set as logical. I write to testdisk and reboot and that's when I get.. grub error 22!

When I do a partition check using testdisk its says the root partition / is an extended partition. I've tried to use grub-install bit to no avail. The only thing I was thinking to do was to use a live CD and see if the partition editor in Mandriva can mount these partitions (hopefully the partitions will be on display).

Any ideas?

Ganz
 
Old 11-21-2010, 09:16 PM   #11
pulkittomar
LQ Newbie
 
Registered: Nov 2010
Posts: 5

Rep: Reputation: 0
Found one way to solve which resulted in to another problem

Hi,

This seems to be a very old thread but I wanted to answer the question for any other person like me, who may refer this thread(which is why I joined this forum).

I had 5 partitions
sda1: Dell utitility
sda2: WindowsVista(boot)
sda4: Another ntfs partition [Data]
sda3: Linux partition - Extended
sda5: Linux swap - Extended

Recently I reinstalled Vista and as a result my sda4 partition showed as unformatted partition/ ntfs error in both windows vista and ubuntu

In Testdisk, on running deeper search, Testdisk wouldn't allow me to flag the swap partition as extended. As such my first try:-
/** Erroneous Partition map*/
Flags Partition
P sda1
* sda2
P sda3
L sda4
L sda5
resulted in partitions sda4+sda5 showing as extended with all the names garbled, as in sda4 became sda6 and so on. I could boot ubuntu after reinstalling grub2 but Vista wouldn't boot.

I tried testdisk again with following flags
Flags Partition
P sda1
* sda2
L sda3
P sda4
L sda5

I installed grub2 again and now I can boot into both windows and Ubuntu. Also, my partitions in Disk utility looks nearly the same with linux and swap being extended/Logical.

However, the sda4 partition is still unformatted space and now my vista is showing me two new drives in My Computer
D:\ \** O bytes drive, on clicking I am prompted to format it*\
E:\ \** 80 MB drive with some files. Most probably Dell utility Files. This shouldn't have happened since I remember changing the type for Dell Utility partition to "de" (Fat16 or so) in Test disk*\

Last edited by pulkittomar; 11-23-2010 at 02:09 PM.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using testdisk to recover a partition Mark_in_Hollywood Linux - Newbie 6 04-18-2008 07:54 PM
Using testdisk to recover deleted lvm2 partition sstendal Linux - General 2 04-02-2008 09:30 AM
testdisk can't fix my partition table :( dmedhora Linux - General 7 11-28-2007 03:02 AM
[SOLVED] Safety: Primary Partition and Extended (Logical) Partition MBA Whore Linux - Security 11 01-03-2007 02:05 PM
testdisk stuff with adding a recovered reiserfs partition wini_g Linux - Software 2 11-07-2003 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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