Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

  1. #1
    Join Date
    Sep 2011
    Location
    California, USA
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    I have Ubuntu 12.04.1LTS, Windows 7, Slackware 14 & Fedora 18 installed in my PC. I've recently added a small SSD to it and would like to be able to boot Ubuntu (which I use more than the other OSs) from the SSD. I currently have only one partition for Ubuntu which contains everything under root ( / ) including /home. I cannot put my existing Ubuntu installation in the SSD because it won't fit. Instead I'd like to move /boot to the SSD if it's possible so I can take advantage of its faster boot-up time. Is there a way to do so without having to do a fresh install? If I can avoid it I'd rather not have to reinstall Ubuntu again.


    Installation & Upgrades seemed like the best place to post this thread but if it isn't, I'll be glad to move elsewhere.

    All I know is that I know nothing....

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Wink Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    How large is SSD?

    I have a 60GB SDD with two installs of Ubuntu including my /home. I use about 9GB including the 2GB for /home but have all data on my rotating drive. And my /home is only that large as I still have .wine with Picasa in it.

    If you just move /boot, you will only have grub & kernel not system.

    Is /home a separate partition on rotating drive? Then a new install but mounting existing /home would be very quick & easy. If not you can split /home and copy the data to a data partition on rotating drive and the hidden user settings into your SSD.

    I prefer to make each drive fully bootable without any other drive. Then when one drive fails I can still boot even if it cannot boot all the data, backup or other linked partitions.

    Data can be shared without the possible conflicts of user settings being different in different versions. I only copy some settings from one install to the next, normally. But I have to separately back up /home and the /data partition. Also saves the error of reformating a /home partition accidentally. I never reformat my /data and just configure / for install.

    Splitting home directory discussion and details:
    http://ubuntuforums.org/showthread.php?t=1811198
    http://ubuntuforums.org/showthread.php?t=1901437
    http://ubuntuforums.org/showthread.p...hlight=%2Fdata
    Link is on move home but see post by bodhi.zazen on data partition #6
    http://ubuntuforums.org/showthread.php?t=325048


    If you want to move /boot it is just like a move of /home. You have to be sure to preserve ownership & permissions and add a new entry to fstab for the /boot partition.

    To move /home uses rsync- Be sure to use parameters to preserve ownership & permissions
    https://help.ubuntu.com/community/Pa...ng/Home/Moving
    Others that really are the same with different copy commands:
    Uses cp -ax
    http://www.ibm.com/developerworks/li...lan/index.html
    http://www.ivankuznetsov.com/2008/04...partition.html
    Note: cp without -a means root takes ownership which would be a big issue
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    Join Date
    Jan 2013
    Beans
    7

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    I have a fairly similar situation: I want to move /boot from /dev/sda1 to bigger partition, /dev/sdb1. I made too small a boot partition during installation, and now the new kernel won't fit.

    System is Ubuntu Server 12.04 LTS.

    First I made an ext3 partition sdb1 for new /boot. Then copied boot files to it:

    Code:
    mkdir /mnt/boot
    mount /dev/sdb1 /mnt/boot
    cp -a /boot/* /mnt/boot/
    then I made the following changes to /etc/fstab:

    Code:
    # /boot was on /dev/sda1 during installation
    #UUID=fa813154-3586-494d-9acf-83ce02daee92 /boot           ext4    defaults        0       2
    # new /boot, sdb1. 4 GiBs for kernels.
    UUID=f016e578-c2f9-4e03-908b-6f043062134d /boot           ext3    defaults        0       2
    Question is, did I forget something, or may I reboot now from my new /boot? Is there some grub2 configuration or updating left to do?


    Thank you in forward. I'm new to ubuntuforums, and sorry if the answer is somewhere around. Didn't find the direct answer though.
    Last edited by lle; January 31st, 2013 at 11:17 AM. Reason: Added system info

  4. #4
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    I do not know copy command well and find myself getting into trouble on whether trailing / is required or not.

    I think with the / you get one level down?
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  5. #5
    Join Date
    Jan 2013
    Beans
    7

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    What do you mean?

    I copied everything inside /boot to /mnt/boot. It went okay and everything seems to be in right place. I'm just wondering, did I forget something and end up with non-bootable system.

  6. #6
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    I just make sure I have a liveCD, Boot-Repair, or Supergrub handy and try it. Actually whenever I do something like that, I have all three.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #7
    Join Date
    Jan 2013
    Beans
    7

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    First try didn't work, had to restore fstab with livecd.

    Turns out dpkg put the corrupted kernel, which ran out of space, on the boot partition and it won't boot.

    I guess I now have to remove that corrupted kernel. However, I wonder why GRUB didnt let me choose which kernel to boot, altough I pressed shift while booting.

    Do I have to install grub to same hard disk or partition as /boot?

  8. #8
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    Better to have grub2's boot loader in the MBR of the drive you are booting.

    Post the link to the BootInfo report that this creates. Is part of Boot-Repair:
    https://help.ubuntu.com/community/Boot-Info
    Boot Repair -Also handles LVM, GPT, separate /boot and UEFI dual boot.:
    https://help.ubuntu.com/community/Boot-Repair
    You can repair many boot issues with this or 'Create BootInfo' report (Other Options) & post the link it creates, so we can see your exact configuration and diagnose advanced problems.
    Install in Ubuntu liveCD or USB or Full RepairCD with Boot-Repair (for newer computers)
    http://sourceforge.net/p/boot-repair/home/Home/
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  9. #9
    Join Date
    Jan 2013
    Beans
    7

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    Looks like BootInfo uses GUI? I don't have any guis installed on server distribution.

    Anyway, I managed to copy GRUB2 configuration to the second hard drive (sdb) where /boot also now is. Also cleared the first hard drive's (sda) MBR, so only sdb's GRUB2 should now be loaded at reboot.

    I used following commands. sda was my old drive and sdb new.

    To copy sda MBR contents to sdb MBR.

    • 446 bytes - Bootstrap.
    • 64 bytes - Partition table.
    • 2 bytes - Signature

    So I backed up all 512 bytes from sda, but only restored 446 of them to sdb to preserve the partition scheme of sdb.

    Code:
    dd if=/dev/sda of=/tmp/mbrsda.bak bs=512 count=1
    dd if=/tmp/mbrsda.bak of=/dev/sdb bs=446 count=1
    To clear sda's MBR. Again to preserve partition table, I only cleared first 446 bytes.
    Code:
    sudo dd if=/dev/null of=/dev/sda1 bs=446 count=1
    Now my system boots from the new 4GiB /boot partition.

    I still weren't able to boot to my new kernel, but thats a whole new story

  10. #10
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: How to move /boot from an existing Ubuntu 12.04.1 installation to a new SSD

    You can use Boot-Repair from its own liveCD/DVD/Flash.

    You may be able to boot with Supergrub.
    http://www.supergrubdisk.org/
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •