Ubuntu Additional disk space

Source: Internet
Author: User

When installing with Wubi, the default is 20G space, obviously not enough to add space from windows

First, use the Win7 disk partitioning tool to draw a new partition (lossless data) (such as NTFS) from any disk with more free space, which is used as a new space for Ubuntu.

Computer--management--Disk Management--disk 0--Select which partition, right--compress volume--wait for a piece of free partition--right-click New Simple volume, follow the instructions to go down

And then:

Mount the new disk under Linux to the specified directory/home or root directory/under (be sure to do a backup).

For example, add disk space to the/home directory:

Df-lh

Locate the location where the new disk is mounted, such as/DEV/SDA10, and the device number varies.

3. Reboot into single user mode (recovery modes), log in as root.

4, the format of the new partition is EXT4, can also be ext3:

Mkfs.ext4/dev/sda10

5. Back Up/home directory

Mv/home/home.bak

6. If the/home directory is already mounted, uninstall first, then delete:

Umount/home
Rm/home

7. Re-create the/home directory:

Mkdir/home

8. Mount the partition you just formatted to the/home directory:

Mount/dev/sda10/home

9. Restore all Files under/home:

Cp-r/home.bak/*/Home

10, set back the original user directory permissions:

Chown-r name:name File

Name is the user name, file is the user path, such as/home/zhengwei

11, modify the permissions:

CD ~/
Chown name. DMRC
Cd/home
Chown name Name
chmod 755 Name

12, edit the Fstab, so that the newly-entered devices automatically mount:

Vim/etc/fstab

Edit file,/dev/hda10/home Auto RW 0 0

Auto-recognize the disk format instead of auto. RW is readable and writable.

Last reboot, enter the system to view the remaining space of/home and/

Problems encountered:

In recover mode, unable to get root read-write permission, CP and MV operations are not valid

Execution at the command line: Mount-o REMOUNT,RW/

Can.

How to clean:

From the Internet to summarize the following several commonly used garbage cleanup methods:

1) Very useful to clean up the junk command:

#sudo Apt-get AutoClean

#sudo Apt-get Clean

#sudo Apt-get Autoremove

These three commands mainly clean up the upgrade cache and garbage packets.

2) Delete the old kernel and related configuration, you can go to the/boot directory, delete the old core/lib/modules the relevant module files

It's too dangerous!! If the kernel is deleted, there is no way to start it.

But there are ways to recover:

Http://www.linuxidc.com/Linux/2012-02/55303.htm

Ubuntu Additional disk space

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.