PC wont boot with External USB HD attached

Asked by Jacques Malaprade

Hi,
Newbee here. I have a problem which I have spent some time looking for a solution in google forums etc. My PC wont boot into Ubuntu login with my external USB HD attached. It gets to the ubuntu purple screen and hangs. It is fine if I boot with it unattached and insert it after booting. Does anyone have a solution?
Many thanks in advance,
Jacques.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub2 Edit question
Assignee:
No assignee Edit question
Solved by:
Jacques Malaprade
Solved:
Last query:
Last reply:
Revision history for this message
Jacques Malaprade (malapradej) said :
#1

Would appreciate any response. Thanks.

Revision history for this message
delance (olivier-delance) said :
#2

Sorry, I need more data.
---
X-provide data about boot configuration

There is a standard script provided to analyze boot configuration.

Could you download script at:

   http://sourceforge.net/projects/bootinfoscript/

Then in a terminal (Ctrl+Alt+T) run command:

    sudo bash boot_info_script055.sh

This will produce a file named: RESULTS.txt

Paste content of this file in http://paste.ubuntu.com/ and provide in this thread the link to Web page.

Please don't post file directly in thread, else it will make thread difficult to read.

Revision history for this message
Jacques Malaprade (malapradej) said :
#3

Hi Delance,
http://paste.ubuntu.com/552309/
Hope u make sense of it.
J

Revision history for this message
Tom (tom6) said :
#4

Wow!!

You have a LOT of partitions! A lot of installs of Windows and possibly a lot of linux installs? Is the 320Gb drive the external drive? Are the 60Gb and the 125Gb drives both internal, inside the machine?

You seem to have 2 Ubuntu 10.10 installed on the 2 smallest drives and an unknown linux installed on the 320Gb. So, it is probably just that when you have the external drive plugged in it is trying to boot-up the 'wrong' drive. We can hopefully help fix that if you can answer the questions in my first paragraph.

First please can you boot into Ubuntu and go up to the top taskbar and click on

Applications - Accessories - Terminal

to get to a command-line. Once on the command-line please try checking the partition sdc6 by using this command

sudo fsck /dev/sdc6

Good luck and regards from
Tom :)

Revision history for this message
delance (olivier-delance) said :
#5

By pure curiosity, why do you have so many partitions ?

Revision history for this message
Tom (tom6) said :
#6

Hi :)

Please let us know how you are and what is happening.
Regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#7

Hi,

I will try my best to explain. I have 2 internal HD's of which both were formatted in NTFS. I formatted the 2nd drive and installed Linux Ubuntu in a multi-boot config on the 2nd drive. I tried to partition the 2nd internal drive according to the prescribed partitions after some Ubuntu Google searches etc. sdb is the partitioned Ubuntu drive. sda is the Windows drive. All programs are installed under sda1 and data under sda5. This was done in my windoze days when the idea of keeping data and programs separated seemed a good idea. (BTW I intend to remove windows completely in the next few weeks and have the windows drive as 2nd linux drive.)

I'll go through by Ubuntu partitions. All ext4 file systems:

sdb1 is /.
sdb2 is swap.
sdb3 is /usr.
sdb5 is /var.
sdb6 is /var/tmp.
sdb7 is tmp.
sdb8 is /home.
I though I was being smart when setting it up this way but let me know if this could have been done better.

I also partitioned my external hard drive this way:

sdc1 is a FAT partition I used for backing up Windoze data.
sdc5 is a NTFS partition I created later for large ISO files.
sdc6 is a ext3 partition for my Linux backups etc.
I know it all sounds a bit complicated but it did make sense at the time, and a lot of this is legacy. Once I remove windows I will increase the size of my Linux partitions on the external drive as will have less requirments for windoze storage.

I unmounted and got the following after typing the command:

malapradej@Malaprade-MS-7043:~$ sudo fsck /dev/sdc6
fsck from util-linux-ng 2.17.2
e2fsck 1.41.12 (17-May-2010)
Backing up journal inode block information.

LINUX_BU has been mounted 46 times without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

