Moving from extended partition to primary partition
Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Moving from extended partition to primary partition
Hello,
I am currently running Mandrake 9.2.
I have a dual boot configuration in which XP is stored on a primary partition
and Linux is stored in an Extended Partition. I use the XP bootloader to dual
boot into either environment.
Below is a copy of the current partition table:
Device Boot Start End Blocks Id System
/dev/hda1 * 1 892 7164958+ 7 HPFS/NTFS
/dev/hda2 893 3589 21663652+ f Win95 Ext'd (LBA)
/dev/hda3 3590 4864 10241437+ 1c Hidden Win95 FAT32 (LBA)
/dev/hda5 893 1784 7164958+ 83 Linux
/dev/hda6 1785 1848 514048+ 82 Linux swap
/dev/hda7 1849 2740 7164958+ b Win95 FAT32
/dev/hda8 2741 3589 6819561 7 HPFS/NTFS
#Ignore /dev/hda8 for now. I have future plans for it.
What I would like to find out is a simple, non-destructive way of
moving the Linux partition to a primary partition.
I tried using Partition Magic to designate the Linux partition (currently hda5) as a
primary partition. What's not clear to me is the device id assigned to the primary
partition. I assumed it to be hda2, but I am not certain of this. Assuming the new
partition was hda2, I modified lilo.conf, indicating the new device to be hda2
rather than hda5, and wrote the resulting information to a bootsect.lnx file
that I then mounted in the root directory of drive C, where my current working
boot file resides.
Unfortunately, when I choose Linux from the XP boot loader, all I get is gibberish
on the display. Other variations I have tried (ie. boot floppy) have gotten started
with the boot process, but always result in a kernel panic indicating that the
file systems cannot be found.
Is there a simple way to do what I am trying to do, or must I reinstall the OS from
scratch on the clean primary partition.
You can only have 4 primary partitions, and if you want more than 4 partition on you HDD then one of them needs to be the extended partition, which holds the logical partitions.
From your listing I assume that /dev/hda4 is the extended partition which holds logical partitions /dev/hda5 - /dev/hda8
If you really want linux on a primary partition you need to delete one of them first to make room....probably not what you want since I assume hda2 and hda3 hold your windows file.
I think you are getting gibberish because, if I understand you correctly, you told lilo to boot linux from hda2, where obviously linux is not installed.
So: if you free up a primary partition you can try PM again...I have never used it so I can't say whether it will do the trick.
After further experimentation I discovered that you were correct;
the drive in question was hda4 and not hda2. After some tinkering
I finally got things to work the way I wanted.
Even though you figured it out I wanted to add some additional info.
Quote:
/dev/hda2 893 3589 21663652+ f Win95 Ext'd (LBA)
/dev/hda5 893 1784 7164958+ 83 Linux
hda2 is your extended partition, note the ext'd. 1-4 are your primary partitions. Anything >= 5 is a logical partition. In a nutshell an extended partition is a container for logicals. I take it you created a hda4 since that was the last primary partition ID available.
You see how hda2 and hda5 have the same starting block number. Also all of your logicals will have a start and end blocks within the start and end blocks of hda2.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.