?
Solved

RED HAT 7.3 & Windows XP Dual Boot Help!

Posted on 2003-03-27
10
Medium Priority
?
299 Views
Last Modified: 2013-12-06
Here is the scenario. I have a Dell Dimension 8200 w/ 256MB RDRAM and Pentium 4 2.0GHz Processor and a 40GB harddrive. I installed Linux on this machine over the Windows XP that it initially came installed with. I recently bought a 200GB harddrive and installed it as the slave drive. When running fdisk my new drive is noticed and here are the results from fdisk -l

-------------------------------------------------------------

Disk /dev/hda: 255 heads, 63 sectors, 4863 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1         6     48163+  83  Linux
/dev/hda2             7      4798  38491740   83  Linux
/dev/hda3          4799      4863    522112+  82  Linux swap

Disk /dev/hdb: 255 heads, 63 sectors, 24321 cylinders
Units = cylinders of 16065 * 512 bytes

Disk /dev/hdb doesn't contain a valid partition table

-------------------------------------------------------------

I would like to install XP on the /dev/hda where RH 7.3 currently is and move RH 7.3 over to the 200GB /dev/hdb. I do not currently possess a writeable CDROM or a ZIP drive to store the contents in my home as well as in my Linux partition. I presume I could copy it to /dev/hdb but I am not certain that it will work once it is moved over. I would also    like to make another partition on hdb with the original RH 7.3 distribution as I have added many more packages to the Linux partition I'm currently using so that when I modify it this time I can actually keep a record of modifications I have made. If possible I would like to have GRUB as my bootloader although this is not absolutely necessary. If one could help also with a better partitioning scheme than the one I currently have I would greatly appreciate that. An explanation of mounting filesystems will be helpful as well. Thank You.

0
Comment
Question by:ecrouse
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 

Accepted Solution

by:
fluid11 earned 1000 total points
ID: 8222856
{Option 1}

Create a partition on /dev/hdb that will contain anything that you want backed up.  Don't use the entire space on the drive.  Use the "fdisk /dev/hdb" command to create the partition.  This will bring you into an interactive menu where you can create the partition.  Format the partition with "mkfs -t ext3 /dev/hdb?".  

Copy anything that you don't want to lose to the newly created partition on /dev/hdb.