LINUX_BU: ***** FILE SYSTEM WAS MODIFIED *****
LINUX_BU: 89/25624576 files (13.5% non-contiguous), 2846214/25599569 blocks

I suspect it has changed some stuff on there. I will reboot with the external drive installed and see if it made a difference.

I let you know soon.

Cheers,

Jacques

Revision history for this message
Jacques Malaprade (malapradej) said :
#8

No luck;((

I rebooted with the external usb drive in and it hanged as before.

Will appreciate if you can guide me from here.

Thanks,

Jacques

Revision history for this message
delance (olivier-delance) said :
#9

"I'll go through by Ubuntu partitions. All ext4 file systems:
sdb1 is /. sdb2 is swap. sdb3 is /usr. sdb5 is /var. sdb6 is /var/tmp. sdb7 is tmp. sdb8 is /home.
I though I was being smart when setting it up this way but let me know if this could have been done better."

Except if you manage a farm of huge servers, it's a too complicated partition scheme.
For normal usage, best is swap min(RAM size, 2GB), "/" 10GB, "/home" the remaining.
And swap is not Ext4.
---------
With a dual hard disk configuration with Windows, best configuration is set Ubuntu disk before Windows one.
During installation, Windows disk is untouched (else Ubuntu will overwrite first sector for MBR) and detected at end of installation.
At reboot, it is added in menu.
Currently, Ubuntu MBR is installed in Windows disk.
----------
http://paste.ubuntu.com/552309/
 => Grub 2 is installed in the MBR of /dev/sda and looks on the same drive in
    partition #1 for (,msdos1)/boot/grub.
 => No boot loader is installed in the MBR of /dev/sdb
 => Windows is installed in the MBR of /dev/sdc

Now the BIOS look at a sector boot in external disk before internal one. And currently external disk has a MBR at start. So BIOS load MBR of sdc and try to boot from it. We must delete this MBR.

Unplug external disk
Boot on Ubuntu
Plug external disk
RUn following command

sudo dd of=/dev/sdc if=/dev/zero bs=1 count=446

Will write 446 zeros on start of sdc disk.
BE CAREFULL NO TYPO

Revision history for this message
Tom (tom6) said :
#10

Hi :)

Part of the beauty of linux is that it offers freedom OF choice. Mostly this means that there are a number of different ways of approaching things but occasionally there might be unusual hardware or the user might have a reason why one way is 'better' than another. Windows proudly gives only freedom FROM choice and people say they prefer that because (they say) choice is too confusing for people. Once they try linux they tend to do an about-turn.

Consequently linux users tend to develop very different methodolgies, ideas and ways of working. Often that can lead to some quite heated debates where each person thinks the other is an idiot for not following their way but usually both/all ways are valid. These debates often increase the knowledge-base of both/all parties.

Delance has a very different way of looking at this whole area of MBRs, Grub and all that. I know my way works because i have done this many times and i haven't tried his way. My way is backed-up by lots of documentation and from debates and trial-and-error, but doubtless so is Delance's. There are probably a LOT of people out there that have a different understanding from either of us.

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#11

Hi :)

My way would be to reinstall grub2 to each of the drives setting the MBR of each drive so that they all work, except sda because that has not got a linux partition on it.

So, boot-up Ubuntu and then plug in the external drive. I would use this guide
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
It assumes that you have to use a LiveCd because they assume that it is unlikely that people would have a 2nd install of linux on their system.

To reinstall grub2 to sdc6 first and then sdb1

sudo mount /dev/sdc6 /mnt

sudo grub-install --root-directory=/mnt/ /dev/sdc

sudo mount /dev/sdb1 /mnt

sudo grub-install --root-directory=/mnt/ /dev/sdb

It might grumble about the 3rd line in which case don't bother with the 4th line. Sdb seems to be the one that is working already at the moment so it might be better to just leave out lines 3 and 4 anyway.

Then try rebooting with the external drive plugged in. This should use the MBR and Grub2 that are on sdc, the external drive. You should see quite a few choices for booting into Ubuntu. Whichever you choose get back to a command-line and try this command

sudo update-grub

