Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
I have already installed Ubuntu on my external drive, it works and I can also dual boot XP fine. However, when I unplug my external drive and try to boot ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2010
    Location
    Mass
    Posts
    9

    Dual boot XP/Ubuntu with Ubuntu on external HDD


    I have already installed Ubuntu on my external drive, it works and I can also dual boot XP fine. However, when I unplug my external drive and try to boot into XP I get a Grub error (I think it was error 21, Ill confirm that and edit if needed). I would like to be able to dual boot whenever my external drive is plugged in but also be able to boot XP when the drive is unplugged. I am sure this is possible, and I hope that it is possible to do without reinstalling linux. Any ideas?

    Thanks

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Grub error 21 is no such partition. What you probably did when installing Ubuntu was to put the Grub bootloader stage1 file in the master boot record of the internal drive with xp on it. What you need to do is put Grub stage1 in the master boot record of the external drive. You can then repair the xp bootloader with the fixmbr command using your installation CD.

    If you are not familiar with this process, post the output of the command: sudo fdisk -l (lower case Letter L) which will show your partition information. Someone should then be able to give you a detailed explanation of how to do this.

  3. #3
    Just Joined!
    Join Date
    Jan 2010
    Location
    Mass
    Posts
    9
    Thanks!
    Here's the output:

    fdisk -l
    [sudo] password for sean:

    Disk /dev/sda: 58.5 GB, 58506416640 bytes
    255 heads, 63 sectors/track, 7113 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x41ab2316

    Device Boot Start End Blocks Id System
    /dev/sda1 1 5 40131 6 FAT16
    /dev/sda2 * 6 5063 40628385 7 HPFS/NTFS
    /dev/sda3 5064 6653 12771675 7 HPFS/NTFS
    /dev/sda4 6654 7113 3694950 db CP/M / CTOS / ...

    Disk /dev/sdb: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x5c74ae42

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 29063 233448516 7 HPFS/NTFS
    /dev/sdb2 29064 29685 4996215 83 Linux
    /dev/sdb3 30153 30401 2000092+ 82 Linux swap / Solaris
    /dev/sdb4 29686 30152 3751177+ 83 Linux

    Partition table entries are not in disk order

  4. #4
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Which version of Ubuntu are you using? You have installed GRUB in MBR of internal disk but its conf files are in External disk.

    First of all, remove GRUB from Internal Disk. Boot up from Windows XP installation CD and select Repair. Execute fixmbr command. It will remove GRUB and Windows OS will boot up fine.

    Instead of re-installing GRUB in External Disk, I would suggest to re-install OS. Just re-install it over existing partitions. This time, disable Internal Disk in BIOS. Installer will install GRUB in MBR of External disk only.

    You can add an entry of Internal Disk OS in GRUB easily. Fix Windows OS, re-install Linux OS and post back here.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  5. #5
    Just Joined!
    Join Date
    Jan 2010
    Location
    Mass
    Posts
    9
    When you say "Just re-install it over existing partitions" does that mean that my existing applications and configurations will not be affected? Or will I have to start from scratch?

    Is there any way to do this without reinstalling?

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    will I have to start from scratch?
    Yes, you have to start from scratch.

    If you don't want to do fresh installation, you can fix GRUB by editing a few files.
    Post the contents of /etc/fstab file and output of sudo fdisk -l command here. Which version of Ubuntu are you using?
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Jan 2010
    Location
    Mass
    Posts
    9
    I am using Ubuntu 8.04

    /etc/fstab does not exist

    here is the output if sudo fdisk -l:

    [sudo] password for sean:

    Disk /dev/sda: 58.5 GB, 58506416640 bytes
    255 heads, 63 sectors/track, 7113 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x41ab2316

    Device Boot Start End Blocks Id System
    /dev/sda1 1 5 40131 6 FAT16
    /dev/sda2 * 6 5063 40628385 7 HPFS/NTFS
    /dev/sda3 5064 6653 12771675 7 HPFS/NTFS
    /dev/sda4 6654 7113 3694950 db CP/M / CTOS / ...

    Disk /dev/sdb: 250.0 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x5c74ae42

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 29063 233448516 7 HPFS/NTFS
    /dev/sdb2 29064 29685 4996215 83 Linux
    /dev/sdb3 30153 30401 2000092+ 82 Linux swap / Solaris
    /dev/sdb4 29686 30152 3751177+ 83 Linux

    Partition table entries are not in disk order

  8. #8
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    With both drives connected and no changes since your last post, boot into Ubuntu on the external, open a terminal and run the command: sudo grub (hit the enter key, this should prompt you for your user password, enter it, hit the enter key, and you should get a grub prompt: grub>) At the grub prompt type: root (hd1,1) (hit the enter key)
    then type: setup (hd1) (hit the enter key), then type:quit, exit the terminal. These commands will install Grub stage1 into the master boot record of the external hard drive pointing to the second partition on the external harddrive where your remaining grub files are. When you set the external to first boot priority in the BIOS, it will boot Ubuntu.

    /etc/fstab does not exist
    That could pose problems. I'd suggest taking a closer look.

    Your other problem of booting xp is by microsoft design. There are many tutorials on how to enable the xp bootloader to boot again after problems. Usually the suggestion made in previous post works, if not you should be able to resolve with a google search.

  9. #9
    Just Joined!
    Join Date
    Jan 2010
    Location
    Mass
    Posts
    9
    I preformed the Grub commands listed and rebooted. When I boot from the external and try to start Ubuntu I get "Error 17: Cannot mount selected partition"

    When I boot from the internal I can boot either Ububtu or XP fine.

    Any ideas? Does this have anything to do with the Unbuntu partition not having an "*" in the "boot" column of the "fdisk output"? Or is it likely that I must have entered something incorrectly?

  10. #10
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    When I boot from the internal I can boot either Ububtu or XP fine.
    This is with the external drive attached, right?

    "Error 17: Cannot mount selected partition"
    That error usually comes when Grub is pointing to and trying to mount an ntfs partition which should not happen when you are trying to boot Ubuntu from/on the external drive. You did do "root (hd1,1) right? The * is not needed for Linux, but windows should have its boot or operating system partition set active.

    Boot into Ubuntu again and go to the grub prompt again and run the commands:

    geometry (hd0)
    geometry (hd1)

    so we can compare them to output of fdisk.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •