I installed ubunt on my external drive with the live CD. But now I can't startup without my external drive...

Asked by Vanostaajen

I installed ubuntu on external hard drive.

And it works fine. But it puts my regular ubuntu(on my internal drive) under others. So in one way or another my external drive is my primary drive. And my computer doesn't start up without it. (GRUB error 21). How do I resolve this?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
Tom
Solved:
Last query:
Last reply:
Revision history for this message
Best Tom (tom6) said :
#1

The boot-loader has it's menu stored on your external hard-drive now.

The easiest way around this that i know is to install a linux on your internal hard-drive, preferably while the external one is attached.

If you have lots of hard-drive space (>5Gb) then i'd recommend using Ubuntu but if free-space is less than 1Gb then one of the tiny distros would be better. Personally i'd go with Wolvix because its easy to install and configure and it's always saved me in these sorts of cases. Check it (& others) out in DistroWatch;-
http://distrowatch.com/table.php?distribution=wolvix
or just go download it from halfway down this page
http://wolvix.org/get.php
This has Gparted which is great at resizing your internal hard-drives partition (unless it's got Vista - in which case try resizing the partition from inside Vista)

It's just a case of resizing your internal hard-drive down by enough to do an install of a linux. At the end of the install the linux will load a new boot-loader that should give you 3OS's to boot from but it's menu will then be on your internal hard-drive and will be easy to configure.

Welcome to linux btw & i hope you have as much fun as i have

Regards from
Tom

Revision history for this message
Vanostaajen (tvodeslimme) said :
#2

Thanks for the welcome :-)

My start with linux was quite problematic as I (instead of dualbooting) totally formatted my HD:p and lost vista. I also had to reinstall ubuntu for some bizarre reasons after I had it for a week(so I lost everything 2 times). And that all happened during "blok" (dutch word for vacation which is meant or studying) so I quite freaked out.

Anyway inbetween learning I learned some more about ubuntu and know my system is tweaked to my perfection.

anyways thanks fior the help but only one more question: how do I delete the extra ubunt(so yes I have 5 gig free space) I installed?

and second is there anyone who knows a way around this because I'm scared to accidentally delete my current ubuntu...

love,
Thomas

Revision history for this message
Vanostaajen (tvodeslimme) said :
#3

Thanks Tom, that solved my question.

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

Lol, thank for giving me karma points there :)

I'm not quite clear what the current state of play is. Wiping Vista seems like a great start but losing data is always sad. Still now you're free of Vista you can enjoy freedom instead ;) Are you sure you didn't do that on purpose? Sadly its quite easy to avoid. It's just that when you're installing and get to the bit when it asks about Partitioning you have to choose Manual Partitioning rather than Automatic.

Yes there are loads of helpful Tutorials and Walk-throughs on how to install a boot-loader without installing an operating system but i can never find one that works for me. Google for "boot-loader install" or something like that or go straight to the Grub home page http://www.gnu.org/software/grub/
One advantage of this route is that you can always try my way when/if it doesn't work.

I usually get my Wolvix disc and shave 1Gb off the end of the drive with Gparted then split that space into 2 partitions - a small 100Mb Linux-Swap and the rest as ext3. Then installing Wolvix is easy via the Manual Partitioning route again. After it's installed i shrink its partition's right down almost as far as it'll go and sometimes find menu.lst to tweak that. Most other tiny distro are good for this but i find Wolvix is reliable in installing where others fear to.

Anyway, whichever way you try - Good luck and enjoy the ride.
Seems like you are soon going to be fairly expert with Linux.
Regards from
Tom

PS i'm still a noob in Linux but i have found out a few things :)

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

Err, i've just realised that you sound as though you have already completely installed Ubuntu on your internal drive already. Wow that was fast :)

Does the Multi-boot work going into Windows even without the external hard-drive plugged in? Also when the external is unplugged you get into the less refined Ubuntu? And with the External plugged in you can get into that refined one too?

So the next question is about reducing the space the unrefined Ubuntu takes up?

Revision history for this message
Vanostaajen (tvodeslimme) said :
#6

ow, I think you got me wrong here.

I have ubuntu on my internal hard drive (nothing else) since mid december.
yesterday I installed ubuntu on my 500gig external hard drive(I've let it take a partition of 140gig).
So all Ihave installed right now is 2 ubuntu's. but I have the license to instzll vista.

I'm not quite fond of vista, but it's important to me so I can play games. So I'll probably reinstall it when I've got time. And then I'll tell you how dual boot works out.

But at this time I just can't start my computer without my ext. drive.

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

Easy then (i think) - just work out what's different between your grub folders on your external and internal drives. Look in /boot/grub - obviously you'll want to copy menu.lst across to your internal drive but you'll also need to work out how to configure the grub 1st stage to look internal rather than external. I'd recommend posting another question with a subject line of "Grub stage1 - how to configure?". I'm sure it's probably just a case of changing some text that says /sda1/boot/ to /hda1/boot/ but i don't know where and i've not tried it.

lol, that's a completely different way of setting up - i've never seen it done that way before. It should be better that way i'm sure. Nice one :)

I'm guessing you've tried Wine without success, it can be very fiddly and each game needs different tweaks. There's nothing wrong with using Windows (see Bug #1) at the moment but hopefully one day Linux will be so rife that we're not forced into it.

Good luck with this, please let me know if you fix it and how you did :)
Regards from
Tom

