Use GParted-LiveCD to adjust the Ubuntu partition size

Source: Internet
Author: User
Tags gparted
Use GParted-LiveCD to adjust the Ubuntu partition size. 1. Prepare 1. download the latest gparted image file: click here. 2. Burn the gparted image file into a CD or press it on a USB flash disk to make it into LiveUSB3. Although this is a lossless adjustment, it is safe (in case of a power outage ?), It is recommended to back up important data to the mobile hard disk 4, in the BIOS, set the boot sequence to the first drive boot (if LiveUSB is used, should be set to USB-HDD) II, adjust

Use GParted-LiveCD to adjust the Ubuntu partition size

I. Preparation

1. download the latest gparted image file: click here.

2. Burn the gparted image file into a CD or press it on a USB flash drive to make it a LiveUSB

3. Although it is a non-destructive adjustment, but to ensure safety (in case of a power outage ?), We recommend that you back up important data to the mobile hard disk.

4. In BIOS, set the boot sequence to first enable the optical drive (if LiveUSB is used, it should be set to USB-HDD)

Ii. Adjust partitions

1. Add the CD to the optical drive (if LiveUSB is used, plug in the USB flash drive) and restart the computer.

2. Go to the gparted startup interface and select Defalt settings.

3. Press enter on the second page.

4. Select the language and enter "26" and press enter (Simplified Chinese, though incomplete in Chinese)

5. Enter the X-Windows interface and press Enter.

6. When you enter gparted, you will find the interface similar to the ending PQ. The actual operation is the same, and the adjustment to the ending partition is also supported.

7. Click the partition where you want to free up the space. Right-click the partition and choose "Resize/Move" from the shortcut menu"

8. Use a mouse hold or a number to precisely adjust the size of the space to be released. To release the control bar on the left side of the partition header (enter the value of the first line ), to release the control bar at the end of the partition (enter the value of the third row), adjust the bar and click "change size/move.

9. Click the partition to expand the capacity. Right-click the partition and choose "Resize/Move" from the shortcut menu"

10. follow Step 1 to increase the partition capacity.

11. Click the "Edit" menu and select "Apply All Operations"

12. After you confirm that you want to adjust the partition capacity, gparted starts to adjust the partition, and then click "Close ".

13. Click "gparted", select "Quit" to close the gparted window, and double-click "Exit" in the upper left corner to Exit the gparted system.

14. Select "Reboot" in the pop-up window to restart the computer. When you exit, the system will prompt you to remove the disc.

Iii. Possible Problems

Swap partition may be lost. You can run the "free-m" command on the terminal to check whether the swap partition is activated (whether the capacity is displayed). If not, activate the "sudo mkswap/dev/sdaX" command (X is the number of the swap partition, replace the activated UUID with the UUID code of the original swap partition in the "/etc/fstab" file (administrator privilege required). After restart, the mount will be automatically activated.

Warning exercise caution when activating swap partitions and modifying fstab files. Check the modified values carefully.

------------------------------- Read extension 1 -------------------------------

Ubuntu partition adjustment and/home directory migration are successful

First look at a graph. This is my hard disk. Of course, UBUNTU is installed in the ext3 partition. Because the installation of the system is too good. Therefore, only one ext3 partition is allocated. Therefore, many important directories are placed in this area. Later I realized that this was not good. For example, it is very important that the/home directory for personal settings cannot be independent. So I thought of the partition adjustment method. Before the adjustment, the swap active partition is 2 GB (later I realized that it is a waste of 1 GB memory), and The ext3 partition is 8.6 GB.

This is an adjusted image. Let me talk about the adjustment process. Start the computer with live CD so that the system in the hard disk is not occupied. Delete the swap partition first. Release 2 GB of free space and create a new swap, which is equivalent to my memory. However, it is a little stretched to mount the space of the G to/home. Anyway, the available space for ubuntu is only a little more than 10 Gb. The other partitions are NTFS and contain the XP system. Now ubuntu supports the NTFS partition format. Therefore, the existing NTFS partition does not have to be adjusted. If the 10 Gb UBUNTU partition is not enough, you can put the document on the NTFS partition. However, the value of/home in the same format as ext3 should be as large as possible. The thought/directory does not have to be as big as 8.6 GB. It just installs a system, and the installed software is almost installed. Only the/home directory is constantly expanding. Therefore, adjust the/directory capacity to the/home directory. Now, after my/home directory is sorted out, it should be at least 350M. At least adjust a G directory to the/home directory from the/directory. LiveCD is also used to start the operation. At this time, all partitions of the hard disk are released, which makes it easy to adjust. Start the partition manager in the LIVE system to easily adjust the partition size. First, change the/directory to 7 GB. Then, the free space of 1. 6 GB is released. Add the space to the/home directory.

The actual operation took about 30 minutes. The partitioning management tool of ubuntu is very cautious. After each important adjustment, the entire partition should be fully checked once. Although it takes a lot of time, it is a responsibility for both the user and the user.

Finally, migrate the/home directory on sda9 to the sda10 partition and implement automatic mounting. It is also done through the liveCD system. However, you must have the root permission. This is simple. Although the ROOT password of the live system is a random password, you can change it in user management. With ROOT, you can easily move the/home directory to sda10. Then modify the/etc/fstab file in the sda9 partition and mount sda10 to/home automatically. Of course. Do not forget to have the/home directory under sda9. The directory is empty. After the system is started, sda10 is automatically mounted to the/home directory of the system. Therefore, the/home directory exists in a separate partition.

------------------------------- Read extension 2 -------------------------------

Adjust/home partition size in Ubuntu

1. Background

Recently, I have to install Ubuntu10.04 on my company's computer. I have already installed Ubuntu 9.10 and it is easy to use. Since the hard disk on the computer is only 80 GB, the rest is mounted to the/home partition. Obviously,/home cannot be detached normally. Except for the root user's home/root, the home of other users is in the/home partition. In order to install 10.04, and do not want to throw 9.10, you need to adjust the size of/home during the activity.

2. Use root to log on to the system

You can use the recovery mode at startup to enter the system, and then select root to log on. You can also press Ctrl + Alt + FN (N is 1 ~ 6) log on to the console as the root user. After logging on, unmount the/home partition.

# Umount/home

3. Adjust the partition size

In gnome, there is a very useful tool called gparted to adjust the partition size, but before the operation, you need to unload the partition. Then you can adjust the size. Because the console is used for logon, use the startx command to enter the X window Interface.

4. Another method to corrupt partition data

Before the above simple method succeeds, I used a very complicated method. After logging on to the console, I also unmount the/home partition, then use tune2fs/debugfs and parted (that's right, behind the scenes of gparted) to adjust the partition size, and finally use e2fsck to check and fix the file system. Miserable, the entire partition is gone, leaving only lost + found and oh, just like re-formatting. The following describes the simple use of tune2fs/debugfs/parted/e2fsck.

Tune2fs can display the contents of the file system's super block, and can be modified. debugfs can also achieve the goal, and it looks more powerful. There is also an undel [ete] command, which looks very powerful, it has never been used. This time, we mainly used their (tune2fs/debugfs) function to adjust the file system feature.

1) debugfs

# Debugfs-w/dev/sda6-w indicates read/write. Otherwise, it is enabled in read-only mode by default.

Debugfs: features debugfs: indicates the prompt after entering debugfs. features displays the feature currently supported by the file system.

Debugfs: feature [+ |-fs_feature] add or remove feature currently supported by the File System

Debugfs: q: Exit debugfs

2) tune2fs