Now shut-down and unplug the external. Boot up again, this should now be using the MBR and grub2 that are on the internal drive. Again get to a command-line and run

sudo update-grub

Run this even if youd didn't do lines 3 and 4 earlier to reindstall grub2 to sdb. Now both the external and internal drives have updated grub2s and the MBR of each should point to the grub2 on its own drive.

Good luck and regards from
Tom :)

Revision history for this message
delance (olivier-delance) said :
#12

@Tom:
sda is the first drive when any external drive is plugged. And so the BIOS will use it at boot, so sda is the main disk on which you should install Grub's MBR...except that currently it works, and should not be modified. Grub files are installed in two locations:
  1-on the first 64 sectors of boot drive, called MBR
  2-on the boot folder of partitions whose address is in MBR
If you have a Windows disk and then an Ubuntu disk in this order, the Windows disk will be used at first stage of boot. BIOS will load first sector, and load in following 63 ones the driver to read ext4 partition (or other file system). After driver is installed, first stage of Grub will load additional modules and configuration file /boot/grub/grub.cfg. The only way to make Windows disk untouched is to set him as second disk.
Installing Grub in second disk will only make Grub rebuild /boot/grub folder with same value. The boot sectors installed in second disk will not be used at boot.

It's true that installing Grub on external disk will solve issues, as external disk will have both the boot sectors and the boot folder in sdc6. But if sdc6 is used as backup, this folder could be overwritten and issue will occur again.

Working from a database made of previous question is a good way. I started like this and it woks many times. But this issue is the first of this type since I answer question about Grub (which means around 1000 questions) and so is in any previous question. For some question, you can't avoid to learn the internal mechanism of software.

@Jacques: I apologize for this "guru's" discussion. You can try reinstall in sdc as advised Tom, but be careful not to overwrite boot folder installed in sdc6.

Revision history for this message
Jacques Malaprade (malapradej) said :
#13

U guys amaze me. Wow. I try the 1st option and if it works I'll leave it there. If there is a problem I'll try the second.
many thanks o brainy ones.

Revision history for this message
Jacques Malaprade (malapradej) said :
#14

I tried the 1st option but it gets to the screen where I need to select a Operating system. I select Linux Ubuntu but it still hangs on the Ubuntu screen not even allowing access to login.
@Tom.: If I did it your way would the I still have the chance to boot into Windows on sda? I would like to move away from Windows but not just yet. I have to backup some data etc before reformatting the ntfs partitions, and loading data back on.
thanks both of you.
Jacques

Revision history for this message
Tom (tom6) said :
#15

HI :)

I think that is all over-complicating the issue. (Re)installing grub2 is easy so if it needs doing again to any of the drives for any reason then it can be done then. Installing or reinstalling sorts the MBR of the stated drive and sorts the /boot folder, the boot-sector, the whole thing. The MBR of sda is already pointing at the grub2 of the other internal drive and it would be a pain to make it any other way at this point.

The first time (re)installing grub2 is a bit daunting but once experienced the guide makes more sense next time.
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#16

Hi :)

Yes, one of the options in the boot-menu set-up by grub would be Windows.
Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#17

Hi again :)

There is nothing wrong with keeping a working version of Windows, or even a fairly broken one. Windows is horrendous to install so it can be best to avoid losing it just in case you need it for a few minutes or for some games or something until you get that working in Wine. I think most of us have a Windows boot somewhere.

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#18

Hi again!

Errr, i still have a lot of data on Windows partitions. I didn't really see much point in moving it. Ntfs is journalised so it is almost as robust as ext3 and ext4. Obviously i would back-up anything on a Fat partition or ext2 because they are not journalised and therefore more prone to data loss. The main problem with Ntfs is the poor user-permissions and more importantly it tends to slow-down through file fragmentation. However the ram and swap cache data they get from reading-ahead so there is no noticeable slow-down in performance.

Windows slow-downs are mostly a result of system files, especially their swap-file, getting fragmented. Since Windows defragmenters can't handle system files this rarely gets solved. Something like Perfectdisk's 30day trial version of their defragmenter gets Windows systems almost as fast as the day the thing was first used.

