Disk mounts on Linux

Source: Internet
Author: User

Linux disk Mount

One, disk partitioning

In the terminal input fdisk–l command to view the entire system partition. You can see that there is also a 32G/dev/vdb disk that is not mounted using


Input FDISK/DEV/VDB for partitioning operations


As shown in command (): Enter M to view the commands described

Enter n new partition, here is 32 of the disk is divided into a zone, you can also enter the size of the partition you want, if directly enter the default is all disk space.

Partion ... (1-4) The number is the partition number, according to the circumstances of their own choice

At this point in the input p can be seen just in the established partition

Then enter W to save the exit if input q is not saved

Partition is only valid after restarting the machine

Second, disk format

Partition format with Mke2fs–j–l "vbird_logical" –b 2048–i 8192/dev/vdb1 directly in terminal input

Here is the format to the ext3 file format, if no j is specified as Ext3

Third, Mount

If there is an important file in the mounted directory, move the file to a different directory, and then mount the disk partition under that directory (this is mounted to/Var)

Mount Command: Mount/dev/vdb1/var

Load and then move the original data back to/var

Remove Mount: UMOUNT/DEV/VDB1

Note: If you want to mount the load must be set to mount, so you must first remove this mount, but this mount is necessary, should be so that the original/var files will be moved to the partition disk, and so on after the installation, the machine can restart normally, or there will be a system failure, If you mount a non-system file directory, this will ensure that the file is not lost, or you will not find the original file in the Mount directory

Four, set the boot mount

In Terminal input Nano/etc/fstab

Write

/DEV/VDB1 (Mount partition)/VAR (this is the directory to mount) ext3 defaults 1 2

Press ctrl+x and select Yes to exit, restart the machine is good

Note: A disk partition can be mounted in multiple directories

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Disk mounts on Linux

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.