# Tune2fs-l/dev/sda6-l list file system super block content

# Tune2fs-O ^ fs_feature [,...]/dev/sda6 delete the file system feature

# Tune2fs-O fs_feature [,...]/dev/sda6 add File System feature

3) parted

# Parted/dev/sda

(Parted) p print Partition Table

(Parted) resize NUMBER START END

(Parted) q

The above section only describes how to use the file system feature in tune2fs/debugfs, because I only want to use this, And because parted requires that the file system cannot have too many feature, it supports only a few feature types. the usage of parted is similar to that of fdisk.

4) e2fsck

# E2fsck-f-y/dev/sda6-f indicates force, and-y indicates that all prompts are answered yes.

Adjust/home partition size in Ubuntu

1. Background

Recently, I have to install Ubuntu10.04 on my company's computer. I have already installed Ubuntu 9.10 and it is easy to use. Since the hard disk on the computer is only 80 GB, the rest is mounted to the/home partition. Obviously,/home cannot be detached normally. Except for the root user's home/root, the home of other users is in the/home partition. In order to install 10.04, and do not want to throw 9.10, you need to adjust the size of/home during the activity.

2. Use root to log on to the system

You can use the recovery mode at startup to enter the system, and then select root to log on. You can also press Ctrl + Alt + FN (N is 1 ~ 6) log on to the console as the root user. After logging on, unmount the/home partition.

# Umount/home

3. Adjust the partition size

In gnome, there is a very useful tool called gparted to adjust the partition size, but before the operation, you need to unload the partition. Then you can adjust the size. Because the console is used for logon, use the startx command to enter the X window Interface.

4. Another method to corrupt partition data

Before the above simple method succeeds, I used a very complicated method. After logging on to the console, I also unmount the/home partition, then use tune2fs/debugfs and parted (that's right, behind the scenes of gparted) to adjust the partition size, and finally use e2fsck to check and fix the file system. Miserable, the entire partition is gone, leaving only lost + found and oh, just like re-formatting. The following describes the simple use of tune2fs/debugfs/parted/e2fsck.

Tune2fs can display the contents of the file system's super block, and can be modified. debugfs can also achieve the goal, and it looks more powerful. There is also an undel [ete] command, which looks very powerful, it has never been used. This time, we mainly used their (tune2fs/debugfs) function to adjust the file system feature.

1) debugfs
# Debugfs-w/dev/sda6-w indicates read/write. Otherwise, it is enabled in read-only mode by default.
Debugfs: features debugfs: indicates the prompt after entering debugfs. features displays the feature currently supported by the file system.
Debugfs: feature [+ |-fs_feature] add or remove feature currently supported by the File System
Debugfs: q: Exit debugfs
2) tune2fs
# Tune2fs-l/dev/sda6-l list file system super block content
# Tune2fs-O ^ fs_feature [,...]/dev/sda6 delete the file system feature
# Tune2fs-O fs_feature [,...]/dev/sda6 add File System feature
3) parted
# Parted/dev/sda
(Parted) p print Partition Table
(Parted) resize NUMBER START END
(Parted) q
The above section only describes how to use the file system feature in tune2fs/debugfs, because I only want to use this, And because parted requires that the file system cannot have too many feature, it supports only a few feature types. the usage of parted is similar to that of fdisk.
4) e2fsck
# E2fsck-f-y/dev/sda6-f indicates force, and-y indicates that all prompts are answered yes.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

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.