Of course linux system files are not on an Ntfs and so they don't get fragmented and so there is no slow-down in that typically Windows way.

Regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#19

Hi,

let me take you through the steps as I see it. I don't want to destroy data or cause extra headaches if I get it wrong:

1. Boot to the LiveCD Desktop.
2. Open a terminal.
       /dev/sdb1 is the Ubuntu installation partition, and /dev/sda1 is the Windows installation partition.
       I assume I will be installing GRUB 2 on the Ubuntu partition which is sdb1, not where it is currently installed which is Windows on sda1.
3. Mount the Ubuntu partition (root). Type - "sudo mount /dev/sdb1 /mnt".
       I don't have a separate /boot partition, thus no need to mount this as well.
       They say if you have a separate home partition this needs to be mounted as well. Do I then type: "sudo mount /dev/sdb8 /mnt"?
       Also, when they talk about an Ubuntu installation partition they mean only the root partition, or should I mount all other partitions such as (in my case) /usr, /var, tmp etc?
4. Reboot into LiveCD.
5 Open terminal and type: - "sudo update-grub".

It seems simple enough although a small error somewhere.....

Let me know if this is the right syntax approach etc.

Thanks for your patience.

Jacques

Revision history for this message
Tom (tom6) said :
#20

Hi :)

Boot into your normal Ubuntu, not the LiveCd. I think the first step is to fix the external drive's boot-loader? These commands should do that ...

sudo mount /dev/sdc6 /mnt

sudo grub-install --root-directory=/mnt/ /dev/sdc

then reboot with the external drive plugged in and the bios's boot order set to look for external drives (usb drives) before internal (ide or sata) drives and then run this command

sudo update-grub

That should completely fix the MBR and boot sector and everything on sdc hopefully without affecting sdb or sda. If you then have problems booting up without the external drive plugged in then we can fix that later.

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#21

Hi :)

It is possible to use either the LiveCd or the installed Ubuntu that you already have on sdb. It really makes no difference at all, except speed. I would usually prefer to use the installed one because it boots up faster and is faster to use.

The guide specifies using a LiveCd because not many people are smart enough to have a 2nd linux installed on the same system so they don't have the option so they are forced to use a LiveCd which is about 100 times slower than a hard-drive.

Whichever you use you will have to mount the sdc6 with the same command and install grub2 to sdc's MBR and /boot with the next command. All exactly the same even if you used the LiveCd of a completely different dstro! The best option for you is to use the normal Ubuntu that you usually use because it's faster and more familiar.

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#22

Hi again :)

When you reboot near the end, just before running the "sudo update-grub" command, your step 4, that is to reboot NOT into the LiveCd. It needs you to use the newly installed grub menu to boot up and you don't get that through the LiveCd!

Also the only partition that is relevant is the / partition. If you had a separate /boot partition then that would be the only relevant partition to mount. Mostly having a separate /boot just leads to problems and confusion although some experienced "distro-hoppers" have found it useful until it causes them problems.

In linux we have to beware because there are so many different things we can do that it is worth bearing in mind that "Just because we CAN do something does NOT mean we should.". It is good to explore and try things out but that is usually best done on a 2nd machine, not your main!

The advantage of having so many different partitions for the different system folders is really only when you have them on different physical hard-drives. Then you really notice a performance increase allegedly. Some people would argue that putting the log files and stuff on an SSD would make the system a LOT faster but other people would say that the high-frequency read-writes would destroy the drive faster. When all factors have been considered people generally return to the starting point that having a separate /home and swap partition is about the most partitioning a system needs. The /home can be the last part of a drive or can be on an old slow drive without affecting performance because data gets read-ahead and cached in swap and ram. On an extremely low ram system i would try to get the swap at the front of the drive with the / immediately after. If ram was about 1Gb then having the swap after the / partition is better. With 4Gb ram a swap becomes almost pointless and could be after the /home. Errr, non SolidStateDrives tend to be faster at the front of the drive and can be half speed at the end apparently!

Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#23

Hi again!

