LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-02-2006, 01:46 PM   #1
norain
LQ Newbie
 
Registered: Aug 2006
Posts: 2

Rep: Reputation: 0
Rearranging Partitions


So to make a ridiculously long story short... my partitions are out of order due to changes made in Grub... and the MBR on my Linux drive can no longer be recognized by windows. What happened was.

Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 3759 24792 168955573+ 7 HPFS/NTFS
/dev/hda7 * 2 14 104359+ 83 Linux
/dev/hda8 15 2483 19832211 8e Linux LVM

became

Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 * 2 14 104359+ 83 Linux
/dev/hda7 15 2483 19832211 8e Linux LVM
/dev/hda8 3759 24792 168955573+ 7 HPFS/NTFS

and is now...

Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 * 2 14 104359+ 83 Linux
/dev/hda6 15 2483 19832211 8e Linux LVM
/dev/hda7 3759 24792 168955573+ 7 HPFS/NTFS
/dev/hda8 2484 3758 10241406 b W95 FAT32
-------------------------------------------------

My question is what would be the simplest method of putting the partitions back in order? As you can see they're all maintained their proper sizes and are just in the wrong order. All the data is perfectly safe and I have no problem getting back into linux. All I need to do is rearrange them.

Advice?
 
Old 08-02-2006, 02:15 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,808

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I am afraid you will need to make the story LONGER. There is some key info missing---ie what exactly you did to get where you are.

Note the following:
1. GRUB does not change partition numbers or location.
2. Windows is not supposed to "recognize the mbr on the linux drive". When the computer boots, it goes to the mbr first, and then to the code the actually boots one of the OSes. Once you are up and running, you no longer care about the mbr. (I suspect you menat to say something else here)
3. If the system works, the order of the partitions does not matter.

We need more info about exactly what changes you have made.
 
Old 08-02-2006, 03:10 PM   #3
norain
LQ Newbie
 
Registered: Aug 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Alright. Long version it is.

Linux is installed on HD1 (windows was already installed on HD2 I just unplugged that drive and installed Linux). With Linux up and running I tried to get grub to boot my Windows drive with both XP and 2003 Server on it.

First I ran:
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
chainloader +1

Didn't work. So someone suggested:

map (hd0) (hd1)
map (hd1) (hd0)
unhide (hd1,0)
hide (hd1,4)
rootnoverify (hd1,0)
makeactive
chainloader +1

Placing the map command before the hide command meant that I accidentally hid the LINUX hd0,4 instead on the one on hd1,4 (the windows drive. So this moved everything up one:

Before
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 3759 24792 168955573+ 7 HPFS/NTFS
/dev/hda7 * 2 14 104359+ 83 Linux
/dev/hda8 15 2483 19832211 8e Linux LVM

After...
Device Boot Start End Blocks Id System
/dev/hda1 2 24792 199133707+ f W95 Ext'd (LBA)
/dev/hda5 2484 3758 10241406 b W95 FAT32
/dev/hda6 * 2 14 104359+ 83 Linux
/dev/hda7 15 2483 19832211 8e Linux LVM
/dev/hda8 3759 24792 168955573+ 7 HPFS/NTFS

Crazy but true. The NTFS partition went to the bottom andeverything above it got bumped up one. I had to switch the boot partition from hd0,6 to hd0,5 to get back into linux, and somehow in the process Windows stopped recognizing the NTFS partition.

I forget what change caused FAT32 to be under NTFS, but Windows still sees the FAT32 drive just fine. But I have a feeling that NTFS needs to be back in it's original position for it to work.

Now how it is that, with hd0,4 hidden Grub or Linux decided to move everything up one is beyond me. but that's the weird kinda situation I'm in. All I have to do is change the positions of the partitions. There must be a way to do it seeing as I've already accidentally done it twice. If I can do that I can use my critical data on NTFS and go on a happy man. Otherwise I'd have to boot to Knoppix or something and copy everything off onto the FAT32 drive which may or may not be able to hold the NTFS files... You get the picture.

So that's it. Same question: How can I rearrange the partition?
 
Old 08-02-2006, 03:37 PM   #4
gkiagia
Member
 
Registered: Oct 2003
Location: Greece
Distribution: Debian sid
Posts: 248

Rep: Reputation: 30
!!!! That's really strange.

My opinion is that you should not hide any partition. I have a winxp-win98-linux machine with all partitions visible and both winxp and win98 can access all the partitions (except those with reiserfs and swap).

What I noticed is that the partition table was already messed up before you try that. For example, hda7 should be hda5 as it starts from sector 2.

Somebody recently pointed me to an utility that tries to guess the correct partition table and fix it. I will give you the link. http://www.linuxquestions.org/questi...49#post2346349
Try the first three tools that he mentions.
 
  


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
/proc/partitions showing wrong partitions netstv Linux - General 1 07-10-2006 01:11 PM
Rearranging partitions ernesto_cgf Linux - Software 3 06-12-2006 12:30 PM
Creating Partitions / image partitions ELEGANCE Linux - General 1 05-17-2006 07:37 AM
rearranging my pc => aim: w98b + opensuse; some problems ungua Linux - Newbie 2 11-28-2005 11:02 AM
[Evolution] rearranging summary view HanH Linux - Software 1 03-03-2004 02:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:48 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
Open Source Consulting | Domain Registration