Ubuntu on external HDD

Page 1 of 1

5 Replies - 1239 Views - Last Post: 17 May 2010 - 02:04 PM

#1 Slice   User is offline

  • sudo pacman -S moneyz


Reputation: 253
  • View blog
  • Posts: 762
  • Joined: 24-November 08

Ubuntu on external HDD

Posted 14 May 2010 - 08:39 PM

Hey guys, I seem to have gotten myself into a bit of a bind. I just bought a 1.5TB external USB hard drive, and decided I wanted Ubuntu back and would install it seperatly on that so I could also keep Windows 7 on my laptop.

Using an official Ubuntu disk, I selected my external HDD and chose the option "use all of the hard drive". When it came time to reboot, I get a grub message: Error 21. I disconnected the external HDD and tried booting into windows 7, same error. Now I can't get into either OS, and I can only use the CD drive.

I really need my laptop back so some good advice would be very much appreciated!

Is This A Good Question/Topic? 0
  • +

Replies To: Ubuntu on external HDD

#2 Oler1s   User is offline

  • D.I.C Lover
  • member icon

Reputation: 1397
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Ubuntu on external HDD

Posted 14 May 2010 - 11:52 PM

Do you have an actual Windows 7 install disc (and not the "recovery disks" by laptop manufacturers)? If so, you can fix the problem. Grub modifies the MBR, to support booting from Ubuntu. You just need to restore this MBR.

A MS Knowledge base article points you in the right direction (you should use bootrec /fixmbr). You can also Google for repetitions of this advice, some of them with screenshots.

Then you can try again with GRUB. Or you can experiment first, then fix the MBR if you've trashed it! For the record, I've dual booted successfully using an external before, and I had to take a few additional steps, because as the ubuntu article indicates, some computers especially older ones don't support booting from USB devices.

If you keep regular backups, and can use the Windows 7 CD to fix the MBR, then you can play around with grub. Once you manually get into linux, you can modify the grub configuration to handle the external automatically. I can't recall what I actually did, but it probably was similar.
Was This Post Helpful? 0
  • +
  • -

#3 Autocrat   User is offline

  • D.I.C Regular
  • member icon

Reputation: 4
  • View blog
  • Posts: 307
  • Joined: 27-September 09

Re: Ubuntu on external HDD

Posted 16 May 2010 - 11:41 AM

Fixing the MBR can create useless partitions, you can lose all the data on your HD.

Often, erasing the first partition will erase the MBR. I don't know why, but it does. If you have a Windows 7 *INSTALLATION* disk, then I think you should simply do a reinstall. Let's see what other members have to say about it.
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6968
  • View blog
  • Posts: 31,958
  • Joined: 10-May 07

Re: Ubuntu on external HDD

Posted 17 May 2010 - 06:49 AM

The MBR is located within the 1st 512 bytes of the hard drive.

The following command will backup your MBR (on Linux)
dd if=/dev/hda of=/tmp/mbr.backup bs=512 count=1

Be sure to change source & destination accordingly.
Was This Post Helpful? 0
  • +
  • -

#5 Autocrat   User is offline

  • D.I.C Regular
  • member icon

Reputation: 4
  • View blog
  • Posts: 307
  • Joined: 27-September 09

Re: Ubuntu on external HDD

Posted 17 May 2010 - 09:35 AM

View Postno2pencil, on 17 May 2010 - 05:49 PM, said:

The MBR is located within the 1st 512 bytes of the hard drive.

The following command will backup your MBR (on Linux)
dd if=/dev/hda of=/tmp/mbr.backup bs=512 count=1

Be sure to change source & destination accordingly.

Wait, they don't need to backup the MBR, they need to erase it. However, erasing the first 512 bytes of HD also erase the partition table on some machines. If you wanna restore the MBR, do this:

1. Use a Linux Live CD like CRUX. Download it and burn it to a disc. Also download testdisk (http://www.cgsecurity.org/wiki/TestDisk_Download) for Linux and save it on a USB.

2. Boot from the Live CD, first erase the first 512 bytes of MBR using the following:
dd if=/dev/zero of=/dev/hda1 bs=512 count=1


3. Now mount the USB and cd to the directory where testdisk is saved. Run it. You choose these preferences:

ANALYSE .... NO LOG ... SEARCH .... (I do not remember their sequence). Soon it will give you a list of all you partitions. MAKE SURE IT IS THE CORRECT LIST WITH THE CORRECT DISK SIZES! If it is not, then select the DEEP SEARCH option given at the bottom.

4. Once you have the correct list of partitions, write it to disk. Now your MBR has been erased and the partition table written on it again. GRUB is gone!
Was This Post Helpful? 1
  • +
  • -

#6 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6968
  • View blog
  • Posts: 31,958
  • Joined: 10-May 07

Re: Ubuntu on external HDD

Posted 17 May 2010 - 02:04 PM

View PostAutocrat, on 17 May 2010 - 10:35 AM, said:

Wait, they don't need to backup the MBR, they need to erase it.

Thus why I said where it's located :)

But I like to backup things before I trash them. So I included that too.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1