We are only reinstall the grub boot-loader so we don't need the non /boot areas to be mounted. Since your /boot is inside you/ partition we only need to mount that.

Regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#24

Hi,

I have done these steps but still not booting with USB drive attached:
     sudo mount /dev/sdc6 /mnt

     sudo grub-install --root-directory=/mnt/ /dev/sdc

     then reboot with the external drive plugged in and the bios's boot order set to look for external drives (usb drives) before internal (ide or sata) drives and then run this command

     sudo update-grub

My BIOS does not give me the option to boot from anything other than CD/DVD's, Network, or Internal HD's. My BIOS is American Megatrends Inc.
Version 07.00T release date 04/02/01
I think I recently updated it.

I will tried reinstalling GRUB 2 on sdb.

Regards,
J

Revision history for this message
Jacques Malaprade (malapradej) said :
#25

Even after doing:
sudo grub-install --root-directory=/mnt/ /dev/sdb
Rebooting and:
sudo update-grub
The boot device is still sda1, and it won't boot with the Ext USB drive attached.
Don't know what else I can do.

Regards,

J

Revision history for this message
Jacques Malaprade (malapradej) said :
#26

Help!
I in a bit of a dilemma. I must have done something wrong because now my PC is not booting even without the usb drive attached. It comes up with a GRUB screen and a command prompt. I have tried the reboot exit and boot commands and it still won't get back to the my original settings.
Please help here. The last thing I did was unmount the sda1 drive. I also did what was originaly proposed and added the zeros to MBR of sdc1.
Please help here. Do I need to reinstall grub to sda, sdb and sdc, and reboot?
Please, please.....
J

Revision history for this message
Jacques Malaprade (malapradej) said :
#27

I can manage to boot from the Ubuntu CD. Do I need to reinstall the MBR on all the partitions?

Revision history for this message
Jacques Malaprade (malapradej) said :
#28

Hi Tom.
I need your help here. I have managed to get my PC to not boot at all. It gets to the GRUB command line. I can boot from the Ubuntu CD but all my partitions are visible as *.* GB Filesystems. It does not seem to assign the different partitions to their proper locations such as 8.2 GB Filesystem should be /. I have tried the method of mounting the sda1 partition and installing grub, but it won't allow me to mount.

Revision history for this message
Tom (tom6) said :
#29

Hi

Ok, we need to reinstall grub2 to sdb1 so i think that this should do the trick. Unplug the external drive. Boot a LiveCd session and run these 2 commands

sudo mount /dev/sdb1 /mnt

sudo grub-install --root-directory=/mnt/ /dev/sdb

then reboot into sdb1 to run

sudo update-grub

Good luck and regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#30

Hi again

If that doesn't work then try a LiveCd session to run these instead

sudo mount /dev/sdb1 /mnt

sudo grub-install --root-directory=/mnt/ /dev/sda

then reboot without the Cd so that you can run

sudo update-grub

Actually now that i have re-read the instructions i think that the second command needs to have sda at the end even tho we are installing grub2 to sdb1. That seems to be the part of the command that installs to the MBR.
Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#31

HI again

I think that grub2 cannot be installed to a Windows partition. I could be wrong but i think that is why you are having troubles there. Mount the sdb1 partition in a LiveCd session and then do the curious twist of using sda at the end of the second command as i repeat here

sudo mount /dev/sdb1 /mnt

sudo grub-install --root-directory=/mnt/ /dev/sda

then reboot without the Cd so that you can run

sudo update-grub

Good luck and regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#32

Thanks Tom,

This did the trick. I think I will have to sometime make peace with the fact that the PC won't boot with the external USB HD attached. It's still dark outside and I'll give it another go during the day. But this scare has made me appreciate that at least I could boot into my PC.

Cheers,

Revision history for this message
Tom (tom6) said :
#33

Hi :)

Have confidence! :) Now that you have recovered from a seemingly extremely bad situation you know that you can recover from the same situation if it occurs again. Also you have had experience of successfully using the 3 commands once so you have a better feel for what is going on and can do slight variations of the method that worked.

