Linux disk operations (resizing)

Source: Internet
Author: User
For example, if you want to extend the f disk in Windows to/home in Linux, you can use the following method:

First, format the f disk to the ext3 format. Command:

Code:
Sudo mke2fs-J/dev/sda8



Then mount the partition to a directory, such as/Medis/F (if the directory F is not available, create it yourself ). For the sake of security, it is best not to mount it directly to/home first. Command:

Code:
Sudo mkdir/Media/F

Sudo Mount-T ext3/dev/sda8/Media/F



Move/home to/Media/f. Of course, you can use the copy method for the sake of insurance. Command:

Code:
Sudo CP/home/Media/F



Note that the root permission is used throughout the process, and the/home/username directory of the user is accessed when the system enters, the permission to move the Directory
The limit is root, so you need to change the permission. Of course, this is not required if you do not extend this partition to the/home directory. However, pay attention to permission issues. Command:
(Username corresponds to your user name)

Code:
Sudo chown-r username: username/Media/f/Username



Unmount the partition and delete the/Media/F directory. Command:

Code:
Sudo umount/Media/F

Sudo rmdir F



Finally, modify the/etc/fstab file. You can set the option for this partition against the mount of the root system (UUID may be used, and commands can be used ).

Code:
Sudo vol_id -- UUID/dev/sda8

To view its UUID.

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.