Jump to content

Xubuntu on USB key


Recommended Posts

I have just Installed Xubuntu on a 4Gig USB key from the live CD via an XP laptop. I have been learning about linux for the past 3 years and no longer use Windows at home (Mandrake 10.1 Community). The laptop in question is for business use when I need to work from home or when travelling. Therein lies the problem. Since I installed Xubuntu on the USB key the only way I can access XP on the laptop is if I have the Xubuntu USB key inserted during the start up routine. At first glance this seems to be quite an attractive security feature however, I am worried that I may loose the USB key or it becomes corrupt or damaged. I would like to get the laptop to boot up straight into XP without the USB key inserted. I have tried a system restore under XP but it didn't work. From what I can discover from other threads it seems I may be able to edit the boot menu. I would appreciate some advice as to how to resolve this issue. Here is the output from <sudo leafpad /boot/grub/menu.1st>

 

title Ubuntu, kernel 2.6.20-15-generic

root (hd1,0)

kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=e43bdc26-584e-471a-96f3-c735ef8d4de8 ro quiet splash

initrd /boot/initrd.img-2.6.20-15-generic

quiet

savedefault

 

title Ubuntu, kernel 2.6.20-15-generic (recovery mode)

root (hd1,0)

kernel /boot/vmlinuz-2.6.20-15-generic root=UUID=e43bdc26-584e-471a-96f3-c735ef8d4de8 ro single

initrd /boot/initrd.img-2.6.20-15-generic

 

title Ubuntu, memtest86+

root (hd1,0)

kernel /boot/memtest86+.bin

quiet

 

### END DEBIAN AUTOMAGIC KERNELS LIST

 

# This is a divider, added to separate the menu items below from the Debian

# ones.

title Other operating systems:

rootGrub Bootloader Issue

 

 

# This entry automatically added by the Debian installer for a non-linux OS

# on /dev/sda1

title Microsoft Windows XP Professional

root (hd0,0)

savedefault

makeactive

chainloader +1

 

By the way - I have tried many live Linux CD's over the past 3 years to find the Linux flavour that I like. From what I have seen so far Xubuntu is the most user friendly in getting must have applications and utilities (like wireless internet) up and running quickly. (Puppy was the easiest to install) Nevertheless I have stuck with Mandrake on my desktop because it works for me :)

 

Thank you in anticipation.

Link to comment
Share on other sites

Thyere's nothing to edit in menu.lst, as the primary loader will look for files in your USB key, and fail to load if it isn't present.

I will describe a method which will always work (hopefully!).

1. Move grub to the USB key root partition.

2. Remove the key, insert the XP installation CD in the drive and hit the reset button. Enter BIOS, and make the CD-ROM first boot device, and local HD the second. Save and boot the CD.

3. Booting from the installation CD, pick recovery mode and give first the "fixboot" and then the "fixmbr" commands. Your XP should be bootable now by themselves (reboot to verify).

4. Change the boot order in your BIOS to boot the uSB key, and boot Xubuntu from the pendrive. If you don't have ntfs-3g installed, do it now.

5. I'm assuming your pen drive as /dev/sdc1 - if not, change it accordingly (you can get your info either from gparted of cfdisk). Mount your XP partition somewhere (assuming /media/winxp).

Open a root console, and

dd if=/dev/sdc1 of=/media/winxp/xubuntu.bin bs=512 count=1

6. Shutdown the system, remove the key, change the boot order in BIOS again, and boot XP. Open as Administrator the file boot.ini (it's in the root of the windows drive, and it's hidden). You can also edit it indirectly, via control panel / system / advanced tab / startup & recovery. It should be looking like that:

boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect[code]
Add at the end of the file a line
[code]C:\xubuntu.bin="Xubuntu 7.10"

(or you can substitute "C:\" with "multi(0)disk(0)rdisk(0)partition(1)\").

6. Now you should be able to boot your USB stick using the windows loader. Correct?

 

A second workaround: repeat steps 1-3, and now install GaG (gag.sourceforge.net) as primary bootloader. It is using the MBR only, so it should work even with the USB-key not present.

 

If everything is working, you can remove the Windows XP entry from menu.lst (although keeping it for use in another computer with luckily the same boot structure may appeal to you).

 

By the way, Xubuntu is one of the poorest XFCE4 implementations I've seen (unless you don't mind installing virtually the whole Gnome monty as well)... Both Zenwalk and Sam beat it hands down.

Edited by scarecrow
Link to comment
Share on other sites

Thyere's nothing to edit in menu.lst, as the primary loader will look for files in your USB key, and fail to load if it isn't present.

I will describe a method which will always work (hopefully!).

 

Thank you very much for your detailed reply scarecrow. That looks like about 4 hours work at my productivity rate. Its going to be 39 degrees here in Melbourne on Thursday and my wife is going shopping. That is when I will take a crack at your # 1 solution. However before I attempt it (excuse my lack of savvy) - how do I move grub into the USB key root partition?.

 

When I've done that Iĺl have a look at Zenwalk and Sam - (USB keys are pretty cheap these days and I am a compulsive tinkerer). Thanks again.

Link to comment
Share on other sites

You boot normally from the USB key, load Xubuntu and all that.

I will assume the USB key is /dev/sdc - if not, change it accordingly.

Open a ROOT console, and give

grub-install /dev/sdc1

(it will take some time to do it, maybe one minute)

This will work if /dev/sdc1 is bootable, but it is, by default (flagged so when you installed Xubuntu in it).

That's all, folk.

PS: I do not think you will need 4 hours for that. For me, it is < 10 minutes when I'm totally drunk... :P

Edited by scarecrow
Link to comment
Share on other sites

Thanks again scarecrow. Well I've got some good news and some bad news. The good news is that the notebook is now booting straight into XP and everything is intact. :) After reading your latest post I decided to give it a go and, following your instructions managed to move grub to the USB key (sdb1). I then booted from the CD but I couldn't get to a recovery mode screen - instead I go to a "do you want to install XP on the indicated partition". I thought I wander if this will get me to recovery mode? and hit enter. I got to another window which basically said "do you really want to do this" (my language). Thankfully I bottled out - there was a time when I would have kept going but the voices of all those IT guys at work down the years started ringing in my ears - so I escaped out and rebooted without the USB key or CD. I don't know why but it booted straight into Windows :unsure:

 

I thought - scarecrow has taken a lot of trouble to help me with this so I'm going to try to follow the rest of his instructions - so I changed the Bios settings again and tried booting from the USB key. I got on a black screen a menu with 4 boot options - the first three Ubuntu options and the last MS Windows XP. So I hit "enter" on the first Ubuntu option and got :-

 

Error 17: Cannot mount selected partition - press any key to continue - which took me back to the boot menu (same result with recovery option).

There were some options to edit the various menu items which took me to a command line :-

root hd01 - grub bootloader (or something very similar) - at which point I bottled out again.

 

So now my (work) notebook is back to normal but I can't boot into Xubuntu. :wall:

 

Perhaps (in the light of your comments about Zenwalk and Sam) I should allocate this USB key to a new project :D. Or do you think I should have another Dip? PS - how do you know if you've got ntfs -3g installed and if you haven't, how do you install it?

 

Cheers.

Link to comment
Share on other sites

Perhaps (in the light of your comments about Zenwalk and Sam) I should allocate this USB key to a new project :D. Or do you think I should have another Dip?

 

Sorry scarecrow - not a fair question on my part. I have decided to press on. I am now at the stage where the Windows bootloader gives me an option to boot into XP or Bin. When I select Bin i get a message telling me that I have to re install a file called root/system hal.dll which is either missing or corrupt.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...