Migrate ubuntu to another partition

Phillip Susi psusi at cfl.rr.com
Mon Mar 6 16:59:38 UTC 2006


Alan McKinnon wrote:
> This step is only necessary if the partition containing /boot changes. 
> This would be the case if /boot is on the same partition as /
>   

Correct. 

> It's relatively common to have /boot on it's own partition, in this 
> case the step should not be run. In fact if it is run the system will 
> be unbootable - the stage1_5 files in the boot sector (not the MBR) 
> won't be able to find stage2, menu.lst or the kernel images.
>   

It is not very common in the ubuntu community to have a separate /boot 
partition because the installer does not do it by default.  Also if you 
try to install grub to the wrong /boot partition it will not make the 
system unbootable, it will simply fail to install because it can't find 
the stage2 file.

> This can be intensely annoying and only seems to happen on the days 
> when you left the repair disc at home. A good tip if you have a 
> separate /boot is to create a symlink called "boot" in the real /boot 
> pointing to ".", and copy a working kernel, support files and 
> menu.lst to the /boot *directory* on /
>   

Why on earth would you do that?  What good does having a /boot/boot => 
/boot link in the root filesystem do?  And what good does having a copy 
of the kernel and menu.lst in the root fs do?  If grub is installed on 
the /boot partition, then that is where it will load stage2 and menu.lst 
from, and where it should load the kernel image from. 

> as root:
> mount --bind / /mnt/test
> cd /mnt/test/boot/
>   

Why make an alias with the bind mount?  Just skip the mount and cd to 
/boot. 

> ln -s . boot
> mkdir -p grub
> cp /boot/vmlinuz-xxxxxx ./
> cp /boot/grub/menu.lst grub/
>   

That is trying to copy /boot/vmlinuz-xxx onto itself, which isn't a good 
idea. 
> adjust vmlinuz-xxxxxx to suit what you have. Also copy the initrd if 
> you use that. When the real /boot is mounted these new files become 
> invisible. If you happen to botch a grub-install on a multi-OS system 
> these simple steps will save you a heap of trouble. The symlink also 
> helps prevent file not found errors if you forget where /boot is 
> while re-installing grub and get it wrong. I've made this mistake 
> more than once myself :-)
>
> alan
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060306/704e21a9/attachment.html>


More information about the ubuntu-users mailing list