On the other hand if your bios doesn't let you boot from external drive then there is no way that installing grub2 on the external drive would make it bootable.

You might find that if you take your external drive to a different computer as it is and set that computer's bios to boot from external/usb drives then that machine will boot up to the Ubuntu that you have on there, if it's working.

A neat trick now would be to boot up your machine, plug in the external drive and then (without doing the other 2 commands) just run the update command

sudo update-grub

Good luck and regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#34

Hi Tom,

A little scare. I am over it now. So let's take it further. I have done exactly as you said above, but it still doesn't boot with USB drive attached.

A little bit more information that may be helpful. With the USB drive attached it gets past the GRUB screen for selecting an operating system, memtest etc. It seems to hang after that. When the USB drive and PC lights stop flickering, and it seems to go no further, I press Ctril-Alt-T and a text screen pops up with some information. It seems like it does not recognise the sda, sdb and sdc drives. I will boot up again an try and write down as much information that may be hlepful. Unfortunately can't screen capture, and it wont allow me to type command.
With the last boot into live CD I noticed that the drive numbers were different. sda was the Ext USB drive. Is it not that it is trying to "map" the partitions on the Ext HD with what it knows are the previous sda partitions and stops because there are no matches. I may be completely off the track here, but will give you a better indication once I have rebooted again and wrote down some of the errors.

Thanks,
Jacques

Revision history for this message
Jacques Malaprade (malapradej) said :
#35

The following was displayed:

init: unreadahead main process (314) terminated with status 5
fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
fsck from util-linux-ng 2.17.2
swapon: /dev/sdb2: read swp header failed: Invalid argument
mountall: swapon /dev/sdb2 [717] terminated with status 255
mountall: Problem activating swap: /dev/sdb2
/dev/sdc1: slean, 12499/499968 files, 146465/1999872 blocks
fsck.ext4: Bad magic number in super-block while trying to open /dev/sdb5
/dev/sdb5:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternative superblock:
 e2fsck -b 8193 <device>

mountall: fsck /var [340] terminated with status 8
mountall: Unrecoverable fsck error: /var
Serious errors were found while checking the disk drive for /var
Press I to ignore, S to skip mounting or M for manual recovery
/dev/sdc7: clean, 33/124920 files, 26296/490688 blocks
/dev/sdc3: clean, 174191/1250928 files, 966553/4999936 blocks (check in 4 mounts)
/dev/sdc6: clean, 19/62248 files, 15325/248832 blocks
/dev/sdc8: clean, 13205/5496832 files, 4378752/21968896 blocks(check in 4 mounts)
init: unreadahead-other main process (805) terminated with status 4
NTFS signature is missing.
Failed to mount '/dev/sda1': Invalid argument
The device '/dev/sda1' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
mountall: mount /media/Programs [806] terminated with status 12
mountall: Filesystem could not be mounted: /media/Programs
init: unreadahead-other main process (819) terminated with status 4
init: mounted-tmp main process (820) terminated with status 127
mountall: Event failed
init: unreadahead-other main process (833) terminated with status 4
init: unreadahead-other main process (838) terminated with status 4

I had to hard reboot and unplug the usb drive to be able to boot again.

Thanks,
Jacques

Revision history for this message
Tom (tom6) said :
#36

Hi

Ok, this is weird and "shouldn't be happening". I think we just have to accept that getting the machine to boot while the external drive is plugged in is not going to happen.

I had a feeling that something like this was happening which is why i wanted to install grub2 onto the external drive. I take it that you can't boot into a LiveCd session when the external drive is plugged in? If you can then you can find out what the external drive is called by running

sudo fdisk -l

It sounds like that will give completely different results from what has already been given.
Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#37

Hi :)

Ahah, i have just noticed your paragraph about successfully booting into a LiveCd while the external was plugged in. So, plug in the external drive and boot up a LiveCd again to try these commands

sudo mount /dev/sda6 /mnt

sudo grub-install --root-directory=/mnt/ /dev/sda

then reboot without the Cd but with the external still plugged in so that you can run

sudo update-grub

This "shouldn't work" but i bet it does!! What "should" happen is that the first of those commands complains that sda6 does not exist. If it does give that complaint then don't try the remaining 2 commands. Please let us know how this goes!
Regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#38

Hi Tom,

The following was typed and results given:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x32ae6f1f

   Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3331 26756226 7 HPFS/NTFS
/dev/sdb2 3332 7297 31856895 f W95 Ext'd (LBA)
/dev/sdb5 3332 7297 31856863+ 7 HPFS/NTFS

Disk /dev/sdc: 123.5 GB, 123522416640 bytes
255 heads, 63 sectors/track, 15017 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot Start End Blocks Id System
/dev/sdc1 1 997 7999488 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sdc2 997 1245 1999872 82 Linux swap / Solaris
/dev/sdc3 1245 3735 19999744 83 Linux
/dev/sdc4 3735 15018 90625025 5 Extended
/dev/sdc5 3735 3984 1998848 83 Linux
/dev/sdc6 3984 4015 248832 83 Linux
/dev/sdc7 4016 4078 498688 83 Linux
/dev/sdc8 4078 15018 87875584 83 Linux

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot Start End Blocks Id System
/dev/sda1 1 13417 107772021 c W95 FAT32 (LBA)
/dev/sda2 13418 38913 204796620 f W95 Ext'd (LBA)
/dev/sda5 13418 26165 102398278+ 7 HPFS/NTFS
/dev/sda6 26166 38913 102398278+ 83 Linux
ubuntu@ubuntu:~$ sudo mount /dev/sda6 /mnt
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt/ /dev/sda
Installation finished. No error reported.

I will reboot without CD and with USB drive attached and report back after sudo update-grub.

Regards,
Jacques

Revision history for this message
Tom (tom6) said :
#39

Hi :)

That is soo weird. It is exactly what i thought but it really shouldn't be happening. The default option in the boot menu when the external is plugged in probably wont work. The one listed as being on sdc1 'should' work. If it doesn't then just reboot the machine but unplug the external drive once the machine has powered down, or just as the mbord's splash screen appears.

Regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#40

Hi Tom,
I have not had any luck on this one. As soon as I "grub-update" after all above steps taken, it says that it can mount /.
I think I will learnt to live with this one. Unplugging is OK for now.
Thanks,
J

Revision history for this message
delance (olivier-delance) said :
#41

Hello Jacques, I can help you if you want.
This thread became too long, so please open a new one, with a summary of new situation (I have no time to read whole story!).
Could you also provide, as you did at start of this thread, the result of
   sudo bash boot_info_script055.sh
in http://paste.ubuntu.com/

Revision history for this message
Tom (tom6) said :
#42

Hi :)

Lol, i think if you can live with it then that is probably the best answer. If you are prepared to spend a lot of time at this then delance might have something interesting there

Good luck and regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#43

Hi Tom and others.

I will close this as I reinstalled ubuntu and the problem does not reoccur.

Thanks for your help.

Jacques

Revision history for this message
Tom (tom6) said :
#44

Hi :)
Phew. I am glad that you have totally solved this problem. That kind of work-around is annoying and difficult to deal with. On my dad's machine he has to unplug all usb devices to reboot into Windows otherwise Windows wont finish boot-up.

So, you can boot into Windows and all the rest when you like regardless of whether you have the external drive attached or not? Can you try checking the partitions using fsck on the command-line or GPartEd? Note that you can't check mounted partitions and it's probably best to avoid checking the Windows partition with anything other than the Windows tools inside Windows. It is not urgent but it might be worth doing sometime.

Good luck and regards from
Tom :)

Revision history for this message
Jacques Malaprade (malapradej) said :
#45

Tom,

Sorry I can't answer that one as I have removed every ounce of Windows from my system and repartitioned my hard disks. A new beginning as they say. Don't regret it though.

Cheers,

Jacques

Revision history for this message
Tom (tom6) said :
#46

Hi :)
That's all good. The machine probably feels fast and stable, like when it was brand new :) I need to do something similar quite soon. At work and at home ideally.
Regards from
Tom :)