LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 07-18-2007, 06:39 PM   #1
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Rep: Reputation: 15
Moving /boot from /dev/hda2 to /dev /hda3


I have four partitions on hda,

/swap
/dev/hda2 (boot)
/dev/hda3 (root)
/dev/hda4 (/var)

Home is on another HD.

Now what I need to do is install XP to test something, and I may just keep it for those games that don't work with CrossOver and VirtualBox.


But...... I have the maximum amount of partitions allowed. Both XP and Gparted says that. (All of the above partitions are primary ones.)

So what I want to do is move the boot from /dev/hda2 to the root, /dev/hda3. But I don't know how to do this. Is there a simple way of just reinstalling Grub maybe? Or a few files to edit to point to the /dev/hda3/boot?

(I also tried to install XP on another HD, but it says it need to write to hda and there where no usable partitions. so I am not going to bother with doing it that way, XP is not the brightest operating system.)

Thanks
 
Old 07-18-2007, 07:11 PM   #2
Brian1
Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 61
Since all partitions are Primary then no addtional partitions can be added. Is ther still space not partitioned on the drive?

If there are 3 primary partitions then the last one would be an extended partition where logical partitions can be created in. The limit I do not know.

Of course XP really loves the primary first partition of the first drive. But if you install the second drive by itself and install XP. After the install put the first drive back in as the master and the windows as slave. Then for a grub option use something like this to swap drives ids on boot of XP.
Code:
title windows
	map (hd0,0) (hd0,2)
	map (hd0,2) (hd0,0)
	setup (hd0)
	rootnoverify (hd0,2)
	chainloader +1
Or leave the XP as master drive and linux as slave. Using a boot disc re install grub to the master boot record of the new drive. Edit /etc/fstab and change drive ids to match the new setup. /dev/hda2 to /dev/hdb2. Also edit grub.conf file. It would be easier to create a /boot on the new drive and copy the contents of the old /boot to the new /boot. Again make fstab and grub are id'ed correctly.

Brian

Brian
 
Old 07-18-2007, 07:56 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,488

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
I would doubt moving an average /boot would free enough space for XP.
Probably don't need to anyway. Install Virtualbox in Linux, and run XP as the guest - that way it sees just the (virtual) disk you define for it.
Works fine - if you have enough space.

Of course the opposite also works fine.
 
Old 07-18-2007, 08:00 PM   #4
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 297

Rep: Reputation: 49
Hi Neo-Leper,

easy-peasy:

1. umount /boot
2. mount /dev/hda2 /mnt
3. cp -a /mnt/* /boot
4. umount /mnt
5. Adjust /etc/fstab and /boot/grub/menu.lst accordingly
6. grub-install /dev/hda (probably necessary / assuming you have GRUB in MBR)

And better not destroy old /boot partition before you know it works...

Rupert
 
Old 07-18-2007, 09:07 PM   #5
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rupertwh
Hi Neo-Leper,

easy-peasy:

1. umount /boot
2. mount /dev/hda2 /mnt
3. cp -a /mnt/* /boot
4. umount /mnt
5. Adjust /etc/fstab and /boot/grub/menu.lst accordingly
6. grub-install /dev/hda (probably necessary / assuming you have GRUB in MBR)

And better not destroy old /boot partition before you know it works...

Rupert
Thanks everyone. The above is what I was looking for. I am going to try this shortly. Right now I got side tracked with DesktopBSD, lol.
 
Old 07-19-2007, 03:35 PM   #6
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by rupertwh
Hi Neo-Leper,

easy-peasy:

1. umount /boot
2. mount /dev/hda2 /mnt
3. cp -a /mnt/* /boot
4. umount /mnt
5. Adjust /etc/fstab and /boot/grub/menu.lst accordingly
6. grub-install /dev/hda (probably necessary / assuming you have GRUB in MBR)

And better not destroy old /boot partition before you know it works...

Rupert
After getting side tracked with DesktopBSD, getting grub image set up and then getting XP installed on VirtualBox I am finally back to this, lol.

I tried sudo umount /boot in the terminal, I also tried sudo umount /dev/hda2 with the same result. It is telling me the device is busy. Gparted won't let me unmount it either.
 
Old 07-19-2007, 05:22 PM   #7
jay73
Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
Quote:
I tried sudo umount /boot in the terminal, I also tried sudo umount /dev/hda2 with the same result. It is telling me the device is busy. Gparted won't let me unmount it either.
I hope you don't mean the Gparted that is installed on your hard disk. It's not a good idea to edit a mounted system and, luckily enough, it often produces only warnings and doesn't do anything. The best you can do is either use a gparted livecd or do the editing from another system on your computer (providing you have more than one installed, that is).
 
Old 07-19-2007, 05:42 PM   #8
rupertwh
Member
 
Registered: Sep 2006
Location: Munich, Germany
Distribution: Debian / Ubuntu
Posts: 297

Rep: Reputation: 49
Quote:
Originally Posted by Neo-Leper
I tried sudo umount /boot in the terminal, I also tried sudo umount /dev/hda2 with the same result. It is telling me the device is busy. Gparted won't let me unmount it either.
ok, my mistake. So it's not *that* easy... Best is probably to do this from a rescue/live cd.
 
Old 07-19-2007, 08:45 PM   #9
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
I will give it a try with the gparted disk later. Thanks. I was wondering if I should try it that way, it is still easy to do either way

Last edited by Neo-Leper; 07-19-2007 at 08:51 PM.
 
Old 07-20-2007, 01:54 PM   #10
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Did it my way and didn't break anything ;) lol

Everything I tried was not working. I have no idea why, but it is probably due to user error, lol.

So I did it my way.

I used the Gparted live cd and resized hdb and put aside 10G(fat32) for XP, while keeping hdb1 the same (it is where my /home is,) XP=hdb2.

I went into my bios and switched the auto for hda and SATA off. Tested it by booting and there was nothing to boot from hdb, so all was well so far.

So I rebooted with the XP installation disk in. I tried to install it on the fat32 I set up with gparted but it didn't want to do that, so I did a quick format with the ntfs file system and installed it. Before when I didn't turn off anything in the bios and tried to install XP on hdb or the SATA partition it kept telling me it had to write to hda and it couldn't, it wanted me to format it first, (NOT!!!) But this time it worked even though XP did pick up all the HD's and partitions. So I hoped it wouldn't rewrite the MBR....... But XP did, have I mentioned today how much XP annoy's me?!!!

So I booted the Ubuntu 7.04 installation (livecd) disk. I opened the terminal and type in "sudo grub" grub> came up. So I then typed in where my /boot was, which was "root (hdo,1)" and then enter. After that I typed in "setup (hd0)"

It reinstalled grub and all is fine. All I have to do is add XP to fstab and menu.lst.


So /boot stays where it is and XP is now installed.

Last edited by Neo-Leper; 07-20-2007 at 01:56 PM.
 
Old 07-20-2007, 02:50 PM   #11
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
Ok. My way is having one problem. I am going to see if I can figure out a solution first and then just post that here. XP really annoys me, lol.
 
Old 07-20-2007, 03:10 PM   #12
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
I found a way to work around the problem I am having until I can find, if I can find, a better solution.

What happened was when I disabled HDA and SATA in the BIOS XP completely installed in HDB as it should (HDB is the slave and HDA is the master.)

I added this to grub,

title Windows XP
root (hd1,1)
savedefault
makeactive
chainloader +1

I also tried it these ways,

title Windows XP
root (hd1,1)
savedefault
chainloader +1

title Windows XP
root (hd1,1)
makeactive
chainloader +1

title Windows XP
root (hd1,1)
chainloader +1


But no matter what grub would not boot XP. It said starting up and it would just hang there.

So I went into the bios (F1) and changed the boot order so that the slave, HDB where XP is, would boot first and then XP booted fine. So for now I have a boot menu in the BIOS, the default setting is set to boot the master (hda) with grub. If I want to boot XP i have to hit (esc) when I start the computer so it brings up the bios boot menu. From there I can choose to boot the slave, hdb, with XP.

It works but I would like to get this so Grub does it all. Anyone have any ideas? I won't be using XP that much so it is not a huge deal. I would just like to figure this out.

Also can anyone explain to me what I did wrong or missed when I installed XP this way?

Thanks.
 
Old 07-20-2007, 11:20 PM   #13
Neo-Leper
Member
 
Registered: Nov 2006
Posts: 141

Original Poster
Rep: Reputation: 15
I got it to work and boot from grub. This is what my XP entry looks like in fstab now.


title Windows XP
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,1)
savedefault
makeactive
chainloader +1
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
dd if=/dev/urandom of=/dev/hda2 bs=1M doesn't work Melsync Linux - General 16 05-19-2014 07:36 PM
mounted as: /dev/hdb3 but listed as /dev/hda3 R2D2RABEAU Linux - Newbie 4 07-12-2006 10:10 AM
merging /dev/hda2 and /dev/hda3 aggiridharan Linux - General 2 01-06-2006 02:31 AM
swap, /dev/hda2 by /dev/hands :) kaN5300 Slackware 2 09-13-2004 04:45 AM
mount point for /dev/hda2 (my boot partition) annihilate Slackware - Installation 5 05-23-2004 04:38 AM


All times are GMT -5. The time now is 07:10 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration