ubuntu-14.04 in/boot partition insufficient solution

Source: Internet
Author: User
Tags uuid

Environment:
Ubuntu-kylin or ubuntu-14.04,
/boot Separate partition
Tools:
Ubuntu's LiveCD.

Problem:

As the original installation, look online said/boot is very small, 100M enough, so separate partition, divided 100M, the result is actually installed, my/boot only 88M (because the partition and installed after the system for the capacity of the calculation method is different).
This brings a problem, Ubuntu after a two or three days there will be some updates, each time there is a kernel update, every time that the boot/s is too small, can not be updated, it is troublesome.
So I need to expand the/boot.
/boot does not have a separate partition, this problem does not exist.

The following steps are generally required:
Data backup, repartitioning, data recovery, repair boot.

Data backup:
My partition is:/boot,/,/home,swap. The corresponding relationship between the partition and the directory is (/dev/sdax represents the partition, according to their actual situation):
/dev/sda5=>/boot

/dev/sda6=>/

/dev/sda7=>/home
So to expand/boot, you need to put/part, so the data on both partitions need to be backed up, back to home/home.
Start the login system with LiveCD and mount the/boot,/,/home three partitions:

sudo Mount /dev/sda6/mntsudomount /dev/sda5/mnt/bootsudo  Mount /dev/sda7/mnt/home

Then use the TAR command to backup the data, note that the/proc,/sys,/tmp,lost+found on the hard disk 4 directories are not backed up.

/mnt/home is the partition where you want to put the backup data, and do not back it up yourself.

You cannot use the CP for a simple copy backup, otherwise the properties of many important files will change when the data is restored.

cd/mnt/sudotar -cvf/mnt/home/boot. Tar */mntsudotar -cvf/mnt/home/rootdir. Tar bin cdrom Lib media opt root sbin usr vmlinuz boot dev etc initrd.img mnt run SRV var

Re-partitioning:

First make sure that several of the partitions that were mounted during the backup were uninstalled.

Then use Fdisk to repartition.

sudo FDISK/DEV/SDA

After repartitioning,/dev/sdax will change and need to be aware of this place.

Now the corresponding relationship of the partition becomes this:

/dev/sda6=>/home

/dev/sda7=>/boot

/dev/sda8=>/

Format the new two partitions with MKFS:

sudo mkfs/dev/sda7sudo mkfs/dev/sda8

Data recovery:
Because of the partition just now, cause/dev/sdax to change, need to reconfirm who is who (mainly according to the capacity to differentiate, also can try to mount, look inside have those files to differentiate)

Re-mount the partition for data recovery (if it cannot be mounted, reboot the system and enter LiveCD again)

sudo Mount /dev/sda8/mntsudomount /dev/sda7/mnt/bootsudo  Mount /dev/sda6/mnt/home

After the/boot,/,/home is mounted correctly, use tar for data recovery.

sudo tar -xvf/mnt/home/rootdir. tar -c/mntsudotar -xvf/mnt/home/boot. Tar -c/mnt/boot

Fix boot:
At this point, if the restart, found that the system can not boot, even the system can not be found, need to boot repair.
So now not to reboot, but to boot the fix,
See Tutorial: Repairing Grub Boot with LiveCD

One final step:
Now reboot, boot from the hard drive, find the Linux system can be found, but not boot, the screen prompts you to enter single-user mode.
Why can't I start this? Because we repartition, the partition's UUID changes, Linux does not mount the partition correctly, need to repair/etc/fstab.
Correct the UUID of the two partitions in the/boot,/, then exit the single user mode and continue booting.
Everything's fine.


ubuntu-14.04 in/boot partition insufficient solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.