Install Windows XP on the first hard disk (/dev/hda).  During the setup, delete any partitions you see on the first disk (don't delete anything on the 200Gb drive).  Before you install XP, it would be a good idea to wipe out the MBR first.  If you have a bootable Win9x disk, boot from it and then run "fdisk /mbr".  You can also download a utility called "delpart" that will delete your MBR.  You can probably run the "fdisk /mbr" command from Linux (before you get rid of it) to kill anything in the MBR (LILO or GRUB).  

After Windows is installed, boot from the Redhat CD and install Linux to the second disk.  When it comes to partitioning, create a 100Mb (or less) /boot partition, a swap part, and a / partition.  The rest of your partitioning depends on your needs.  If this is just a workstation, the above is really all you need.  For a server install, you probably want some custom paritioning that would depend on the services you are going to run.  One option that you can do is...

100Mb /boot
512Mb <swap>
1Gb /
199Gb /backup (partition created earlier).  

Make sure that you do not select your backup partition to be formatted.  

During the bootloader portion of setup, select GRUB and install it to the MBR.  It usually does a good job of picking up any other installed OS's, if not, just post back and we'll walk you through editing the grub.conf file.  




{Option 2}
First create a boot disk for your existing Linux installation on /dev/hda with this command --> mkbootdisk.  Verify that the disk works by booting from it.  

Boot from the Redhat CD and enter Recovery mode.  In recovery mode, you should be able to mount your 3 paritions.  It will put your root directory into something like /mnt/sysimage.  From here, run "fdisk /dev/hdb" and create the partitions that you want to use (see partitioning above).  Format the partitions with "mkfs -t ext3 /dev/hdb?".  After the partitions are created, you can just copy the contents of the old partitions to the new ones, or you can try using the dd command.  I'm not sure if this will work, but you can try this on each unmounted partition...

dd if=/dev/hda1 of=/dev/hdb1

If the above worked, make sure that now have copies of all your partitions on /dev/hdb.  

Next, install GRUB on /dev/hdb with "grub-install /dev/hdb".  Check that the grub files exist in /boot/grub on the new / partition on /dev/hdb.  

Reboot the computer and see if it boots into your new Linux installation on /dev/hdb.  If this worked, create a boot disk for the new Linux installation, install Windows to /dev/hda, boot from the boot disk and reinstall GRUB (like above).



ChrisP

0
 

Author Comment

by:ecrouse
ID: 8225270
I have a few brief questions about the process of copying over. I was able to create a partition and format accordingly. Now should I copy over all of /dev/hda onto  /dev/hdb using the dd command? If I use dd is it necessary the to and from partitions are exactly the same size? If I copy over using dd if=/dev/hda of=/dev/hdb bs=? count=? will my original directories exist and if so how do I access them. I know that they sould be mounted, I am not sure in general how to access anything in /dev/hdb once it is over there or if I should only copy over the Linux (hda2) and create a new swap later and a new boot partition as well.
0
 

Expert Comment

by:fluid11
ID: 8227015
I don't think it should matter that they are exactly the same size.  I'm not sure on the byte size, as I haven't done this in awhile.  You can always just copy everything over using a simple 'cp -pr', if dd doesn't work.  

After you copy your data over to /dev/hdb, just mount the partition to access it.  If you use dd and cp correctly, your original paritions on /dev/hda should be left unchanged.  When using dd, the partitions should NOT be mounted.

You can create your swap partition on /dev/hdb using fdisk. Create a paritition with partition ID 82 (Linux swap).  

ChrisP
0
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 

Expert Comment

by:fluid11
ID: 8228516
...actually, I just though of a problem with Option 2.  There are going to be some references to file locations on the old drive.  /etc/fstab is an example of a file that your going to have to edit to reflect the changes.  You might have a few shortcuts in /dev that might need some updating also, like /dev/cdrom and /dev/floppy, for example.  Let us know if you have any problems after you boot into Linux on the second disk.

ChrisP
0
 

Author Comment

by:ecrouse
ID: 8228584
when copying over I noticed that the data migration was taking a long time and so I became scared and stopped the process... I stopped it maybe after 40 minutes of CPU time. Is this normal. Secondly, in option1 instructions you suggested that I create a partition hdb? which I naturally named hdb1 and then formatted the partition with mkfs. However, because I originally had three (3) partitions on hda when I used dd if=/dev/hda of=/dev/hdb  I automatically saw three partitions upon using fdisk -l. I presume this to be OK eventhough I'm not sure. Should I be copying these over one partition at a time or is it OK to copy over the whole /dev/hda over to /dev/hdb and get 3 partitions after only manually creating one...unusual.
0
 

Expert Comment

by:fluid11
ID: 8228632
I would just create a partition on /dev/hdb that you will only store data that you want to keep on.  After that, you'll need a /, /boot, and <swap> partition for the OS.

I'm not sure exactly what you did, but lets see the output of "fdisk -l /dev/hda" and "fdisk -l /dev/hdb".  

By the way, if it was me, I would definitely do Option 1.  Its much safer and cleaner that way.

ChrisP
0
 

Author Comment

by:ecrouse
ID: 8228652
[root@localhost root]# fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 4863 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1         6     48163+  83  Linux
/dev/hda2             7      4798  38491740   83  Linux
/dev/hda3          4799      4863    522112+  82  Linux swap

Disk /dev/hdb: 255 heads, 63 sectors, 24321 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *         1         6     48163+  83  Linux
/dev/hdb2             7      4798  38491740   83  Linux
/dev/hdb3          4799      4863    522112+  82  Linux swap
0
 

Expert Comment

by:fluid11
ID: 8229612
Looks like the dd command copied the partitions exactly.  Does a 'df -h' show that each partition is using the same amount of space?  If it does, then you probably copied everything already.  If your short, you can use the rsync utility to synchronize the partitions and only copy files that you don't have.

ChrisP
0
 

Author Comment

by:ecrouse
ID: 8230267
I think that you're correct. Now the problem is everything has been copied over I cannot seem to mount /dev/hdb or any of its partitions this is what I get.

[root@localhost root]# mount /dev/hdb
mount: can't find /dev/hdb in /etc/fstab or /etc/mtab

or...

[root@localhost root]# mount -t ext3 /dev/hdb /backup
mount: wrong fs type, bad option, bad superblock on /dev/hdb, or too many mounted file systems

in which I believe I have too many mounted file systems. I do not think I can mount two filesystmes from seperate devices at the same time. So how the heck do I unmount the filesystem I need at all times because it (hda2) claims to be busy to access the one on the other drive hdb?
0
 

Expert Comment

by:fluid11
ID: 8231595
You can't mount an entire disk, only partitions.  

mount -t ext3 /dev/hdb1 /mnt/somedir
mount -t ext3 /dev/hdb2 /mnt/someotherdir

You won't be able to unmount / on /dev/hda, because your OS is currently running on it.  

ChrisP
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question