<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>I had a preseeded
mini.iso set up and working just the way I wanted to. Then I found that I wanted
to also make a version that could be installed from a USB pendrive using
boot.img.gz (for systems without cd drives). I copied the necessary config lines
from isolinux to syslinux, extracted the boot files, made my usb key bootable,
etc. </FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>When I boot the
computer from the USB drive, the pendrive gets labeled /dev/sda (hard
disk is /dev/sdb), but when I remove the usb pendrive and reboot, the hard disk
is labeled /dev/sda!</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>This caused me a few
problems:</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>1. I seem to need
separate preseeds for CD and USB installation. The CD version installs Ubuntu to
/dev/sda, and the USB version needs to install to /dev/sdb and has to do the two
following workarounds:</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>2. By default Ubuntu
appears to install GRUB onto the MBR of /dev/sda if left unspecified in the
preseed. Going through it manually, it didn't seem to give me the option of
where to install grub (other than "in the MBR", or "specify a partition"- maybe
I needed to specify the MBR of sdb?). It was easy enough to change the preseed
line to install grub to /dev/sdb for usb, given that I already seem to need two
preseed files.</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>3. (the bigger
problem, it seems) Although /etc/fstab and the kernel lines in
/boot/grub/menu.lst's use the disk's UUID (thankfully), /boot/grub/menu.lst
contains the line "root (hd1,0)" for each kernel entry. When we remove the
USB disk and boot from the hard drive, the hd becomes (hd0,0) and grub will give
me an "Error 21: file not found (or something lke that)". The only way I have
been able to work around this is to add the following to my
preseed</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>d-i
preseed/late_command in-target cat /boot/grub/menu.lst | sed -e
"s/hd1/hd0/" > /boot/grub/menu.new; mv /boot/grub/menu.new
/boot/grub/menu.lst</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>Doing the above
seems to make it work, but if anyone can think of a better/smarter way to avoid
any of the above issues, I would greatly appreciate it. My ideal situation is to
have one preseed that works regardless of installation media type, but I am
willing to maintain two preseed files if necessary. The sed command seems
unclean and hopefully there is some better way to deal with
this.</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial size=2>On a similar note, I
went through the installation without a preseed, and I ended up with the system
installed to the hard disk, but grub was installed to the MBR of my usb drive!
Not a good thing for people who are new to this- then again, they might not be
using a usb image to install ;)</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2>-Kevin</FONT></SPAN></DIV>
<DIV><SPAN class=109202302-13112007><FONT face=Arial
size=2></FONT></SPAN> </DIV></BODY></HTML>