LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2013, 04:59 AM   #1
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 157

Rep: Reputation: Disabled
convert logical into primary?


my partitions table is:
Quote:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0xe0d2e0d2

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 104855551 52324352 7 HPFS/NTFS/exFAT
/dev/sda3 309465088 312041471 1288192 82 Linux swap / Solaris
/dev/sda4 104857598 309463039 102302721 f W95 Ext'd (LBA)
/dev/sda5 165443584 198936575 16746496 83 Linux
/dev/sda6 198938624 204795903 2928640 82 Linux swap / Solaris
/dev/sda7 204797952 309463039 52332544 7 HPFS/NTFS/exFAT
/dev/sda8 104857600 158560255 26851328 83 Linux
/dev/sda9 158562304 165437439 3437568 82 Linux swap / Solaris
I want to convert /dev/sda7 into primary partition.
when I run "sudo sfdisk -d /dev/sda > sdapt.txt, I get sdapt.txt file in my Home and
this message below in the terminal:
Quote:
msh@dbndst-msh:~$ sudo sfdisk -d /dev/sda > sdapt.txt
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
msh@dbndst-msh:~$
what does it mean?
is it safe to proceed?
 
Old 07-06-2013, 05:44 AM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
What is your plan for converting sda7?

I would not have thought it was possible. Maybe you know some tool or method I haven't heard of. But if you know more about this topic than I do, I wouldn't expect you to be bothered by the minor detail of cylinder boundaries.

What do you plan to do to sda3, sda8 and sda9? sda3 would be easy to delete and recreate later as logical (after growing sda4 downward to include the space of sda3). That would allow patching the partition table so sda7 could take sda3's place as a primary partition. But if you were going that way, I can't see any way to preserve or repair sda8 and sda9.

What do you hope to end up with?

If you have four primary partitions, you can't have any logical. If you have three primary partitions, all your logical partitions must be together (without any primary partition between two logical partitions).

I'm not sure what you could do if you somehow switched to GPT. But if that is the plan, I don't see how sfdisk would fit in.

Last edited by johnsfine; 07-06-2013 at 05:45 AM.
 
Old 07-06-2013, 06:00 AM   #3
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Code:
Disk /dev/sda: 160.0 GB, 160041885696 bytes
 255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0xe0d2e0d2

 Device Boot Start End Blocks Id System
 /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
 /dev/sda2 206848 104855551 52324352 7 HPFS/NTFS/exFAT
 /dev/sda3 309465088 312041471 1288192 82 Linux swap / Solaris
 /dev/sda4 104857598 309463039 102302721 f W95 Ext'd (LBA)
 /dev/sda5 165443584 198936575 16746496 83 Linux
 /dev/sda6 198938624 204795903 2928640 82 Linux swap / Solaris
 /dev/sda7 204797952 309463039 52332544 7 HPFS/NTFS/exFAT
 /dev/sda8 104857600 158560255 26851328 83 Linux
 /dev/sda9 158562304 165437439 3437568 82 Linux swap / Solaris
Quote:
Originally Posted by mshlinux View Post
I want to convert /dev/sda7 into primary partition.
you can't. Traditional MBR partitioning allows for at most 4 primary partitions, or 3 primary and an arbitrary number of logical partitions, where the latter scenario requires sda4 to be an extended partition - some kind of container that holds the logical partitions. That's what you have here.
To turn one of your logical partitions into a primary one, you'd need one of the slots sda1 to sda4 unallocated, so that it could be used for the new primary partition.

Quote:
Originally Posted by mshlinux View Post
when I run "sudo sfdisk -d /dev/sda > sdapt.txt, I get sdapt.txt file in my Home and
this message below in the terminal:

Code:
msh@dbndst-msh:~$ sudo sfdisk -d /dev/sda > sdapt.txt
 Warning: extended partition does not start at a cylinder boundary.
 DOS and Linux will interpret the contents differently.
 msh@dbndst-msh:~$
what does it mean?
For operating systems not older that, say, ten years, it means nothing. Back in the old days, especially in DOS, there was a constraint on partition boundaries, which had to be aligned to cylinders. Contemporary OS's don't care abut that. Use the -L switch to suppress this message, as it is irrelevant.

Quote:
Originally Posted by mshlinux View Post
is it safe to proceed?
As far as I can tell: Yes. But still, you won't get where you want.

[X] Doc CPU


PS: Please don't use "quote" tags to include console output in your posting, because it'll be omitted from the follow-up post, even from the reply field while composing the follow-up.
Use "code" tags instead. As an additional benefit, it improves readability, because a fixed-width font is used then. I fixed that in this post.
 
Old 07-06-2013, 09:59 AM   #4
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 157

Original Poster
Rep: Reputation: Disabled
my plan is this:
first, delete /dev/sda3 , so a quota for primary partition will be available.
then convert /dev/sda7 into primary partition using "sfdisk"

Quote:
For operating systems not older that, say, ten years, it means nothing. Back in the old days, especially in DOS, there was a constraint on partition boundaries, which had to be aligned to cylinders. Contemporary OS's don't care abut that. Use the -L switch to suppress this message, as it is irrelevant.

As far as I can tell: Yes. But still, you won't get where you want.
thank u all for answers!

I am going to proceed.....

Last edited by mshlinux; 07-06-2013 at 10:01 AM.
 
Old 07-06-2013, 11:01 AM   #5
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
Quote:
Originally Posted by mshlinux View Post
my plan is this:
first, delete /dev/sda3 , so a quota for primary partition will be available.
That solves half the problem.

Quote:
then convert /dev/sda7 into primary partition using "sfdisk"
It may not be mentioned as often, but it is still true: When you have three primary partitions and some logical partitions, you cannot have one of your primary partitions in between two of the logical ones.

Quote:
I am going to proceed.....
With luck, you will only destroy sda8 and sda9.

But my guess is you will trash the whole partitioning of the system.

Figure out more details of what you plan to do before trying it.
 
1 members found this post helpful.
  


Reply


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
HowTo convert Primary Partition to Logical (ie move it inside the Extended Partition) Tom6 Linux - Software 3 11-29-2010 03:40 PM
Partitioning; safe to add a primary when already having primary and extended/logical? Wim Sturkenboom Linux - General 2 08-16-2009 12:10 PM
Dang! I used Partition Magic to convert hda5 from Primary to Logical, nothing boots.. brjoon1021 Linux - General 3 11-06-2007 09:03 PM
Primary vs. Logical Jeebizz Slackware 11 09-29-2006 02:13 PM
How to convert primary partition to logical leftPeg Linux - Hardware 1 04-27-2006 09:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration