How to mount a second disk in a Linux system

Source: Internet
Author: User
Tags cloud vps vps


Often with the VPS students, when buying a VPS usually use these commands, now the cloud VPS are mostly two hard drives, a data disk, a system disk. Data disk in the VPS initialization when the default is not formatted and mounted, I found a way online for netizens to use, do not thank, haha!
Use Df-h to query for details such as the distribution, size, and usage of the current file system.
Use the Fdisk-l command to view the entire disk system situation. You can see the SDB information.

Enter Command Fdisk/dev/sdb
Enter the Help directory for M when entering the interface to the SDB operation.
Command (M for help): M
Command Action
A toggle a bootable flag
b Edit BSD Disklabel
C Toggle the DOS compatibility flag
D Delete a partition
L list known partition types
M Print this menu
n Add a new partition
o Create a new empty DOS partition table
P Print the partition table
Q Quit without saving changes
s create a new empty Sun Disklabel
t change a partition ' s system ID
U Change display/entry units
V Verify the partition table
W Write table to disk and exit
X Extra functionality (experts only)

Because you do not require a detailed partition to SDB, just give it a partition, select n
Command (M for help): N
Command Action
E Extended
P primary partition (1-4)

Then select the P primary partition, or you can't mount the system. Then always enter the line, note that the way required input is the first few partitions, input 1, that is, sdb1. Then you want to enter the partition size, from which to which block. The default is from 1 to the end, that is, to divide all the hard disk space to make a partition.
Select W to save the partition table when finished.
Then format the partition in EXT3 format:

Mkfs.ext3/dev/sdb1

When you are done, start the mount operation.
Use the Mount command to mount a partition in a directory
Mount/dev/sdb1/home/yun
The disk can already be used properly at this time, but will be mounted each time it reboots.
Modify the/etc/fstab file and add entries to enable the system to mount the disk automatically.
Vi/etc/fstab
Add a row to the document.
/dev/sdb1/home/yun ext3 default 0 0
Note that the middle space is entered with the TAB key. When you are done, you can see the new mounted file system by entering Df-h

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.