Revision history for this message
Vanostaajen (tvodeslimme) said :
#8

Hi Tom,

I couldn't figure out what to do exactly, and I was a bit afraid of installing a new distro. So I asked what I should do at Linux questions .org and there they advised me to this:

sudo grub
root (hd0,0)
setup (hd0)
quit

and it worked :-D
But now I can't boot the ubuntu on my exernal hard drive anymore. But I'll figure that out later.

I allways wonder how they come up with these commands...

Regards,
Thomas

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

Ahah

Great now that you're booting into Ubuntu on your main internal hard-drive i can actually really help at last :) WoooHooo, rofls

When you're in Ubuntu on your main internal hard-drive 'simply' add a few lines to your grub's menu.lst to add your external drive into the 'list' (hence lst). Sadly i can't remember the gui way for this in Ubuntu but go to

Places menu - Home folder

Now use the Up button to get as far back as the Root folder "/" rather than "/home" or anything. then navigate into

/boot/grub

find the menu.lst file copy it so that there's a back-up and then right-click the menu.lst it to open with a text editor (perhaps through "Other Applications..." option on that right click sub-menu). Now near the end of that copy the lines that say something like

title Ubuntu 8.04.2, kernel 2.6.24-23-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-23-generic root=UUID=66daaabd-ec15-4184-9ee5-df800b17fde2 ro quiet splash
initrd /boot/initrd.img-2.6.24-23-generic
quiet

and paste them so that you have 2 blocks the same. Now in the 2nd block change the bit that says

root (hd0,0)

to something like

root (hd1,0)

or

root (hd1,2)

better still look in your external drives filesystem, find the menu.lst in there and copy the equivalent lines into the menu.lst on your main hard-drive (the one we've been looking at). At the very worst it'll be good to see what the numbers should be in the

root (hd1,??)

It's possible but unlikely that your extrnal drive is seen as something other than hd1, it might be sd2 or something like that so looking in the external drives menu.lst will tell you for certain :)

Sorry it's a bit uncertain butyou'll see what i mean easily when you open both of the menu.lst files. If your external drive has a Windows partition be sure to copy that block from the external drive too, make sure you copy the chainloader part if you do. Note that the first block in the menu.lst is probably the default that the boot menu will try to boot into.

Awesome when the boot up menu appears with things you've added to it :)
Even more awesome when you've tweked it enough to work properly. Note this is the kinda time when it's handy to have a LiveCd you can use to put things right again or to tweak things with. The Ubuntu Cd is good for this but i tend to use a tiny distro such as Wolvix because you don't need to wait around for tons of apps to load - you just need a file-browser and a text-editor...
http://distrowatch.com/table.php?distribution=wolvi

Anyway, good luck and have fun
Regards from
Tom

PS thanks for letting me know how you fixed the initial problem :)

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

Hmm that block didn't look quiet right. It's more like

title Ubuntu 8.04.2, kernel 2.6.24-23-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-23-generic root=UUID=6-blah-blah-de2 ro quiet splash
initrd /boot/initrd.img-2.6.24-23-generic quiet

but often looks much simpler than that. I like to change the 'quiet's to 'verbose' so i can see what's being loaded during boot up rather than just have a progress bar

Anyway, good luck with this & have fun :)
Regards
Tom :)

Revision history for this message
Vanostaajen (tvodeslimme) said :
#11

Well,

it worked:D

First I had this code:

title Ubuntu external 8.10, kernel 2.6.27-9-generic
uuid 21592602-9305-4948-b7e5-19c36bbc5ae0
kernel /boot/vmlinuz-2.6.27-9-generic root=UUID=21592602-9305-4948-b7e5-19c36bbc5ae0 ro quiet splash
initrd /boot/initrd.img-2.6.27-9-generic
quiet

from some dude at LQ.
but I didn't know where to put it.

But then I read your post and it clearly told me where to put it.

And now I'm writing this mail in a firefox installed on my external hard drive.
Thanks!

the verbose thing is something I'll maybe ad to my internal. Because my external is for showing ubuntu to other people on their computer. I just need to figure out how to boot on a windows pc.

anyway thanks for the help, you are very kind:-)

Do you mind adding me (tvodeslimme"at"hotmail"dot"com (I do hope you don't speak dutch) to your messenger? In that way I can ask you questions directly if you don't mind.
You don't have to ofcourse.

thanks,
Thomas.

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

Lol, i don't really do friendships very well and avoid instant messenger services. You can always contact me through my Launchpad profile.

I've had a lot of practice at installing Linux but other people are better at other things and there's also a few things i haven't tried such as; setting up a bios' boot-order to choose external/usb before internal; or using the boot-loader that sits in Windows and can boot linux (the reverse of the grub boot-loader that sits in linux and can boot Windows). What i have managed is to shave 1Gb off the end of a drive and install a tiny distro (Wolvix is easy & reliable for this), then edited the grub by 'commenting out' (adding a # character to the beginning of) any Linux options. This meant it only booted into Windows. The advantage was that grub is stronger, better and easier to adjust later - fixing a Windows boot-loader is trickier.

I notice the LQ block misses the "root (hd1,0)" part which i thought was crucial. Still "if it works, use it" :)

Thanks for your kind words
Regards from
Tom