Re: HOWTO: migrate wubi install to partition
I´m actually reading up on all the problems when upgrading to grub2, but it seems a patched wubildr found in comment #90 here:
https://bugs.launchpad.net/ubuntu/+s...x?comments=all
Fixes the boot problem when upgrading grub-legacy to grub2. Still, will not trry it yet, though I might read up some more and go ahead and do it, since I really need to move my wubi to dedicated partition soon, actually VERY soon.
Cheers!
Re: HOWTO: migrate wubi install to partition
Quote:
Originally Posted by
Praetor77
So how should I proceed if I have grub-legacy? Is there any way to upgrade grub to grub2 before proceeding with scripts?
Thanks in advance....
Try this. The following is only for wubi installs with grub-legacy.
I used it to migrate a Jaunty (9.04) wubi install. It's a vanilla install (with all updates applied) and so I make no guarantees - not tested on 9.10/10.04. Also, since the commands are manual you have to be very careful. Take backups before hand, especially the wubi files (the \ubuntu directory).
Also, note, I do not try and use grub-legacy on the migrated install as a matter of preference - I remove and replace it with grub2 (grub-pc), and this behaves differently depending on the version. With Jaunty it's version 1.96 and it's very different to the version on 10.04 (I'll describe the differences you might see).
Following example migrates a wubi install to an external drive (/dev/sdb) - root is /dev/sdb10 and swap is /dev/sdb7 - change as appropriate before cut-and-pasting (as you can easily paste a newline and then the command executes immediately).
Code:
sudo -i
mkfs.ext3 /dev/sdb10
mkdir /tmp/wubimove
mount /dev/sdb10 /tmp/wubimove
rsync -av --exclude=/host --exclude=/mnt/* --exclude=/home/*/.gvfs --exclude=/media/*/* --exclude=/tmp/* --exclude=/proc/* --exclude=/sys/* / /tmp/wubimove
mkswap /dev/sdb7
echo "RESUME=UUID=$(blkid -o value -s UUID /dev/sdb7)" > /tmp/wubimove/etc/initramfs-tools/conf.d/resume
sed -i 's:/.*[\.]disk .*::' /tmp/wubimove/etc/fstab
sed -i 's:/.*/disks/boot .*::' /tmp/wubimove/etc/fstab
echo "UUID=$(blkid -o value -s UUID /dev/sdb10) / ext3 errors=remount-ro 0 1" >> /tmp/wubimove/etc/fstab
echo "UUID=$(blkid -o value -s UUID /dev/sdb7) none swap sw 0 0" >> /tmp/wubimove/etc/fstab
mkdir /tmp/wubimove/host
cp /etc/resolv.conf /tmp/wubimove/etc
for i in dev proc sys dev/pts host; do mount --bind /$i /tmp/wubimove/$i; done
chroot /tmp/wubimove
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl
apt-get -y remove lupin-support
apt-get -y purge grub grub-common
mv /boot/grub /boot/grubold
#... continues below
This part installs grub2 - if you are on 10.04 it will automatically generate grub.cfg and prompt you where to install the bootloader. If you are on 9.04 and probably 9.10 you have to do it yourself (lines in italics).
Code:
apt-get -y install grub-pc grub-common
update-grub
grub-install /dev/sdb
rm /sbin/initctl
dpkg-divert --local --rename --remove /sbin/initctl
exit
for i in host dev/pts dev proc sys; do umount /tmp/wubimove/$i; done
rmdir /tmp/wubimove/host
umount /dev/sdb10
update-grub
exit
exit
Re: HOWTO: migrate wubi install to partition
It kinda worked! I got a grub rescue console, booted up with a Live USB, did:
sudo mount /dev/sda6 / mnt (I moved my wubi installation to an ext4 sda6 partition)
sudo grub-install --root-directory=/mnt/ /dev/sda
reboot and done! will post again after sudo update-grub and reboot...
Re: HOWTO: migrate wubi install to partition
Quote:
Originally Posted by
Praetor77
It kinda worked! I got a grub rescue console, booted up with a Live USB, did:
sudo mount /dev/sda6 / mnt (I moved my wubi installation to an ext4 sda6 partition)
sudo grub-install --root-directory=/mnt/ /dev/sda
reboot and done! will post again after sudo update-grub and reboot...
OK... if you have problems, you just need to reinstall the windows bootloader and you should be back where you started. It's strange you got grub rescue - that means you installed grub but it couldn't find the Ubuntu partition when you booted! Unless you did this by accident from the wubi install - not in chroot - then it's unusual.
PS. The reason I used ext3 is that wubi installs prior to 9.10 were on ext3.
Re: HOWTO: migrate wubi install to partition
Thanks for everything, worked perfectly. I had a 9.10 installation, but had grub-legacy for some reason, I suppose I upgraded from 9.04, don't really remember.
Thanks again!
Re: HOWTO: migrate wubi install to partition
Quote:
Originally Posted by
Praetor77
Thanks for everything, worked perfectly. I had a 9.10 installation, but had grub-legacy for some reason, I suppose I upgraded from 9.04, don't really remember.
Thanks again!
OK cool. Glad it worked out!
Re: HOWTO: migrate wubi install to partition
Would like to pop in to say thank you very much for the script. Worked great and with a little bit of work on the Windows 7 side I managed to transition smoothly. Keep up the awesome work.
Re: HOWTO: migrate wubi install to partition
Quote:
Originally Posted by
elrics_fate
Would like to pop in to say thank you very much for the script. Worked great and with a little bit of work on the Windows 7 side I managed to transition smoothly. Keep up the awesome work.
Great :) I appreciate the feedback... enjoy!
Re: HOWTO: migrate wubi install to partition
Worked like a charm. I used your script
Re: HOWTO: migrate wubi install to partition
Quote:
Originally Posted by
rneuls
Worked like a charm. I used your script
Great :)
Yeah I expect most people would use the script. The manual commands are good if you want to know what the script is doing without having to wade through all the bumph (additional error checks, decision making, variable substitution) that makes it hard to read.