Dual system Ubuntu partition expansion process record

Source: Internet
Author: User
Tags gparted

I installed the WIN10 + Ubuntu 12.04 dual system on my computer. Some time ago because of the project on Ubuntu to install a relatively large software, resulting in the Ubuntu root partition space is not enough. Then, from the hard disk and part of the space to give Ubuntu. So with this Ubuntu expansion process record, can also be considered as a tutorial bar.


1. Causes

Recently doing a project on the kinectfusion algorithm, need to use Cuda. But when I installed Cuda in my Ubuntu, I was prompted that there was not enough root partition space to complete the installation.

 
   
  
  1. Not enough space on parition mounted at /.
  2. Need 3548872704 bytes.
  3. Disk space check has failed. Installation cannot continue.

As a result, we started to expand the Ubuntu partition.

2. The status of each partition before and after expansion

Before this expansion, the status of each partition on my entire hard drive is as follows:

(Note: The GParted software installed in the Ubuntu system prior to partition expansion is displayed.) )

It can be seen that at the end of the entire hard disk there is about 20G space allocated to Ubuntu, and divided into several partitions, in order:

    • /bootPartition 190M
    • swapPartition (virtual memory partition) 3.81G
    • /partition (root partition) 11.44G
    • /homePartition 4.55G

(Note: The partition size shown above is less than the actual partition size because partition formatting requires a portion of space)

After the expansion operation, the final Ubuntu partition status is as follows:

(Note: The following similar images are shown in the GParted software in the parted Magic boot disk during partition expansion.) )

As you can see, the total space allocated to Ubuntu has increased by 15G, and the order of the Ubuntu partitions has been adjusted, sequentially:

    • /homePartition 9.55G(increased by 5G)
    • /partition (root partition) 21.26G(increased by 10G)
    • /bootPartition 190M
    • swapPartition (virtual memory partition) 4G

PS: The reason for adjusting the order of the partitions is:

    1. /bootpartitions and swap partitions generally do not need to be scaled up, meaning that they will not change in the future, so put them on disk at the end;
    2. /homepartitions and / partitions may be expanded again in the future, and the space required for expansion is compressed from the previous Windows partition, so it is placed near the Windows partition.
3. Partition expansion Operation steps

Below is a detailed record of partition expansion operation steps.

(1) Making parted Magic starter disk

Parted Magic is a lightweight Linux release (can be used to make USB drive boot disks) and contains many free software that can be used for hard disk partitioning and data recovery.

Reference: Parted Magic partition magician 2015.11.15-dev version Bios,uefi-no update-USB ScanDisk-worry-free start forum-Powered by discuz!

: Http://pan.baidu.com/s/1pJ6vlgR

I downloaded the image file pmagic_2016_03_02.iso .

After the download is complete, insert the USB flash drive, open with UltraISO pmagic_2016_03_02.iso , then click the Menu "Start", "Write to Hard disk image" and then click "Write" to start making the boot disk.

After the production is finished, unplug the USB stick.

(2) Start the computer from the USB stick

Insert just the USB stick into the computer, and then restart the computer, choose to boot from the USB stick (specific operation according to different computer models, this does not repeat).

After booting from the USB stick, you will see the following interface of the boot disk system:

(3) Open gparted partition software

Open the GParted partition software by double-clicking the icon on the desktop:

(4) Adjusting the partitioning sequence and expanding

Because you want to adjust the partitioning order, you first /home copy the partition to the previously unallocated portion of the disk, and then /boot move the partitions and swap partitions to /home the same location as the original partition. The steps are as follows:

① Copy the partition to the front of the /home unallocated disk portion of the previous spare, and resize it to 9.55G;
② Delete the original /home partition;
swap Copy the partition to /home the last end of the original partition and resize it to 4G;
/boot Copy the partition to the original /home partition swap after removing the remaining portion of the last end of the partition, that is, immediately adjacent to the current partition, the size of the swap same (note: This step will be Free space sollowing set to 1M, otherwise it will be wrong, but forget what was wrong);
⑤ Delete /boot The original partition and the original swap partition;
⑥ Adjust the / partition size so that it fills all remaining space.

(5) Repair startup

Reference: gparted–frequently asked Questions
Fixing Operating System Boot problems

The partition expansion is now complete, but if you restart at this point, you will find that the system is not starting properly because the partition changes cause the bootstrapper to fail.

It is therefore necessary to repair the boot.

Or in the Startup disk system, open the terminal, i.e. click on the icon in the taskbar below:

Execute the following command (as root):

  
 
  1. mkdir /tmp/mydir
  2. mount / dev / sda8 / tmp / mydir (note: the '/dev/sda8 ' "/' partition identifier, modify it to your own '/' partition identifier)
  3. mount /dev/sda11 /tmp/mydir/boot (注:同上,`/dev/sda11`为`/boot`分区标识)
  4. mount --bind /dev /tmp/mydir/dev
  5. mount --bind /proc /tmp/mydir/proc
  6. mount --bind /sys /tmp/mydir/sys
  7. chroot /tmp/mydir (此步可能输出一些信息,可以无视)
  8. grub-install /dev/sda (注:其中的`/dev/sda`为`/`分区所在硬盘的标识)
  9. exit

Here's what I'm doing with the above command:

(6) Rebooting the system

Reboot the system and get it done!



From for notes (Wiz)

Dual system Ubuntu partition expansion process record

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.